2014-09-05 190 views
1

我一直在使用實施PayPal定期付款:如何添加初始付款。

curl -v POST https://api.sandbox.paypal.com/v1/payments/billing-plans \ 
-H 'Content-Type:application/json' \ 
-H 'Authorization: Bearer <Access-Token>' \ 
-d '{ 
    "name": "T-Shirt of the Month Club Plan", 
    "description": "Template creation.", 
    "type": "fixed", 
    "payment_definitions": [ 
     { 
      "name": "Regular Payments", 
      "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" 
        } 
       } 
      ] 
     } 
    ], 
    "merchant_preferences": { 
     "setup_fee": { 
      "value": "1", 
      "currency": "USD" 
     }, 
     "return_url": "http://www.return.com", 
     "cancel_url": "http://www.cancel.com", 
     "auto_bill_amount": "YES", 
     "initial_fail_amount_action": "CONTINUE", 
     "max_fail_attempts": "0" 
    } 
}' 

上述要求將建立定期定期付款使用可以做到通過PayPal定期付款這一要求(從https://developer.paypal.com/webapps/developer/docs/api/#create-a-plan複製)功能。我想爲上述請求添加初始付款。我找到了使用Classic API的方法,如https://developer.paypal.com/docs/classic/paypal-payments-pro/integration-guide/WPRecurringPayments/指定初始付款部分。但是我找不到使用REST API添加初始付款的方法。謝謝!

回答

3

嘿,這是從PayPal這裏avi。 merchant_preferences部分下的setup_fee用於休息賬單計劃,與經典api中的定期付款的初始付款相對應。在用戶同意計費計劃以形成計費協議後,該費用僅收取一次費用。