我正在使用计费计划的Paypal Rest API,我需要知道API计费计划是否会影响

时间:2018-10-05 13:16:21

标签: paypal

    ##Here i used rest api##
    curl -v -X POST https://api.sandbox.paypal.com/v1/payments/billing-plans/ \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer Access-Token" \
     -d '{
      "name": "Plan with Regular and Trial Payment Definitions",
     "description": "Plan with regular and trial payment definitions.",
      "type": "FIXED",
       "payment_definitions": [
     {
      "name": "Regular payment definition",
      "type": "REGULAR",
      "frequency": "MONTH",
      "frequency_interval": "2",
      "amount": {
        "value": "100",
        "currency": "USD"
      },
      "cycles": "12",
      "charge_models": [
        {
          "type": "SHIPPING",
          "amount": {
            "value": "10",
            "currency": "USD"
          }
        },
        {
          "type": "TAX",
          "amount": {
            "value": "12",
            "currency": "USD"
          }
        }
      ]
    },
    {
      "name": "Trial payment definition",
      "type": "TRIAL",
      "frequency": "WEEK",
      "frequency_interval": "5",
      "amount": {
        "value": "9.19",
        "currency": "USD"
      },
      "cycles": "2",
      "charge_models": [
        {
          "type": "SHIPPING",
          "amount": {
            "value": "1",
            "currency": "USD"
          }
        },
        {
          "type": "TAX",
          "amount": {
            "value": "2",
            "currency": "USD"
          }
        }
      ]
    }
  ],
  "merchant_preferences": {
    "setup_fee": {
      "value": "1",
      "currency": "USD"
    },
    "return_url": "https://example.com",
    "cancel_url": "https://example.com/cancel",
    "auto_bill_amount": "YES",
    "initial_fail_amount_action": "CONTINUE",
    "max_fail_attempts": "0"
  }
}"

我成功创建了状态回复,...但是当我转到Paypal开发者帐户并选中..i时,找不到任何新付款, 你能告诉我具体代码是否会反映出来,你能帮助我找到是否会反映出贝宝计费计划请求吗?我在上面附加了以下api请求...

1 个答案:

答案 0 :(得分:0)

创建帐单计划后,您必须执行以下操作。

  1. 激活该计划
  2. 创建协议
  3. 获得客户认可
  4. 执行协议

https://developer.paypal.com/docs/subscriptions/