【问题标题】:PayPal API specifying currency SGD指定货币 SGD 的 PayPal API
【发布时间】:2021-10-05 19:08:23
【问题描述】:

我正在开发一个使用 PayPal API 的支付系统。除了交易是美元而不是新元(就像我想要的那样)之外,一切都正常。

来自 react-paypal-button-v2 的 PayPal 按钮

<PayPalButton
  currency='SGD'
  amount={parcel.basePrice}
  onSuccess={successPaymentHandler}
/>

添加 PayPal 按钮的脚本

 const addPayPalScript = () => {
    const script = document.createElement("script");
    script.type = "text/javascript";
    script.src =
      "https://www.paypal.com/sdk/js?client-id=CLIENT_ID&currency=SGD";
    script.async = true;
    script.onload = () => {
      setSdkReady(true);
    };
    document.body.appendChild(script);
  };

我遵循了此处的文档。 https://developer.paypal.com/docs/checkout/reference/customize-sdk/

【问题讨论】:

    标签: reactjs django paypal payment


    【解决方案1】:

    SGD PayPal supported currency,根据该非官方 react-paypal-button-v2 组件的文档,您的代码使用似乎是正确的,所以我不知道这里出了什么问题。

    改用较新的官方@paypal/react-paypal-js

    【讨论】:

    • 我在 intialState 中指定了 locale: en_SG 并且它起作用了。想知道这是否是一个好的解决方案?
    • 我不明白为什么它应该有所作为
    猜你喜欢
    • 1970-01-01
    • 2013-03-16
    • 2022-01-12
    • 2014-12-29
    • 2016-01-21
    • 2014-07-30
    • 1970-01-01
    • 2019-04-09
    • 2014-04-06
    相关资源
    最近更新 更多