Payflow integration and tokenization - paypal

We are planning to integrate to PayPal with following requirements:
We collect card based payments for US customers.
We are planning to integrate with Payflow Gateway with "Sage" as our processor.
We will have customers who will allow us to charge them on a periodic
basis (replenishment with Card on file).
Questions:
Is Payflow Gateway suitable for our requirements?
Does Payflow Gateway has a REST based interface? How do we tokenize (card on file) without keeping card numbers with us?
If "reference transaction" is the only way to do Card on file operation, how do we overcome the expiry period (1 year) of referenced transaction?

Payflow will do this through the reference transaction feature. For a reference transaction, you will be storing the transaction ID in your database, and the next time you want to charge the customer you will use the same transaction ID instead of passing the card details again.
Usually any transaction ID at Payflow is valid for one year, as per the docs. So in order to overcome that one year restriction, you are supposed to update your database every time with the latest transaction ID.
For example, a customer placed an order today, and you store the Payflow transaction ID in the database. Now suppose you need to charge the customer again after 7 months, then you will get a new transaction ID. This time, update your database with the new transaction ID for the same customer, and this way it will be valid again for another year.

You can do reference transactions (using the returned PNREF) but, like you said, they expire in 1 year. The only workaround for this I've found is to issue a zero-dollar authorization (ZDA) to get a new PNREF but there is some confusion about this with some reports saying that the new PNREF created by the ZDA will only work for 14 days.
The online version of the Payflow Pro Guide now states that the PNREF is good for reference transactions for "12 months and possibly up to 15 months". Unfortunately, that is pretty ambiguous wording that doesn't clear up very much.

Related

PayPal Subscribe with a custom billing date at the last business day of every month

For the taxation purposes, the subscription should charge the customer at the last business day of every month. Is there a way to do that instead of charging the customer every month/week?
In the docs https://developer.paypal.com/docs/subscriptions/integrate/ I have not found any way to implement that.
Subscriptions bill on calendar days, and have no knowledge of business days.
Other non-Subscription PayPal integrations, such as using reference transactions or vault, are capable of billing arbitrary amounts at arbitrary times when you do an API operation with the token. (They require the reference transaction feature which is not enabled on live accounts by default, the account owner must contact PayPal's business support --not technical support-- to request it and only then can PayPal guide you on which API to integrate)

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.

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.

Recurring Payments in PayPal

I am trying to use the Recurring payment API offered by PayPal.
I have a scenario which I am not able to address directly. It goes like this.
We have a website where we sell some services. Now the services are charged per user license. A user can buy/cancel user license in between. We want to offer the customer a recurring billing option. We have to notice here that the amount may vary each billing cycle based on the number of user licenses the customer uses during that cycle.
Is there any way I can achieve this using PayPal recurring Payment API's.
I realize this is a very old post, but it still shows up for Google searches, so I thought I'd add:
Paypal does allow you to do this now, using their new adaptive payments api.
Authorize.net also has a service that might work called Customer Information Manager.
The recurring payment option is a fixed amount that the customer pre-agrees to pay each month (or period). To do what you're trying to do, a customer would have to pre-agree to pay whatever amount you decide to charge at a later time. This means pre-authorizing an unknown payment amount, which will not be allowed by any payment service.
Your only options are:
Bill the variable amount each month (i.e. no subscription).
Set up a subscription where the monthly amount is the maximum that could potentially be billed, and then refund the difference each month.
Good luck with #2 - I would never agree to such a thing as a customer, personally.
What you're looking for is covered in the UK by the Direct Debit system, however given the potential for abuse it's very tightly controlled and there are a lot of restrictions and regulations governing it.
I'd strongly suggest you just set up a monthly invoicing system that just bills the client each month.
I don't know its meaning full or not as it is a very old post.
Instead of creating recurring profile on PayPal Server, You can store the customer's credit card on the PayPal using REST API: https://developer.paypal.com/docs/api/#vault then every month you can fetch it and charge it like recurring Payment Or When client is no longer with the services then just remove its card from PayPal.
I suppose Authorize.net SIM method also does the same.
Hope this make sense.