I am using Django paypalrestsdk for PayPal https://github.com/paypal/PayPal-Python-SDK
And I would like to setup a monthly subscription plan. Every beginning of the month, the buyer will be charged USD100.
This is my billing plan code I have made:
billing_plan = paypalrestsdk.BillingPlan({
"name": "Monthly Billing Plan",
"description": "Monthly Plan",
"merchant_preferences": {
"auto_bill_amount": "yes",
"cancel_url": "http://localhost:8000/payment_billing_agreement_cancel",
"initial_fail_amount_action": "continue",
"max_fail_attempts": "0",
"return_url": "http://localhost:8000/payment_billing_agreement_execute",
"setup_fee": {
"currency": "USD",
"value": "100"
}
},
"payment_definitions": [
{
"amount": {
"currency": "USD",
"value": "100"
},
"cycles": "0",
"frequency": "MONTH",
"frequency_interval": "1",
"name": "Monthly Payment",
"type": "REGULAR"
}
],
"type": "INFINITE"
})
It is not clear to me if it is charging on the first day of the month or the last day of the month? Should I have the setup so it's charged immediately? My intention is charging is done on the first day of the month.
I am seeing this in the sandbox of the buyer: Preapproved payment USD100 What does this mean, is he charged already USD100 or preapproved and charged on the last day of the month?
Based on this, it seems like its charged right away. meaning it should show USD200 right? (setup + monthly but its showing only USD100) https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/subscription_billing_cycles/
I've used this flow so far:
create billing plan
activate billing plan
create billing agreement
execute billing agreement
(is this correct? it shows pre-approved but is this really charged, if not what other steps should be taken to charge it properly)
To clarify, the main question is how do you set up monthly billing with PayPal (and to set the charging cycle, whether it's beginning of the month or end)? (in this example, its using django python)
UPDATE:
On a recommendation @john-moutafis, I'ved now have setup USD100, and recurring start date is set 1 month later for USD111
billing_agreement = paypalrestsdk.BillingAgreement({
"name": "Monthly Billing Agreement",
"description": "Monthly Payment Agreement",
"start_date": arrow.utcnow().shift(months=+1).datetime.strftime('%Y-%m-%dT%H:%M:%SZ'),
"plan": {
"id": billing_plan.id
},
"payer": {
"payment_method": "paypal"
}
})
Here is paypal screenshots, why is there no info on amount and why is it preapproved without recurring info ? https://imgur.com/a/Sp7JdVC