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

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.

Related

How long is a payment executable?

When I create a payment and locally store the paymentId and payerId, is it possible to execute the payment two months later?
I want to allow a free testing phase for an application and execute only if the user still wants to use the product after two months.
Basically, PayPal guarantees to capture the funds up to 3 days from the day of authorization. I remember we had to automatically approve PayPal orders that required manual review or we would lose them after the 3-day authorization period.
Looking at their documentation they explain that an authorization can be re-authorized in a 29 day period.
Check their autorization period and honor period documentation here:
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/authcapture/#honor-period-and-authorization-period
Having said that, I believe that the capability you're looking for is called a "billing agreement" or "reference transaction". It allows to create an agreement with the shopper (on a 0$ payment) that can be charged at a later time. This feature requires special underwriting by PayPal, and is not easily approved. See documentation here:
https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECReferenceTxns/

PayPal Express Checkout with a mix of one time purchase and recurring payments through the REST API

I am using the PayPal REST API and would like to create a transaction that includes a combination of recurring and one-time payments in a single transaction.
According to the documentation for the NVP integration, it seems such a transaction is possible. However, I'm not sure how to accomplish the same using the REST API. I have searched the REST API documentation as well as the .NET SDK examples and cannot find an example of a transaction that uses a mix of recurring and one-time payments.
Our use case: We process transactions for downloadable software - most of the products are one-time purchases, but some of the products (such as anti-virus products) have a recurring billing component associated with them. As such, we need to process a single transaction where one of the items is a regular purchase, and the other is a part of a recurring plan. We plan to process these transactions using the "PayPal" payment method (i.e. not direct credit card). Specifically, we'll be using Express Checkout.
Any guidance would be much appreciated. Thank you!
Based on what you're doing about, here's what I think your best course of action might be:
When you have a user checking out that may have some multi-month subscriptions, and some single time subscriptions, you set up a new billing plan with each item to be purchased. For the subscriptions, you set up an entry that is set to multiple months, and for a single payment you set a single month payment (see https://developer.paypal.com/docs/integration/direct/create-billing-plan/ for an example of multiple entries).
Next, you need to execute that plan for the user via a billing agreement (https://developer.paypal.com/docs/integration/direct/create-billing-agreement/). Within the billing agreement you can set the start date to execute immediately, which should complete the checkout process for both billing orders right then.
Let me know if that works out for your scenario.

Per-user / per-quantity recurring billing. What are alternatives to Stripe?

I am looking for alternatives to stripe's per-user pricing subscription : I need :
to charge my user a recurring payment which depends on the number of user accounts he has
to be able to change the number of users via an API, with customer validation is ok, but ideally without changing a plan nor creating a new type of plan. Check status, cancel, etc. via the API too.
Ideally with no up-front charge = fee + percentage of transaction
I found out that stripe might be a good option (see per-user pricing here https://stripe.com/docs/subscriptions) and unfortunately Paypal does not seem to offer this kind of feature (plans can only be increased by 20% each 180 days or you need to cancel previous profile and create a new one). Or am I mistaking about Paypal ?
What alternatives would exist for such needs?
What you want are Reference Transactions, in which case you run an original authorization or sale transaction, and then in the future you'd run DoReferenceTransaction with the original transaction ID and any new amount you need to process. It will process immediately without any redirection or additional authorization required at that point.
If you use reference transactions with Payments Pro (direct credit cards) then all you need to do is save the original auth or sale transaction ID to your database so that you can pull it out for the user when you need to process a future payment using DoReferenceTransaction.
For PayPal payments you'll use Express Checkout w/ Billing Agreements, which will give you back a billing agreement ID. In that case, the billing agreement ID is what you'd pass into future calls to DoReferenceTransaction.
In either case you'll need to build your own system to lookup payments that need to be processed each day and loop through them making a call to DoReferenceTransaction for each one.

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.

Get Transactions associated with a Recurring Payment Profile in Paypal

I have gone through nearly all the question related to Recurring Payment using Paypal and have not found a solution to my problem.
We are implementing a system that is subscription based on a monthly basis (fixed amount). We do not want to store CC details for security reasons, hence we are trying to use Website Payments Pro from Paypal.
Once a user agrees to recurring payments, we are creating a RecurringPaymentProfile for that user and are storing the returned Profile_Id for the user.
Now we need to get information about all the transactions related to this Recurring Profile_Id. This information is available when we login to the Paypal account but this needs to be automated so that the application is aware of all the payments and also of the current subscription of the user.
We have found two methods (possibly) to implement this.
1. IPN (Instant Payment Notification, for this we will have to create a service to listen to notifications, which seems to be cumbersome and is more informational than we require)
2. TransactionSearch (but this returns transactions for the Paypal account and not Profile_Id)
Since we just want to know the transaction history associated with the Recurring Profile and whether this months payment was successful (implying the user is active member), what is the best method to implement this ?
Thanks,
You're looking for the GetRecurringPaymentsProfileDetails API Operation. This operation will allow you to view a majority of the details associated with a recurring payment profile using a valid PROFILEID.
Relevant detail fields you may be interested in:
LASTPAYMENTDATE
The date of the last successful payment received for
this profile, in YYYY-MM-DD format.
LASTPAYMENTAMT
The amount of the last successful payment received for this profile.
FAILEDPAYMENTCOUNT
The total number of failed billing cycles for this profile.
NEXTBILLINGDATE
The next scheduled billing date, in YYYY-MM-DD format.
NUMCYCYLESCOMPLETED
The number of billing cycles completed in the
current active subscription period. A billing cycle is considered
completed when payment is collected or after retry attempts to collect
payment for the current billing cycle have failed.