[Fixed]-Paypal monthly subscription plan settings for first day of the month and making monthly recurring payment – django python

6👍

Paypal will automatically try to keep the billing date the same for every month (where applicable, as stated in the linked resource).

You can state the starting date of a billing agreement as stated in this example, by specifying a start_datefield.
Here I use the arrow module, to conveniently calculate the first day of the next month:

import arrow

billing_plan = paypalrestsdk.BillingPlan({
    "name": "Monthly Billing Plan",
    "description": "Monthly Plan",
    "start_date": arrow.utcnow().shift(months=+1).replace(day=1).isoformat(),
    "merchant_preferences": {
        ...
        "setup_fee": {
            "currency": "USD",
            "value": "100"
        }
    }
    ...
})

The initial subscription fee should be handled by the setup_fee field!


EDIT after question update:

On the merchant_preferences field of your plan, you are setting auto_bill_amount to yes.
By taking a look at the documentation on merchant_preferences we can see that:

auto_bill_amount enum

Indicates whether PayPal automatically bills the outstanding balance in the next billing cycle. The outstanding balance is the total amount of any previously failed scheduled payments. Value is:

NO. PayPal does not automatically bill the customer the outstanding >balance.
YES. PayPal automatically bills the customer the outstanding balance.

Possible values: YES, NO.

Default: NO.

Leave a comment