简体   繁体   English

在哪里可以找到 PayPal Checkout Button 属性的完整列表?

[英]Where can I find a full list of PayPal Checkout Button properties?

PayPal Checkout offers a JavaScript function to display buttons example: PayPal Checkout提供了一个 JavaScript 函数来显示按钮示例:

<script>
  paypal.Buttons({
    createOrder: function(data, actions) {
      // Set up the transaction
      return actions.order.create({
        purchase_units: [{
          amount: {
            value: '0.01'
          }
        }]
      });
    }
  }).render('#paypal-button-container');
</script>

As you see, the Buttons function has an object as a parameter.如您所见, Buttons函数有一个对象作为参数。 Where can I see all the available properties of this object?我在哪里可以看到这个对象的所有可用属性?

Check https://developer.paypal.com/docs/api/orders/v2/#orders_create检查https://developer.paypal.com/docs/api/orders/v2/#orders_create

Request body section contains all the data that can be passed.请求正文部分包含所有可以传递的数据。

Here's a full list of everything you need这是您需要的一切的完整列表

"purchase_units": [
    {
      "reference_id": "store_mobile_world_order_1234",
      "description": "Mobile World Store order-1234",
      "amount": {
        "currency": "USD",
        "details": {
          "subtotal": "1.09",
          "shipping": "0.02",
          "tax": "0.33"
        },
        "total": "1.44"
      },
      "payee": {
        "email": "seller@example.com"
      },
      "items": [
        {
          "name": "NeoPhone",
          "sku": "sku03",
          "price": "0.54",
          "currency": "USD",
          "quantity": "1"
        },{
          "name": "Fitness Watch",
          "sku": "sku04",
          "price": "0.55",
          "currency": "USD",
          "quantity": "1"
        }
      ],
      "shipping_address": {
        "line1": "2211 N First Street",
        "line2": "Building 17",
        "city": "San Jose",
        "country_code": "US",
        "postal_code": "95131",
        "state": "CA",
        "phone": "(123) 456-7890"
      },
      "shipping_method": "United Postal Service",
      "partner_fee_details": {
        "receiver": {
          "email": "partner@example.com"
        },
        "amount": {
          "value": "0.01",
          "currency": "USD"
        }
      },
      "payment_linked_group": 1,
      "custom": "custom_value_2388",
      "invoice_number": "invoice_number_2388","payment_descriptor": "Payment Mobile World"
    }
  ],
  "redirect_urls": {
    "return_url": "https://example.com/return",
    "cancel_url": "https://example.com/cancel"
  }
}'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM