我已经建立了一个使用PayPal的checkout.js
付款的网站。我正在沙盒上运行它,但是由于某种原因,付款没有显示在商家的帐户中。
客户成功付款,但表明商家尚未接受付款。在商家帐户中根本没有任何内容-没有提及交易。但是奇怪的是,在开发人员站点中,沙箱帐户中会出现一条通知,其中包含交易的详细信息。该通知中包含一个确认我的电子邮件的链接(不起作用)。无论如何,我给人的印象是自动接受了通过Developer网站(属于我的)创建的沙箱帐户。
我还确保两个帐户都没有“审核付款”,并检查商家的电子邮件是否正确。
我用于付款的代码直接来自PayPal文档:
<div id="paypal-button"></div>
<script>
paypal.Button.render({
// Configure environment
env: 'sandbox',
client: {
sandbox: 'REDACTED',
production: 'REDACTED'
},
// Customize button (optional)
locale: 'en_US',
style: {
size: 'small',
color: 'gold',
shape: 'pill',
},
// Enable Pay Now checkout flow (optional)
commit: true,
// Set up a payment
payment: function(data, actions) {
return actions.payment.create({
transactions: [{
amount: {
total: '30.11',
currency: 'USD',
details: {
subtotal: '30.00',
tax: '0.07',
shipping: '0.03',
handling_fee: '1.00',
shipping_discount: '-1.00',
insurance: '0.01'
}
},
description: 'The payment transaction description.',
custom: '90048630024435',
//invoice_number: '12345', Insert a unique invoice number
payment_options: {
allowed_payment_method: 'INSTANT_FUNDING_SOURCE'
},
soft_descriptor: 'ECHI5786786',
item_list: {
items: [
{
name: 'hat',
description: 'Brown hat.',
quantity: '5',
price: '3',
tax: '0.01',
sku: '1',
currency: 'USD'
},
{
name: 'handbag',
description: 'Black handbag.',
quantity: '1',
price: '15',
tax: '0.02',
sku: 'product34',
currency: 'USD'
}],
shipping_address: {
recipient_name: 'Brian Robinson',
line1: '4th Floor',
line2: 'Unit #34',
city: 'San Jose',
country_code: 'US',
postal_code: '95131',
phone: '011862212345678',
state: 'CA'
}
}
}],
note_to_payer: 'Contact us for any questions on your order.'
});
},
// Execute the payment
onAuthorize: function(data, actions) {
return actions.payment.execute().then(function() {
// Show a confirmation message to the buyer
window.alert('Thank you for your purchase!');
});
}
}, '#paypal-button');
</script>
付款是否应该显示在商家帐户中?如果是这样,问题可能在哪里?