PayPal Guest Checkout - не взимается
Я использую PayPal Express Checkout. Он показывает пользователям возможность оформить заказ через PayPal или оформить заказ в качестве гостя, используя только кредитную карту.
https://developer.paypal.com/demo/checkout/
Иногда, когда пользователь пытается зарегистрироваться в качестве гостя PayPal, экран перенаправляется, но с пользователя не взимается плата. Ясно, что какой-то тип проблемы оплаты (или что-то), но PayPal не показывает уведомлений об ошибках. Это невероятно сбивает с толку клиентов, потому что они считают, что с них сняли деньги, когда нет.
Я думаю, что-то не так с моей настройкой, но я не уверен, что это может быть.
<script>
// Render the PayPal button
paypal.Button.render({
// Set your environment
env: 'production', // sandbox | production
// Specify the style of the button
style: {
label: 'checkout',
fundingicons: true, // optional
branding: true, // optional
size: 'medium', // small | medium | large | responsive
shape: 'rect', // pill | rect
color: 'blue' // gold | blue | silve | black
},
// PayPal Client IDs - replace with your own
// Create a PayPal app:
client: {
sandbox: 'MY#',
production: 'MY#'
},
Wait for the PayPal button to be clicked
payment: function(data, actions) {
// Make a client-side call to the REST api to create the payment
return actions.payment.create({
payment: {
transactions: [
{
amount: { total: '9.99', currency: 'USD' }
}
]
},
experience: {
input_fields: {
no_shipping: 1
}
}
});
},
Wait for the payment to be authorized by the customer
commit: true,
onAuthorize: function(data, actions) {
// Execute the payment
return actions.payment.execute().then(function() {
$("#payWall").hide();
$("#signUpForm").show();
});
}
}, '#paypal-button-container');
</script>