PayPal recurring payments: How to add initial paym

2019-08-10 05:35发布

I have been using implementing a function that use can do recurring payments using PayPal with this request (copied from https://developer.paypal.com/webapps/developer/docs/api/#create-a-plan)

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"
    }
}'

the above request will create regular recurring payment. I want to add initial payment to the request above. I found a way with Classic API as in https://developer.paypal.com/docs/classic/paypal-payments-pro/integration-guide/WPRecurringPayments/ Specifying an Initial Payment part. However I could not find a way to add initial payment using REST API. Thanks!

1条回答
地球回转人心会变
2楼-- · 2019-08-10 06:08

Hey this is avi from PayPal here. The setup_fee under the merchant_preferences section for rest billing plans corresponds to the initial payment for recurring payments in the classic api. That fee is charged only once when after user consents to billing plan to form billing agreement.

查看更多
登录 后发表回答