Unable to integrated react-paypal-button-v2 in react app

穿精又带淫゛_ 提交于 2019-12-11 07:14:13

问题


I am trying to integrate [react-paypal-button-v2][1] in my react app but after filling the details it is showing Something went wrong

     <PayPalButton
        amount="0.01"
        onSuccess={(details, data) => {
          console.log(details,"data")
          alert("Transaction completed by " + details.payer.name.given_name);

          // OPTIONAL: Call your server to save the transaction
          // return fetch("/paypal-transaction-complete", {
          //   method: "post",
          //   body: JSON.stringify({
          //     orderID: data.orderID
          //   })
          // });
        }}
           catchError={(err)=>{
          console.log(err)
            alert(err)

         }
          }
        onError ={(err)=>{
          alert(err)
       console.log(err)

       }
      }
    options={{
          clientId: "xxxxxx"
        }}
      />

this is first screen shot once page load [![enter image description here][2]][2]

this is the second screen shot when I click on mastercard option [![enter image description here][3]][3]

and this is third screen shot when I click on pay now button then its shwo processing but after sometime its show me this page.

[![enter image description here][4]][4]

If click on try again button its redirect to the sandbox and ask for singup

[![enter image description here][5]][5]

I have not integrated any payment getaway in any app so far, that's why I am not able to figure it out that what might cause of it, why its throwing error.

Please your help would be highly appreciated

Thanks in Advance.

来源:https://stackoverflow.com/questions/58448782/unable-to-integrated-react-paypal-button-v2-in-react-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!