Links

Card payment, including card redirect

Card payment

Card data input must happen on kevin. side.
Take a note that card payment method is not enabled by default. You can confirm that by looking at your project settings. If you want the access, please contact us at [email protected] for the additional agreement.
  1. 1.
    Initiate payment by calling the /pis/payment endpoint with both bankPaymentMethod and cardPaymentMethod objects, and set paymentMethodPreferred to card (please use your valid IBAN instead of the example LT000000000000000000):
PHP
Node.js
cURL
The example below is written using kevin. PHP library. All other possible attributes and their explanations can be found in the API documentation.
1
use Kevin\Client;
2
3
$clientId = 'my-client-id';
4
$clientSecret = 'my-client-secret';
5
$options = ['error' => 'array', 'version' => '0.3', 'lang' => 'en'];
6
7
$kevinClient = new Client($clientId, $clientSecret, $options);
8
9
$attr = [
10
'Redirect-URL' => 'https://redirect.kevin.eu/payment.html',
11
'description' => 'Test',
12
'currencyCode' => 'EUR',
13
'amount' => '0.01',
14
'bankPaymentMethod' => [
15
'endToEndId' => '1',
16
'creditorName' => 'John Smith',
17
'creditorAccount' => [
18
'iban' => 'LT000000000000000000'
19
],
20
],
21
'cardPaymentMethod' => [],
22
'paymentMethodPreferred' => 'card',
23
];
24
25
$response = $kevinClient->payment()->initPayment($attr);
The example below is written using kevin. Node.js library. All other possible attributes and their explanations can be found in the API documentation.
1
const kevin = require('@kevin.eu/kevin-platform-client');
2
3
const clientId = 'my-client-id';
4
const clientSecret = 'my-client-secret';
5
6
const client = new kevin.Client(clientId, clientSecret);
7
8
const options = {
9
headers: {
10
'Redirect-URL': 'https://redirect.kevin.eu/payment.html',
11
},
12
query: {
13
redirectPreferred: true
14
},
15
body: {
16
amount: '1.23',
17
currencyCode: 'EUR',
18
description: 'Lorem Ipsum',
19
bankPaymentMethod: {
20
creditorName: 'John Doe',
21
endToEndId: '123',
22
creditorAccount: {
23
iban: 'LT000000000000000000',
24
}
25
},
26
cardPaymentMethod: {}
27
},
28
}
29
30
const payment = await client.payment.initiatePayment(options);
curl --request POST \
--url https://api.kevin.eu/platform/v0.3/pis/payment?paymentMethodPreferred=card \
--header 'Client-Id: my-client-id' \
--header 'Client-Secret: my-client-secret' \
--header 'Content-Type: application/json' \
--header 'Redirect-URL: https://redirect.kevin.eu/payment.html' \
--data '{
"amount": "0.01",
"currencyCode": "EUR",
"description": "Test",
"bankPaymentMethod": {
"endToEndId": "1",
"creditorName": "John Smith",
"creditorAccount": {
"iban": "LT000000000000000000"
},
},
"cardPaymentMethod": {}
}'
2. From the payment initiation request you will receive a confirmLink. The payment link can lead the user to kevin. frame page only for card data input. The payment link expires after 7 days and cannot be reused.
{
"id": "e4dd60bb-574f-4a13-910a-57c9795d905f",
"hybridStatus": "created",
"statusGroup": "started",
"confirmLink": "https://psd2.kevin.eu/payment/confirm?paymentId=e4dd60bb-574f-4a13-910a-57c9795d905f"
}
3. If you set the optional Webhook-URL header, as soon as the payment reaches its final status, we will send a request to your provided url. You can read more in the section below:

Choose payment method

Payment can be created without specifying the preferred payment type and be determined by the user. If you ignore the optional paymentMethodPreferred query parameter, preferable payment method will be chosen on kevin. frame page:
kevin. payment method selection page

Card redirect

kevin. allows users to redirect their clients from card payments to bank account payments. In most cases, the system recognises the bank based on the card number and redirects the client to finish the payment via their bank account.