我已经在web应用程序中集成了PayPal客户端快速结账功能。使用ios web视图,我已经创建了一个应用程序。现在,每当我单击PayPal结帐模式时,它都会弹出并立即关闭。我在iOS10.3及以上版本中遇到了这些问题。对于10.3设备以下的所有设备,结帐都可以正常工作。
请给我一个解决方案。
以下是代码
<div id="paypal-button-container"></div>
<script>
// Render the PayPal button
paypal.Button.render({
// Set your environment
env: 'sandbox', // sandbox | production
// PayPal Client IDs - replace with your own
// Create a PayPal app: https://developer.paypal.com/developer/applications/create
client: {
sandbox: 'XXXXXX,
production: 'XXXXXX'
},
// Wait for the PayPal button to be clicked
payment: function() {
// Make a client-side call to the REST api to create the payment
return paypal.rest.payment.create(this.props.env, this.props.client, {
transactions: [
{
amount: { total: '0.01', currency: 'USD' }
}
]
});
},
// Wait for the payment to be authorized by the customer
onAuthorize: function(data, actions) {
// Execute the payment
return actions.payment.execute().then(function() {
document.querySelector('#paypal-button-container').innerText = 'Payment Complete!';
});
}
}, '#paypal-button-container');
</script>`发布于 2017-06-25 06:01:41
请确保在代码中输入您的应用程序客户端ID:
client: {
sandbox: 'AVEqB1ga85Bzn8r8o5cckJN7peyaPgQy1zzH748iCwMGuVQN8jtZP8i0gV5ghuolgJsUe7JoMcjwsqrC,
production: 'XXXXXX'
},https://stackoverflow.com/questions/43423699
复制相似问题