How can I use PayPal Billig Agreements with PHP in 2023? A Billing Agreement is different from subscriptions billing as the amount to be charged and time of payment are not fixed.
Currently we still use the PayPal PHP Merchant SDK which still works but is deprecated, 6 years old and does not work with current newer php versions.
The current PayPal REST APIs also has the following deprecation notice:
The /v1/payments/billing-agreements endpoints are deprecated
How it is done in 2023?
Billing agreements is old API terminology. The general terms for this type of non-subscriptions billing are reference transactions, future payments, vault, and payment tokens. All of which mean approximately the same thing.
If the PayPal business account is approved for reference transactions, any of the API solutions will work. v2 and v3 vault are the newest ones, only PayPal can advise you on which one to use. There will be no SDK.
Related
I tried to create Paypal Billing Agreement using API.
Method1:-
I followed below link https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_post
Here, we found response successfully as mentioned in Doc but in customer Sandbox Account, I could not find any new billing agreement created. (https://www.sandbox.paypal.com/)
Method2:-
I followed below link
To fetch agreement token.
https://verifone.cloud/docs/apm/paypal-show-token-details
To creating billing agreement token.
https://verifone.cloud/docs/apm/paypal-initiate-billing-agreement
To creating billing agreement
https://verifone.cloud/docs/apm/paypal-first-billing-agreement-transaction
Here, we are not able to identity “ppcUid” parameter.
I tried to set the value of “ppcUid” by ‘Paypal merchant Id’ and ‘email Id’ but not getting response as mentioned in Doc.
Note:- When I am trying to create Billing Agreement manually in Magento, then it is rendering successfully in Magento and in Paypal Sandbox Account.
The /v1/payments/billing-agreements API is deprecated. Do not use it.
If you are integrating recurring payments on a schedule, use a Subscriptions integration.
If your use case is not on a schedule but rather arbitrary charges for arbitrary amounts at arbitrary times, your account will need a feature called 'Reference Transactions'. This feature is not available in live without approval from PayPal. The PayPal Business account owner should contact PayPal's general business support (not technical support) to explain the business need for reference transaction billing agreements, and inquire about the service. If the service is approved, PayPal can guide you on which API to implement -- for instance the newest "v2 vault" API rather than one of the deprecated APIs. (if using that newer API, vault is for approval/obtaining a token and then the v2/checkout/orders API can be used to create a transaction with the vault payment token. This only works with reference transactions enabled, hence the requirement)
I'm using PayPal-PHP-SDK for billing agreement api. I want to add new new card to existing billing agreement.
https://developer.paypal.com/docs/api/payments.billing-agreements/v1/
I've check docs and SDK there is not any proper way to update the card in billing agreement.
Your suggestion would be greatly appreciated
The PayPal-PHP-SDK is deprecated and not compatible with the current version of PayPal Subscriptions, which do not use a billing agreement for anything. There is no server-side SDK for the current Subscriptions API, so any calls need to be done yourself with HTTPS.
Regardless, payers can update their payment methods and change to a different or new card via login to https://www.paypal.com , Profile, My Money, My Preapproved Payments
I am new to Paypal integration and cannot find how am I supposed to make it. My requisites are the following:
Company registered in Argentina
Users should be able to buy without having to create a Paypal account with a credit card
The integration should not be easily tampered with
With those (I thought) simple requirements I spent many hours and couldn't find a solution that applied.
This is what I found out:
Payments REST API, should not be used for credit card payments
Important: The use of the PayPal REST /payments APIs to accept credit
card payments is restricted. Instead, you can accept credit card
payments with Braintree Direct.
https://developer.paypal.com/docs/api/payments/
Braintree Direct (the method to integrate credit card payments with full customization is not supported in Argentina) https://www.braintreepayments.com/country-selection
NVP and SOAP API Reference (old Paypal API to integrate payments) is no longer supported.
Important: This integration method is Deprecated as of January 1, 2017. For
new integrations, see the PayPal Express Checkout Integration Guide.
https://developer.paypal.com/docs/classic/api/
PayPal Express Checkout Integration is horrible, seems insecure and prone to tampering if used only client side, and though I found a way to make it work more securely with a server-side payment generation I couldn't find a way for it to pay without having a Paypal account.
https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/
and
https://developer.paypal.com/demo/checkout/#/pattern/client
So I am left with no option to integrate credit card processing through Paypal for a business in Argentina. Before giving up I would like to know if somebody knows of a way to make this integration work.
Payoneer is also an option. Paypal isn't the only thing out there.
We have a site where we need to charge the customer an upfront fee, and then when they complete a process at a later date, we will charge them another amount for which we only have an estimate.
What is the best way to do this with PHP SDK?
Do I need to use the Classic API? Is a regular Billing Agreement (subscription) required?
Reference Transactions are not currently available in the Paypal PHP SDK, but they are working on it. You can do it with the Classic API.
Is this possible to bill a customer manually with Paypal pro?
After authorize/verify a card (not saving card number/cvv only saving it's exp. date of the card) is this possible to bill a customer manually (through cron job in PHP) according to it's subscription plan (monthly/yearly) ?
Any help ?
Yes, it's called a reference transaction.
Depending on which version of Payments Pro you have you would either use the PayFlow API or the DoReferenceTransaction API.
This PayPal PHP SDK supports both of those and will make the API calls very simple for you.