PayPal is one of the largest payment methods in the world. Allowing consumers pay via their PayPal wallet balance, or credit/debit cards or Pay Later products.

­čÜž

Expiration

The payment must be completed in 73 hours.
The validity of the refund is 180 days.

How it works

It works as an async payment method, which means: when you create a payment, we receive a response from PayPal that the payment was created and we should wait for the customer. So, differently from other methods, our transaction stays with a processing status. As soon as the customer do the payment, Paypal system should notify us, and then we update the payment to success or failed. The consumer is redirected to the PayPal-hosted payment page to authenticate and approve the checkout.

Create payment

You can see below the simplest example of how to create a paypal payment and the generated response:

curl --request POST \
  --url https://gateway.paybyrd.com/api/v2/payment \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: 5E37D19C-F99C-445F-8B77-1463EFC66C7B' \
  --data '
{
  "type": "OnlineTransfer",
  "amount": "8.15",
  "currency": "EUR",
  "orderRef": "ABC12345",  
  "brand": "PAYPAL",
  "culture": "pt-PT"
}'
{
    "type": "OnlineTransfer",
    "currency": "EUR",
    "orderRef": "ABC12345",
    "brand": "PAYPAL",
    "redirectUrl": "https://your-shop-url?orderRef=ABC12345",
    "code": "BYRD207",
    "description": "Pending redirect",
    "transactionId": "39824983-4a13-42d4-8e85-e2821e494975",
    "amount": "8.15",
    "action": {
        "type": "redirect",
        "url": "https://gateway.paybyrd.com/api/v1/Redirect/39824983-4a13-42d4-8e85-e2821e494975"
    },
}

See the full API reference here.

In order to know whether the transaction was accepted or not, you must check the code field. For successful scenarios the expected code is BYRD207. You can find here the list of all possible codes