We require reference transactions via PayPal to bill customers monthly with varying amounts.
e.g. first month is $30, second month may be $35, third month may be $25 etc
So far this seems to be the best approach: https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECReferenceTxns/
I am using the PayPal recommended SDK from this page: https://developer.paypal.com/docs/classic/api/nvpsoap-sdks/
and using the ExpressCheckout Method. (paypal/merchant-sdk-php installed via composer)
We have a free PayPal business account.
Testing via Sandbox I am able to:
Get a token (SetExpressCheckout) - category->Digital, billingAgreement, Type=Sale
forward customer to sandbox paypal login
Confirm the payment
redirect back to our system (returnUrl)
Process the payment (GetExpressTocket + doExpressCheckout)
Questions:
Does the PayPal business account require any switch/status/upgrade to enable Reference transactions on the live environment?
How do you setup a $0 billing agreement to invoice an amount later in the month? When passing a 0 amount in step 1 above and error is displayed
Item name, amount and quantity are required if item category is
provided, ErrorCode 10003
This contradicts to documentation https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECReferenceTxns/#setting-up-a-billing-agreement-before-payment which states to set the amount to 0...?
UPDATE: Removing the setting $itemDetails->ItemCategory = 'Digital'; solved the $0 amount issue.
Billing ID is not returned even though I've passed the BillingAgreement data
// Billing agreement details
$billingAgreementDetails = new BillingAgreementDetailsType('MerchantInitiatedBillingSingleAgreement');
$billingAgreementDetails->BillingAgreementDescription = $billingAgreementTxt;
$setECReqDetails->BillingAgreementDetails = array($billingAgreementDetails);
I know there are a few questions within the post but I believe they are all related to the scope of 'Reference Transactions' within PayPal.
I'm looking for recommendations on approach and explanations to the contradictions in documentation. (or if I'm doing something wrong then happy to hear it)
To answer your question:
1) Does the PayPal business account require any switch/status/upgrade to enable Reference transactions on the live environment?
If you are receive an error when calling for Reference Transaction, probably that the setting is turned off in your account. You will need to contact PayPal Business Support team to enable it.
2) Billing ID is not returned.
To setup billing agreement, you will need to pass paymentaction=authorization in SetExpressCheckout request. You will not be able to setup billing agreement if you set the paymentaction as sale.
Related
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.
I have a merchant site.
I wonder if the following scenario is possible :
A customer subscribes a "full shop access" and I can withdraw money from it's paypal account when he purcahses something. He does not have to login to paypal or anything at anytime but the moment he chose "full shop access".
Given that money amount will be differents.
I found a lot of thing about recurrent payment but it's on given periods and given amounts therefore it's not at all what I need.
I just want the customer to say paypal once : "OK, I trust this website, it can get my money anytime he needs to".
So if it's possible, can anyone give me a link to documention about this ?
Regards
1) Create a token using SetExpressCheckout with the L_BILLINGTYPE0 set to MerchantInitiatedBilling
2) Create a billing agreement using CreateBillingAgreement and pass TOKEN for the response after redirecting the user to PayPal.
3) Charge their billing agreement id using DoReferenceTransaction.
This method requires you to get approval from PayPal to use Reference Transactions.
We are setting up new PayPal integration, and I am having some trouble getting the Billing Agreements. Here is our scenario:
Third party captures payment authorization
Third party sends us the Billing Agreement ID (they call it a Transaction Number)
We do a reference transaction to execute the payment, using that ID (this is done to renew a subscription, typically every 30 days or so)
What I am trying to do is actually write that third part. However, first it must be tested, and I am having trouble getting the billing agreement ID's for my test accounts. I assume that typically that part is handled through a web page that the customer has signed in to with PayPal, so the API knows what purchaser account is being linked. How do I do this programmatically? Or manually? I don't care, because we will never be making this call, I just need the ID's for the test accounts.
Any help is appreciated.
You can do this with Express Checkout. When you call SetExpressCheckout just make sure to include the billing agreement parameters.
We are using PayPal subscriptions to automatically make ongoing monthly donations. The user initially creates a subscription with some pre-determined monthly donation amount (e.g., say $50/month). This creates a recurring subscription which we process by way of IPN. All good there. But, our interface allows the user to come in and change their monthly donation amount, say from $50/month to $100/month. I am wondering how I can change the PayPal subscription to reflect this new amount?
There is a method in PayPal's NVP API called "UpdateRecurringPaymentsProfile" which says I can update the subscription amount, but unfortunately it says:
For recurring payments with Express Checkout, the payment amount can be increased by no more than 20% every 180 days (starting when the profile is created).
(reference: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_UpdateRecurringPaymentsProfile)
To be honest, PayPal's API's are quite confusing so I'm not sure if I am using the Express Checkout or not. (We are creating Subscription buttons using the simple Website Payment Standard API).
Will this work? If not, is there an alternative to achieve what we need?
Thanks!
I'm not sure if I am using the Express Checkout or not. (We are creating Subscription buttons using the simple Website Payment Standard API).
I hope rereading the above, you will realize that you answered your own question: You are using Website Payments Standard (WPS) not Express Checkout (EC).
With WPS, you can create a subscription modify button but this is super inflexible and I would not recommend it.
With EC, you can modify subscriptions as well (page 99):
Use the UpdateRecurringPaymentsProfile API to modify a recurring payments profile.
NOTE: You can also modify recurring payments profiles from the PayPal website.
You can only modify the following specific information about an active or suspended profile:
Subscriber name or address
Past due or outstanding amount
Whether to bill the outstanding amount with the next billing cycle
Maximum number of failed payments allowed
Profile description and reference
Number of additional billing cycles
Billing amount, tax amount, or shipping amount
NOTE: You cannot modify the billing frequency or billing period of a profile. You can
modify the number of billing cycles in the profile.
NOTE: For recurring payments with Express Checkout, certain updates, such as billing
amount, are not allowed within 3 days of the scheduled billing date, and an error is
returned.
You can modify the following profile information during the trial period or regular payment
period:
Billing amount (excluding tax and shipping)
Number of billing cycles
With that information out of the way... For the most flexibility:
Look at creating Billing Agreement IDs through Express Checkout. You will need to get Reference Transactions enabled on your PayPal account (talk to merchant support to get this done).
With a BAID, you control when your customers are charged, how much they are charged, and pretty much anything else having to do with the transaction. The drawback is the same as the benefit.. you (see 'have to') control it all.
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.