PayPal recurring payments: How to add initial payment.

China☆狼群 提交于 2019-12-11 02:56:50

问题


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:


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.



来源:https://stackoverflow.com/questions/25686661/paypal-recurring-payments-how-to-add-initial-payment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!