PayPal
Learn how to accept PayPal payments.
PayPal is an online payment service that lets customers use their PayPal account to make online purchases. Customers store their credit or debit cards in their PayPal account and use that account to pay.
Payment type | Direct |
Markets | Global |
Customer currencies | Multiple |
Processing currencies | Multiple |
Settlement currencies | AUD, CAD, CZK, DKK, HKD, HUF, ILS, JPY, MXN, NOK, NZD, PHP, PLN, EUR, USD, RUB, CHF, SCD, SEK, TWD, THB |
Refund | Yes |
Chargeback | Yes |
Fraud | Yes |
Recurring payments | Yes |
Step 1. Make a transaction request
From your server, make a POST /payment_preauthorize request.
POST https://sandbox.payabl.com/pay/backoffice/payment_preauthorize
Include in request:
merchantid
: The merchant identification number.orderid
: The field orderid is optional and exclusively for the merchant's convenience.amount
: The amount field contains the transaction’s total amount. This is the amount that will be transmitted to the authorizing system.currency
: The currency field contains the alphanumeric currency code for the transaction, according to ISO 4217.payment_method
: The payment method id - 117.signature
: The signature field contains a 40-figure hexadecimal value. This signature value is a checksum designed to protect the merchant account from unauthorized access.country
: Customer country in ISO Alpha-3 format. Supported countries: AUT, DEU, etc.email
: The customer's email address.accountname
: Accountname: 3 to 100 Characters
You can see a full list of parameters in Pre-Authorization.
Request example
/powercash21-3-2/backoffice/payment_preauthorize&merchantid=andrei&amount=1.22¤cy=USD&
orderid=Powercash21-Test&language=en&gender=M&lastname=Mann&street=An+der+Welle+4&zip=60322&
city=Frankfurt&country=DEU&customerid=&salutation=Herr&title=&firstname=Muster&company=Powercash21&
birthday=07071971&house=19&postbox=&state=HE&email=test%40inatec.com&phone=XXXXXXXXXX8501&
fax=&mobile=&customerip=127.0.0.1&custom1=123456&custom2=&custom3=Inatec+Test+Transaction&
url_return=http%3A%2F%2Fdev-sim-ng.inatec.local%2F%7Esimdad%2FInatecResponse%2Fredirect_response.php&
url_success=http%3A%2F%2Fdev-sim-ng.inatec.local%2F%7Esimdad%2FInatecResponse%2Fsuccess.php&
url_failed=http%3A%2F%2Fdev-sim-ng.inatec.local%2F%7Esimdad%2FInatecResponse%2Ffailed.php&
notification_url=http%3A%2F%2F83.169.19.140%2Fsimulation%2Fbilling_response.php&payment_method=117&
signature=6c63bf91b0a44085e24f3e52fba86d7f7052710d
Step 2. Handle the redirect
To complete the payment, you need to redirect the customer to the correct URL in the response.
Response
transactionid=213592364&transid=213592364&status=2000&errormessage=pending&errmsg=pending&
amount=1.22&price=1.22¤cy=USD&orderid=Powercash21-Test&payment_method=117&
redirect_url=https%3A%2F%2Fwww.sandbox.paypal.com%2Fcheckoutnow%3Ftoken%3D8HB89670NU291814W&user_id=46930
When the customer finished or canceled the payment, he will be redirected back to url_return
, provided by you in the initial request to payment_preauthorize. After that, you will receive a notification, posted to notification_url
, with the final transaction status, which you suppose to use to update your system.
Notification URL can be configured by our tech support team in your account on our side,
or you can send it as a parameter notification_url
in the initial request to payment_preauthorize
.
notification_url
should be provided by you to payabl. technical team.
Notification example
transactionid=213592364&payeeId=LB9QXKG2YMA32&payerId=Z49VA2FXC8B8U&
security=2e1bb923e8eb579ebae3e0b6d5c9f80e8da942ac35ba08673e5a07453fb685c9&
orderid=Powercash21-Test&errormessage=&type=capture&[email protected]&
[email protected]&errorcode=0×tamp=1634205467"
Recurring payments (Billing agreement)
PayPal integration support billing agreements for recurring payments. To use recurring payments with PayPal the customer first needs to confirm the billing agreement with you and after you can start to utilize recurring payments.
Initial transaction
The first step is to initiate the first transaction so that the customer could approve the billing agreement.
From your server, make a POST /payment_preauthorize request.
https://sandbox.powercash21.com/pay/backoffice/payment_preauthorize
Include in request:
merchantid
: The merchant identification number.orderid
: The field orderid is optional and exclusively for the merchant's convenience.currency
: The currency field contains the alphanumeric currency code for the transaction, according to ISO 4217.payment_method
: The payment method id - 117.signature
: The signature field contains a 40-figure hexadecimal value. This signature value is a checksum designed to protect the merchant account from unauthorized access.country
: Customer country in ISO Alpha-3 format. Supported countries: AUT, DEU, etc.email
: The customer's email address.accountname
: Accountname: 3 to 100 Charactersrecurring_id
: Classify the first recurring transactions with INIT.
Request example
merchantid=gateway_test&amount=5¤cy=EUR&orderid=Payabl-Test&language=en&gender=M&
lastname=Mann&street=An+der+Welle+4&zip=60322&city=Frankfurt&country=DEU&customerid=&
salutation=Herr&title=&firstname=Muster&company=Payabl&birthday=07071971&house=19&postbox=&state=HE
&email=test%40inatec.com&phone=XXXXXXXXXX8501&fax=&mobile=&customerip=127.0.0.1&custom1=&
custom2=&custom3=&url_return=http%3A%2F%2Fdev-sim-ng.inatec.local%2F%7Esimdad%2FInatecResponse%2Fredirect_response.php&
url_success=http%3A%2F%2Fdev-sim-ng.inatec.local%2F%7Esimdad%2FInatecResponse%2Fsuccess.php&
url_failed=http%3A%2F%2Fdev-sim-ng.inatec.local%2F%7Esimdad%2FInatecResponse%2Ffailed.php&
notification_url=https%3A%2F%2Fapi.powercash.de%2Fsimulation%2Fbilling_response.php&payment_method=117&
recurring_id=INIT&signature=78cd33ca4eff230ea2b22e32f68a61ee16dfd22a
Response example
transactionid=104636043&transid=104636043&status=2000&errormessage=pending&errmsg=pending&
amount=0&price=0¤cy=EUR&orderid=Payabl-Test&payment_method=117&
redirect_url=https%3A%2F%2Fwww.sandbox.paypal.com%2Fagreements%2Fapprove%3Fba_token%3DBA-9J9846392W805441S&user_id=264604
After the customer redirects to the PayPal payment page, they need to login into their account and confirm the billing agreement. The customer confirms the billing agreement and the initial transaction will have the status ACTIVE.
Response example
"orderid=Payabl-Test&type=order&transactionid=215436808&
security=5b02cb606c679cb2fa93c72f852d692676c0bf031f712404bd50691cebe42c94&
errormessage=Billing+Agreement+has+been+activated&errorcode=145006×tamp=1662542399"
Second recurring request
To initiate the following transactions, you need to send POST /payment_authorize request.
https://sandbox.powercash21.com/pay/backoffice/payment_authorize
Include in request:
merchantid
: The merchant identification number.orderid
: The field orderid is optional and exclusively for the merchant's convenience.currency
: The currency field contains the alphanumeric currency code for the transaction, according to ISO 4217.payment_method
: The payment method id - 117.signature
: The signature field contains a 40-figure hexadecimal value. This signature value is a checksum designed to protect the merchant account from unauthorized access.country
: Customer country in ISO Alpha-3 format. Supported countries: AUT, DEU, etc.email
: The customer's email address.accountname
: Accountname: 3 to 100 Charactersrecurring_id
: Following recurring transactions need the transaction ID of the initial transaction.
Request example
BO/pay/backoffice/payment_authorize&merchantid=gateway_test&amount=5¤cy=EUR&
orderid=Payabl-Test&language=en&gender=M&lastname=Mann&street=An+der+Welle+4&zip=60322&
city=Frankfurt&country=DEU&customerid=&salutation=Herr&title=&firstname=Muster&company=Payabl&
birthday=07071971&house=19&postbox=&state=HE&email=test%40inatec.com&phone=XXXXXXXXXX8501&
fax=&mobile=&customerip=127.0.0.1&custom1=&custom2=&custom3=&url_return=http%3A%2F%2Fdev-sim-ng.inatec.local%2F%7Esimdad%2FInatecResponse%2Fredirect_response.php&
url_success=http%3A%2F%2Fdev-sim-ng.inatec.local%2F%7Esimdad%2FInatecResponse%2Fsuccess.php&
url_failed=http%3A%2F%2Fdev-sim-ng.inatec.local%2F%7Esimdad%2FInatecResponse%2Ffailed.php&
notification_url=https%3A%2F%2Fapi.powercash.de%2Fsimulation%2Fbilling_response.php&payment_method=117&
recurring_id=104636043&signature=8abe2089292cd764061674855052ac28ab3f4d73
Response example
transactionid=104636045&transid=104636045&status=0&errormessage=&errmsg=&amount=5&price=5&
currency=EUR&orderid=Payabl-Test&payment_method=117&user_id=264604
Recurring cancellation
The customer is allowed to cancel the billing agreement at any time through PayPal application or web portal. In case the billing agreement was canceled by the customer, you will receive a notification.
Response example
transactionid=10463605
6&errorcode=145005&security=6265c72ed0317bbf105022c60ba1f5d92aa2f808d6eaa5b207148f6c98eb2214&
type=order&orderid=Payabl-Test&errormessage=A+billing+agreement+with+description+"Reference+
Transaction+Sample"+has+been+canceled+by+the+buyer×tamp=1662384778"
If you did request when the billing agreement was canceled, you will receive the following notification:
Response example
transactionid=104636053&transid=104636053&status=145001&errormessage=Billing%20Agreement%20not%20active&errmsg=Billing%20Agreement%20not%20active&amount=332&price=332¤cy=EUR&orderid=Payabl-Test&payment_method=117&user_id=264604&error_codes=145001&error_messages=Billing%20Agreement%20not%20active
Refunds
PayPal supports refunds and can be initiated only on a successful captured transaction.
The request will send a credit note to the authorization system after the customer has already been charged. The refund amount will be credited to the customer, and the merchant’s account will be charged.
The refund can be done in two ways:
- Through API integration
- Through payabl. dashboard
If you have API integration, you can check more in our documentation Refund.
Updated 4 months ago