【问题标题】:Set Country + Phone on Paypal Smart Payment Buttons在 Paypal 智能支付按钮上设置国家 + 电话
【发布时间】:2019-12-28 07:34:12
【问题描述】:

我在使用Smart Payment Buttons 向 PayPal 发送动态付款时尝试设置国家和电话号码。

我确保与 REST 应用关联的沙盒帐户也来自加拿大。

这是我输入到actions.order.create()的订单:

{
    "purchase_units": [{
        "items": [{
            "name": "Test Item",
            "quantity": 1,
            "unit_amount": {
                "value": "125.01",
                "currency_code": "CAD"
            }
        }, {
            "name": "Beach Therapy",
            "quantity": 1,
            "unit_amount": {
                "value": "1010.00",
                "currency_code": "CAD"
            }
        }],
        "amount": {
            "value": "1135.01",
            "currency_code": "CAD",
            "breakdown": {
                "item_total": {
                    "value": "1135.01",
                    "currency_code": "CAD"
                }
            }
        }
    }],
    "application_context": {
        "brand_name": "TEST",
        "landing_page": "BILLING",
        "shipping_preference": "NO_SHIPPING",
        "user_action": "PAY_NOW",
        "locale": "en-CA"
    },
    "payer": {
        "email_address": "wafe@fewa.com",
        "phone": {
            "phone_number": {
                "national_number": "16135802400"
            }
        },
        "address": {
            "address_line_1": "",
            "address_line_2": "",
            "admin_area_2": "Ottawa",
            "admin_area_1": "ON",
            "postal_code": "K1P",
            "country_code": "CA"
        }
    }
}

【问题讨论】:

  • 嘿@Chris,填写付款人电话号码和国家/地区有什么好运气吗?
  • @gothy Nope :((
  • 我们在 PayPal 集成方面遇到了很多奇怪的问题......这太疯狂了????
  • @gothy 刚刚发现了一些东西。结帐答案。

标签: paypal paypal-sandbox


【解决方案1】:

不完整的答案:

刚刚遇到这个。期待试用。

<script src="https://www.paypal.com/sdk/js?client-id=sb"></script>
<script>paypal.Buttons({
  enableStandardCardFields: true,
  createOrder: function(data, actions) {
    return actions.order.create({
      intent: 'CAPTURE',
      payer: {
        name: {
          given_name: "PayPal",
          surname: "Customer"
        },
        address: {
          address_line_1: '123 Fake Street',
          address_line_2: 'Apt 2',
          admin_area_2: 'San Jose',
          admin_area_1: 'CA',
          postal_code: '95121',
          country_code: 'US'
        },
        email_address: "customer@domain.com",
        phone: {
          phone_type: "MOBILE",
          phone_number: {
            national_number: "14082508100"
          }
        }
      },
      purchase_units: [
        {
          amount: {
            value: '15.00',
            currency_code: 'USD'
          },
          shipping: {
            address: {
              address_line_1: '2211 N First Street',
              address_line_2: 'Building 17',
              admin_area_2: 'San Jose',
              admin_area_1: 'CA',
              postal_code: '95131',
              country_code: 'US'
            }
          },
        }
      ]
    });
  }
}).render("body");
</script>

来源:Paypal - Standard Card Fields

【讨论】:

    猜你喜欢
    • 2020-03-23
    • 2019-11-16
    • 2020-05-09
    • 2019-10-31
    • 2021-01-28
    • 2021-07-14
    • 2020-10-16
    • 2020-05-25
    • 1970-01-01
    相关资源
    最近更新 更多