Skip to main content

Cofidis

Cofidis is an alternative payment method that allows financing in installments through its two products: 4xcard and Cofidis Pay. 4xcard offers to finance purchases of between 75 and 1,000 euros in 4 installments through the card, while Cofidis Pay allows financing of between 75 and 3,000 euros in up to 50 installments through direct debit.

Through this payment method, the user will be redirected to the Cofidis payment letter, where the required information must be provided, being necessary, in the case of 4xcard, the cardholder's identity document and card, while in the case of of the Cofidis Pay product, the identity document and a bank receipt of ownership will be required.

The integration process is similar to the payment letter for redirection.

/payment/process/{token}

Cofidis expects to receive an email in the extra_data field when creating the order:

```json
"extra_data": {
"profile": {
"first_name": "",
"last_name": "",
"email": "johndoe@paynopain.com"
}
}
```

Integración

To make a payment in Cofidis we must follow the following steps:

1. Generate the payment order on your server

Create the order just as you would for a simple integration.

The order will be set to secure=false.

As a service identifier, provide the service_uuid of the COFIDIS service configured for one of the two Cofidis products you want, which you will find at your Paylands Backend → Manage → Payment Services → Listing.

If you do not yet have the Cofidis service activated, you will need to request its activation from us at soporte@paylands.com.

Once here, we generate the order with the following request:

curl --request POST 'https://api.paylands.com/v1/sandbox/payment' \
--header 'Authorization: Bearer [API_KEY]' \
--header 'Content-Type: application/json' \
--data-raw '{
"signature": "[SIGNATURE]",
"amount": 10000,
"operative": "AUTHORIZATION",
"secure": false,
"customer_ext_id": "test",
"service": "[SERVICE_UUID]",
"description": "Payment #1",
"additional": null,
"url_post": "https://my.website.com/process",
"url_ok": "https://my.website.com/ok",
"url_ko": "https://my.website.com/ko",
"source_uuid": null
}'

Getting as response:

{
"message": "OK",
"code": 200,
"current_time": "2022-07-19T13:36:32+0200",
"order": {
"uuid": "997BFC59-2407-4CFD-A518-0FCE478AB7D5",
"created": "2022-07-19T13:36:32+0200",
"created_from_client_timezone": "2022-07-19T14:36:32+0300",
"amount": 50000,
"currency": "978",
"paid": false,
"status": "CREATED",
"safe": false,
"refunded": 0,
"additional": "Paylands test",
"service": "COFIDIS",
"service_uuid": "AB567191-DCCC-4143-81DA-5F1ED5F68B47",
"customer": "test",
"cof_txnid": null,
"transactions": [],
"token": "69694f7765bba3d5d7da3f401d304bef151c8eded8ceac43c48e3b852368502d815c86d0a6e901f031ae13fea256f0ac8d99d7cea7c369b4683b8f7c4db52b95",
"ip": null,
"reference": null,
"dynamic_descriptor": null,
"threeds_data": null
},
"client": {
"uuid": "42B8CF56-A7D7-4D4A-8349-4E27263CB2D5"}
}

2. Redirect the customer to the payment form

We construct the redirection URL to the Cofidis gateway by providing the token of the order returned from the previous call.

https://api.paylands.com/v1/sandbox/payment/process/{token}

We can present the user with a payment button with cofidis like the following:

<a href="https://api.paylands.com/v1/sandbox/payment/process/{token}">
<img src="cofidis-logo.png" alt="Cofidis Logo" style="width:200px; height:auto;"/>
</a>

Cofidis button

By pressing the button, the user will be redirected to the Cofidis gateway.

Cofidis Form

3. Introduce data

Once the user has been redirected to the Cofidis page, it will be necessary to enter their personal information and, in the case of Cofidis Pay, select the desired number of installments.

Once the form is completed, cofidis will determine whether to approve or reject the financing, and the user will be redirected to the URL OK/KO back, depending on the result.

4. The server is notified

Una vez completado el proceso de pago, se recibirá la notificación POST, que será similar a un pago por webservice,except for the following details: Once the payment process is completed, the POST notification will be received, which will be similar to a webservice payment, except for the following details:

  • The source key containing the details of the used card that appears under order.transactions.[n].source will contain the value null.

  • COFIDIS payments only support AUTHORIZATION authorizations as operative.

Testing

To carry out tests in the sandbox environment and force the operation to be OK/KO, we must take into account which COFIDIS product we are using.

For the Cofidis Pay product, you will be asked to complete a form, filling it in with the information of the user requesting the financing. To successfully complete the tests in the sandbox environment, it is recommended to use specific amounts, such as 50000 (€500.00), as well as entering "IP+Surname" (IPExample) in the field of the first surname, in order to avoid the request for documentation real in this test environment.

For 4xcard it will be required to provide the information of a Cofidis user and a card. We can use the following cards:

OK MC: 5132830960047108 03/24 462
OK VISA: 4977830259527191 03/24 153
KO: 5132830960047199 03/24 813

The sandbox URL for cofidis payments is as follows:

https://api.paylands.com/v1/sandbox/payment/process/{token}