反应Murchant帐户的PayPal js实现问题 [英] React paypal js implementation issue for murchant account

查看:0
本文介绍了反应Murchant帐户的PayPal js实现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用来自库的PayPal托管字段。当我们从HostedFields调用提交函数时,订单未被批准,我们收到的响应是orderID,但它未被批准,其状态仍为Created。

推荐答案

const submitHandler = () => {
     if (!typeof hostedFields.submit !== "function") return; // validate that `submit()` exists before using it
     hostedFields
         .submit({
             // The full name as shown in the card and billing address
             cardholderName: "John Wick",
         })
         .then((order) => {
             fetch(
                 "/your-server-side-integration-endpoint/capture-payment-info"
             )
                 .then((response) => response.json())
                 .then((data) => {
                     // Inside the data you can find all the information related to the payment
                 })
                 .catch((err) => {
                     // Handle any error
                 });
         });
 };

未批准响应中submit()函数订单ID处遇到的问题。

这篇关于反应Murchant帐户的PayPal js实现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆