NAV Navbar
Logo

- Quick guide -

Updating for PSD2

What you need to do in order to be ready for PSD2


Which programming language do you prefer?

| PHP | Python |

Use arrow keys or space bar to navigate in the presentation.

Main steps

1# You should update your library:

PayPlug PHP library version 3.0.0 or above

PayPlug Python library version 1.2.2 or above

2# In your “Create a payment” code, please complete these 2 steps:

  • Remove the customer key.
  • Replace it with billing and shipping keys.

Billing information

In billing, the following keys are now mandatory:

first_name Customer first name (maximum length: 100 characters).
last_name Customer last name (maximum length: 100 characters).
email Customer email address (maximum length: 255 characters).
address1 Customer address line 1 (maximum length: 255 characters).
postcode Customer Zip/Postal code (maximum length: 16 characters).
city Customer city (maximum length: 100 characters).
country Customer country two-letter ISO 3166 code.

Shipping information

In shipping key, the following keys are now mandatory:

first_name Recipient first name (maximum length: 100 characters).
last_name Recipient last name (maximum length: 100 characters).
email Recipient email address (maximum length: 255 characters).
address1 Shipping address line 1 (maximum length: 255 characters).
postcode Shipping Zip/Postal code (maximum length: 16 characters).
city Shipping city (maximum length: 100 characters).
country Shipping country two-letter ISO 3166 code.
delivery_type the type of delivery. (More details on next slide).

Delivery type

Please choose one of the following value in delivery_type key:

BILLING Ship to cardholder’s billing address.
VERIFIED Ship to another verified address on file with merchant.
NEW Ship to an address that is different than the cardholder’s billing address.
SHIP_TO_STORE Pick-up at a local store (store address shall be populated in shipping address keys).
DIGITAL_GOODS Online services, electronic gift cards, redemption codes, and other digital goods.
TRAVEL_OR_EVENT Travel and Event tickets, not shipped.
OTHER Other (for example, Gaming, digital services not shipped, e-media subscriptions, etc.).

Optional keys

A main improvement of PSD2 is the ability to collect more data in order to boost frictionless transactions.

Keeping this in mind, you may include some optional keys within your code:

mobile_phone_number Recipient mobile phone number (international format in the E.164 standard). For instance, a mobile French phone number will be formatted as +33611111111.
landline_phone_number Recipient landline phone number (international format in the E.164 standard). For instance, a landline French phone number will be formatted as +33111111111.
language Customer language two-letter ISO 639-1 code. Supported languages: fr, en and it.

Specific process about endpoints

If you wrote your integration starting directly from endpoints (not using a library), you should include the API’s version number in the header.

The version of the PayPlug API compatible with PSD2 begins with 2019-06-14.

You can follow the example below:

$ curl -X GET https://api.payplug.com/v1/payments \
   -H "Authorization: Bearer sk_live_43b7e007298f57f732800a52" \
   -H "PayPlug-Version: 2019-06-14"