【问题标题】:Adyen Payment - how to prevent a PayPal popup when the user taps the PayPal buttonAdyen Payment - 当用户点击 PayPal 按钮时如何防止 PayPal 弹出
【发布时间】:2021-10-10 07:08:57
【问题描述】:

我想在提交时进行一些验证,但问题是弹出了一个新的 PayPal 窗口。除非我进行验证,否则我不希望弹出窗口。

const paypalComponent = checkout.create("paypal", {
    onSubmit: (state, component) => {
        if(isValidationOk){
            // do your action...
        }else {
            // close the PayPal popup
        }
    }
}).mount("#paypal-container");

【问题讨论】:

    标签: javascript paypal payment-gateway


    【解决方案1】:

    您需要使用验证消息调用 setStatus 方法。

    const paypalComponent = checkout.create("paypal", {
        onSubmit: (state, component) => {
            if(isValidationOk){
                // do your action...
            }else {
                component.setStatus('error', { message: 'Your validation message.' });
    
                setTimeout(function () {
                    component.setStatus('ready');
                }, 5000);
            }
        }
    }).mount("#paypal-container");
    

    【讨论】:

      猜你喜欢
      • 2019-06-20
      • 2011-06-27
      • 2011-04-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-20
      • 2014-12-11
      • 2011-05-01
      相关资源
      最近更新 更多