Paypal recurring payment, how to update and charge outstanding balance in the middle of a cycle - paypal

I have the following scenario and I was wondering how to go about it:
A $10 monthly recurring payment is created, let's say starting today 11/19.
On 11/30 the user adds another module to the package that costs $5 more a month. All is well, I can update the recurring payment to $15 a month, so on 12/19 the user will get charged $15.
Since the user added this new module in the middle of a billing cycle, I would like to charge the profile the outstanding amount between 11/30 when the new package was added, and until 12/19 wen the new billing cycle kicks in (roughly that would amount to about $2.70 in this case).
I tried adding an outstanding balance when the profile is updated, however the API returns a failure message: the delinquent amount cannot be increased.
Other than cancelling the current profile and creating a new one is there any way to just update the existing one? Or if I cancel it, would the user have to reenter their credit card/ address again? I suppose I could always store this info in the paypal vault and retrieve it later.
Any help is appreciated,
Thanks!

Have you tried running BillOutstandingAmount first?

Related

How to charge prorated rate on paypal subscription?

Trying to set up a subscription via paypal rest API. I am looking on a solution on how to modify the subscription and charge the specific fee in 1 checkout. I found a way to change the quantity on the subscription, but the problem paypal does not prorate.
So for example, if user subscribes today with 10x of product and then changes the subscription to 20x of product, the paypal will not charge the prorated fee. So how to handle that?
This is an official msg from paypal:
The new price is effective starting on the next billing cycle. Proration and one-time fees aren't automatically supported. If you want to prorate the difference at the time the plan changes or charge one-time fees, you need to do these manually. https://developer.paypal.com/docs/subscriptions/customize/revise-subscriptions/
How do I charge it manually?
How do I charge it manually?
Use setup_fee to simply add an additional fee, or use a 1 cycle trial period to modify the amount of the first payment, which can be lower or higher.

paypal recurring payments - sudden death

We are setting up PayPal recurring payments - customers able to use a PayPal account or a credit card processed through PP.
Payments going through fine and customer accounts upgrade.
The issue we have is when customers cancel - it works, but immediately.
We want their subscription benefits to remain until the next end of their subscription period - hope that makes sense.
At the moment we are getting a "sudden death" scenario, where their accounts are downgrading immediately, rather than at the end of their subscription period.
If anyone has any pointers appreciated.
What you would need to do is setup your own system to handle that. So when your user cancels, mark that in your database along with the date that you actually want the profile to be canceled. Then you can setup a CRON job on your server to run a script that actually processing the cancellation via the API on the actual day you want it to cancel.

Do I need to execute my PayPal BillingAgreement one time only or every time the bill is due

I am trying to incorporate a member subscription on my website using the paypalrestsdk with python in a django application. I understand that I need to do the following:
Set up a BillingPlan for each type of subscription (ie. a monthly plan for $10 a month and a yearly plan for $100 a month)
Create a BillingAgreement, which (based on the user choice of billing plan) redirects the user to approve the agreement and which returns the agreement object which will give me the ability to access the plan information in order to update, suspend, reactivate the agreement.
Finally, in order to get started, I need to execute the BillingAgreement. This is the part that confuses me. Do I execute the agreement each month (for my users who have agreed to monthly subscription) or do I execute the agreement one time in order to tell PayPal to automatically process the monthly payment? If the latter case is the answer then how would I know if a payment failed for some reason? (Or do I need to check every time the user logs in by retrieving their BillingAgreement and searching for transactions within a particular date range for that agreement to make sure they are up to date and none of them failed?)
I have looked at the PayPal developer docs as well as GitHub samples. I have also successfully written code to create and execute one-time payments using the sandbox and all seems to be working just fine. I am just confused by how the recurring payments in the REST api work - specifically see #3 above.
You do not need to execute the billing agreement each month but only once to start the agreement i.e. tell PayPal to automatically process the monthly payment.
You can use the search for transactions feature to check that none of the payments of a user failed, but you might only need to do that at the start of every monthly payment cycle for a particular user. As opposed to everytime they log in. In the future, we will try to provide better notification mechanisms to inform the merchant that a payment on a billing agreement has failed/changed status.

Paypal Recurring Payment API CALL when taking money

I am writing a subscription where I need to provide users a month trial and charge $5.00 after trial is finished. I just found an amazing code to do that for me.
I also have setup paypalpro plus recurring payments
This is the link
https://github.com/krio/paypal-recurring-subscriptions
Questions:
1- How to make first month Free Trial?
2- I need to update users billing and update their payment in my database so it can calculate their subscription, how would i get to call from paypal to my files to update?
If you are using subscriptions and you are wanting to make the first month a free trial, you would need to pass over the following variables and values.
a1=0
p1=1
t1=M
You can find a description of all of the variables for subscriptions here.
If you are wanting to get updates back to your system/database to update your profiles and etc, you can use IPN to do this. Instant Payment Notification (IPN) is a message service that notifies you of events related to PayPal transactions. You can use it to automate back-office and administrative functions, such as fulfilling orders, tracking customers, and providing status and other information related to a transaction.

How do I handle non-recurring Paypal subscriptions? Subscription expires immediately

I'm working on a site that does non-recurring subscriptions, currently testing it on Paypal Sandbox. Let's say duration is 1 week (t3 = W, p3 = 1). I didn't include src and srt variables in the form. From what little information I have read related to this, a non-recurring subscription counts as a one-off and immediately expires the subscription. I want it to still lapse the duration and subscr_eot be called one week later. The application is run on Java/JSP.
This sounds like it needs to be handled on your side, not on PayPal's.
You receive a payment for your services, and attach an expiration date to that user in your database. He's only allowed to log into your site before his account expires.
So, I now devided the fee into two parts: eg, the one year fee is $10, than I charge $9.95 as the one year trial amount a1, and $0.05 as a non-recurring daily fee (a3) for only one day.
Seems that does it... at least the EOT is not immediately send...
Just have to explain your customers that this awkward payment plan is because of a Paypal peculiarity...