Paypal checkout js无法在firefox

时间:2017-03-23 10:20:22

标签: javascript angularjs firefox paypal

我正在使用angularjs开发一个电子商务网站,其中我使用 paypal结帐 https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/script-option ... paypal积分。当用户点击paypal呈现按钮时,应该会打开一个新的弹出窗口,其中paypal登录并付款,然后用户被重定向到我们的应用程序并显示付款详细信息。该应用程序似乎在chrome,edge甚至IE上工作得很好(尽管IE在流程上有不同的问题),但在 firefox 中,弹出模式是触发根本。 无控制台错误,这使得解决起来非常困难。做了很多研究(谷歌搜索:-p),但无法修复它。请任何人帮助我,谢谢。

这是paypal

的脚本js
// Paypal
paypal.Button.render({
    env: 'sandbox', // Environment: 'sandbox' or 'production'
    // Pass the client ids to use to create your transaction on sandbox and production environments
    client: {
        sandbox: 'xxxxxx', // from https://developer.paypal.com/developer/applications/
        production: 'xxxxxx' // from https://developer.paypal.com/developer/applications/
    },
    // Pass the payment details for your transaction
    // See https://developer.paypal.com/docs/api/payments/#payment_create for the expected json parameters
    payment: function() {
        return paypal.rest.payment.create(this.props.env, this.props.client, {
            transactions: [{
                amount: {
                    total: 25.00,
                    currency: 'USD'
                }
                     }]
        });
    },
    // Display a "Pay Now" button rather than a "Continue" button
    commit: true,
    // Pass a function to be called when the customer completes the payment
    onAuthorize: function(data, actions) {
        return actions.payment.execute().then(function() {
            console.log('The payment was completed!');
        });
    },
    // Pass a function to be called when the customer cancels the payment
    onCancel: function(data) {
        // console.log('The payment was cancelled!');
    }
}, '#paypal');

用于渲染按钮的html

<button type="button" id="paypal"></button>

0 个答案:

没有答案