Klarna Pay later integration
- Introduction
- Compatible operations and options
- Direct-submit integration
- Server to server integration
- Notification specific details
Introduction
Klarna Invoice is an european online payment solution that offers payment after delivery to its users.
It’s available in these countries :
- Germany (DE) Euro (EUR)
- Austria (AT) Euro (EUR)
- Denmark (DK) Danish krone (DKK)
- Finland (FI) Euro (EUR)
- Netherlands (NL) Euro (EUR)
- Norvège (NO) Norwegian krone (NOK)
- Sweden (SE) Swedish krona (SEK)
Compatible operations and options
- Compatible operations:
Authorization specifics
On a Klarna account, the validity period of an authorization to be captured is 3 days.
warning
In some cases, some additional parameters must be sent to proceed an authorization. Please see the specific section at the bottom of this page.
Direct-submit integration
In this mode, you have to redirect the user to the Payplug platform while sending a POST request containing your order’s parameters.
Information entered by the cardholder is necessary to send the POST parameters of the payment request.
Request must be sent to a specific “direct-submit” dedicated URL.
Example
Here is a direct-submit request form example. Submitting this form will send a request to the Payplug platform.
<form method="post" action="https://secure-test.dalenys.com/front/direct-submit/process">
<input type="hidden" name="AMOUNT" value="" />
<input type="hidden" name="BILLINGADDRESS" value="" />
<input type="hidden" name="BILLINGCITY" value="" />
<input type="hidden" name="BILLINGCOUNTRY" value="" />
<input type="hidden" name="BILLINGFIRSTNAME" value="" />
<input type="hidden" name="BILLINGLASTNAME" value="" />
<input type="hidden" name="BILLINGMOBILEPHONE" value="" />
<input type="hidden" name="BILLINGPHONE" value="" />
<input type="hidden" name="BILLINGPOSTALCODE" value="" />
<input type="hidden" name="BILLINGTITLE" value="" />
<input type="hidden" name="CARDFULLNAME" value="" />
<input type="hidden" name="CART[0][DISCOUNT]" value="" />
<input type="hidden" name="CART[0][MERCHANTITEMID]" value="" />
<input type="hidden" name="CART[0][NAME]" value="" />
<input type="hidden" name="CART[0][PRICE]" value="" />
<input type="hidden" name="CART[0][QUANTITY]" value="" />
<input type="hidden" name="CART[0][TAX]" value="" />
<input type="hidden" name="CLIENTDOB" value="" />
<input type="hidden" name="CLIENTGENDER" value="" />
<input type="hidden" name="CLIENTEMAIL" value="" />
<input type="hidden" name="CLIENTIDENT" value="" />
<input type="hidden" name="DESCRIPTION" value="" />
<input type="hidden" name="IBAN" value="" />
<input type="hidden" name="IDENTIFICATIONDOCTYPE" value="" />
<input type="hidden" name="IDENTIFIER" value="" />
<input type="hidden" name="OPERATIONTYPE" value="authorization" />
<input type="hidden" name="ORDERID" value="" />
<input type="hidden" name="VERSION" value="" />
<input type="submit" value="Pay" />
</form>
Parameters
-
AMOUNT integer
The transaction amount in the smallest money decimal (e.g. cents for euro).
Example: 1000
-
BILLINGADDRESS string(1-50)
The billing address. Be careful not to integrate any line breaks.
Example: 285 Fulton Street
-
BILLINGCITY string(1-255)
The billing city.
Example: New York
-
BILLINGCOUNTRY string(2)
The country code (ISO_3166-1_alpha-2).
Example: US
-
BILLINGFIRSTNAME string(1-15)
The first name part of the billing address.
Example: John
-
BILLINGLASTNAME string(1-15)
The last name part of the billing address.
Example: Doe
-
BILLINGMOBILEPHONE string(1-32)
Billing mobile phone number in international (E.164) format.
Example: +33666666666
-
BILLINGPHONE string(1-32)
Billing phone number in international (E.164) format.
Example: +33111111111
-
BILLINGPOSTALCODE string(1-9)
The billing postal code.
Example: 10007
-
BILLINGTITLE
mr,miss,mrsThe title used for the billing address name.
Example: mr
-
CARDFULLNAME string(1-255)
The holder’s full name (as described on the payment method). For 3-D Secure operations, the field CARDFULLNAME can only contain the following characters : [a-zA-Z1-9 -]
Example: JOHN SNOW
-
CART[X][DISCOUNT] float
Applied discount in percentage. The decimal separator is the dot symbol.
Example: 10.5
-
CART[X][MERCHANTITEMID] string
Item ID in the merchant system.
Example: REF-123456
-
CART[X][NAME] string
Item name.
Example: Laser printer
-
CART[X][PRICE] int
Unit price in cents, including potential taxes and discounts.
Example: 20000
-
CART[X][QUANTITY] integer
Quantity of this item.
Example: 3
-
CART[X][TAX] float
Applied taxes in percentage. The decimal separator is the dot symbol.
Example: 19.5
-
CLIENTADDRESS string(1-510)
The user’s address.
Example: 285 Fulton Street.
-
CLIENTDOB date(YYYY-MM-DD)
The user’s date of birth.
Example: 1982-06-20
-
CLIENTEMAIL email(5-255)
The user’s email.
Example: [email protected]
-
CLIENTGENDER
m,fThe cardholder gender.
Example: f
-
CLIENTIDENT string(1-255)
Unique identifier of the user in your application (e.g. a login or a primary key).
Example: john.snow
-
DESCRIPTION string(1-510)
A short description of the operation, can be used to trigger fraud actions. Don’t hesitate to ask your Payment Manager for some advice on this topic.
Example: Knows nothing
-
EXTRADATA string(1-255)
Free field (Payplug will send you back the content of the EXTRADATA you specified ahead).
Example: referrer=myshop.com;order=premium
-
IBAN string(1-34)
IBAN
Example: DE11888888889999999999
-
IDENTIFICATIONDOCTYPE
taxstatementHolder’s ID document type.
Example: taxstatement
-
IDENTIFIER string(1-32)
Your processing account technical identifier.
Example: Demo Shop
-
METADATA string(1-255)
Additional transactional data. Contact your account manager for more informations.
Example: @METADATA-MYWEBSITE
-
OPERATIONTYPE authorization
The action you want to process.
Example: payment
-
ORDERID string(1-40)
Unique ID associated to an order in the merchant’s database (as specified in your initial POST request)
Example: 1234
-
SHIPTOADDRESS string(1-50)
The shipping address.
Example: 55 rue de la liberté
-
SHIPTOCITY string(1-255)
The shipping city.
Example: New York
-
SHIPTOCOUNTRY string(2)
The country code (ISO_3166-1_alpha-2 format)
Example: US
-
SHIPTOFIRSTNAME string(1-15)
Holder’s first name in the shipping address.
Example: John
-
SHIPTOLASTNAME string(1-30)
Holder’s last name in the shipping address.
Example: Doe
-
SHIPTOPHONE string(1-32)
Shipping phone number in international (E.164) format.
Example: +33111111111
-
SHIPTOPOSTALCODE string(1-9)
The shipping postal code.
Example: 10007
-
VERSION
3.0The API protocol version.
Example: 3.0
Redirection result parameters
-
AMOUNT integer
The transaction amount in the smallest money decimal (e.g. cents for euro).
Example: 1000
-
CLIENTEMAIL email(5-255)
The user’s email.
Example: [email protected]
-
CLIENTIDENT string(1-255)
Unique identifier of the user in your application (e.g. a login or a primary key).
Example: john.snow
-
CURRENCY string(3)
Currency code (ISO 4217 format).
Example: EUR
-
DESCRIPTOR string
The transaction label sent to the bank network. The transaction will display with this label on the user’s bank statement.
Example: myshop.com
-
EXECCODE string(4)
The operation result code. (See the complete list of execution code)
Example: 0000
-
EXTRADATA string(1-255)
Free field (Payplug will send you back the content of the EXTRADATA you specified ahead).
Example: referrer=myshop.com;order=premium
-
HASH string(64)
The transaction’s hash as described in the dedicated section.
Example: 15477dcb8687adf90fa51e418f3c1a2d025f40b177a978c2734514734633b3c4
-
IDENTIFIER string(1-32)
Your processing account technical identifier.
Example: YOUR_IDENTIFIER
-
LANGUAGE
fr,en,de,es,it,nl,zh,ru,pt,skConfigure the hosted form display language.
Example: en
-
MESSAGE string(no length limit)
The operation result description linked to
EXECCODE.Example: The transaction has been accepted
-
OPERATIONTYPE
authorization,payment,capture,refund,credit,voidThe action you want to process.
Example: payment
-
ORDERID string(1-40)
Unique ID associated to an order in the merchant’s database (as specified in your initial POST request)
Example: 1234
-
TRANSACTIONID string(1-32)
Unique Payplug transaction ID. Make sure to store this ID in your database.
Example: A1123456
-
VERSION
3.0The API protocol version.
Example: 3.0
security
‘You have to check the received
HASHagainst the one you generate, to confirm the request’s origin and integrity before redirecting the user. See this section for more information. Other parameters relating to the original request asAMOUNTandORDERIDmust be verified.’
Notification result parameters
Please see the dedicated section about notification and redirection
You will retrieve the following `POST` parameters on your `NOTIFICATION_URL`:
-
AMOUNT integer
The transaction amount in the smallest money decimal (e.g. cents for euro).
Example: 1000
-
CLIENTEMAIL email(5-255)
The user’s email.
Example: [email protected]
-
CLIENTIDENT string(1-255)
Unique identifier of the user in your application (e.g. a login or a primary key).
Example: john.snow
-
CURRENCY string(3)
Currency code (ISO 4217 format).
Example: EUR
-
DESCRIPTOR string
The transaction label sent to the bank network. The transaction will display with this label on the user’s bank statement.
Example: myshop.com
-
EXECCODE string(4)
The operation result code. (See the complete list of execution code)
Example: 0000
-
EXTRADATA string(1-255)
Free field (Payplug will send you back the content of the EXTRADATA you specified ahead).
Example: referrer=myshop.com;order=premium
-
HASH string(64)
The transaction’s hash as described in the dedicated section.
Example: 15477dcb8687adf90fa51e418f3c1a2d025f40b177a978c2734514734633b3c4
-
IDENTIFIER string(1-32)
Your processing account technical identifier.
Example: YOUR_IDENTIFIER
-
LANGUAGE
fr,en,de,es,it,nl,zh,ru,pt,skConfigure the hosted form display language.
Example: en
-
MESSAGE string(no length limit)
The operation result description linked to
EXECCODE.Example: The transaction has been accepted
-
OPERATIONTYPE authorization
The action you want to process.
Example: payment
-
ORDERID string(1-40)
Unique ID associated to an order in the merchant’s database (as specified in your initial POST request)
Example: 1234
-
TRANSACTIONID string(1-32)
Unique Payplug transaction ID. Make sure to store this ID in your database.
Example: A1123456
-
VERSION
3.0The API protocol version.
Example: 3.0
security
‘You have to check the received
HASHagainst the one you generate, to confirm the request’s origin and integrity before redirecting the user. See this section for more information. Other parameters relating to the original request asAMOUNTandORDERIDmust be verified.’
Server to server integration
In this mode, you have to send a POST request containing your order’s parameters over HTTPS to the Payplug platform.
Capture
Authorizations have to be captured by a server to server request.
info
You can only
capturea succeededauthorizationtransaction and anauthorizationcan only be captured once.
warning
A
capturemust be triggered within 7 days of an authorization, otherwise capture success is no longer guaranteed.
tips
The capture
AMOUNTmay be lower but cannot exceed the initial authorization’sAMOUNT.
Example
Here is a server to server request example:
$> curl --request POST --url "https://secure-test.dalenys.com/front/service/rest/process" \
--data "method=capture" \
--data "params[IDENTIFIER]=Demo Shop" \
--data "params[OPERATIONTYPE]=capture" \
--data "params[TRANSACTIONID]=A1123456" \
--data "params[ORDERID]=1234" \
--data "params[DESCRIPTION]=Knows nothing" \
--data "params[VERSION]=3.0" \
--data "params[HASH]=15477dcb8687adf90fa51e418f3c1a2d025f40b177a978c2734514734633b3c4" \
Parameters
-
AMOUNT integer
When not specified, 100% of the
authorizationamount is captured. Could not be higher than theauthorizationamount.Example: 1000
-
DESCRIPTION string(1-510)
A short description of the operation, can be used to trigger fraud actions. Don’t hesitate to ask your Payment Manager for some advice on this topic.
Example: Knows nothing
-
EXTRADATA string(1-255)
Free field (Payplug will send you back the content of the EXTRADATA you specified ahead).
Example: referrer=myshop.com;order=premium
-
HASH string(64)
The transaction’s hash as described in the dedicated section.
Example: 15477dcb8687adf90fa51e418f3c1a2d025f40b177a978c2734514734633b3c4
-
IDENTIFIER string(1-32)
Your processing account technical identifier.
Example: Demo Shop
-
OPERATIONTYPE
captureThe action you want to process.
Example: payment
-
ORDERID string(1-40)
Unique ID associated to an order in the merchant’s database (as specified in your initial POST request)
Example: 1234
-
TRANSACTIONID string(1-32)
The
authorization’sTRANSACTIONIDyou want tocapture.Example: A1123456
-
VERSION
3.0The API protocol version.
Example: 3.0
Request result
Here is the request result from the platform:
-
DESCRIPTOR string
The transaction label sent to the bank network. The transaction will display with this label on the user’s bank statement.
Example: myshop.com
-
EXECCODE string(4)
The operation result code. (See the complete list of execution code)
Example: 0000
-
MESSAGE string(no length limit)
The operation result description linked to
EXECCODE.Example: The transaction has been accepted
-
OPERATIONTYPE
captureThe action you want to process.
Example: payment
-
TRANSACTIONID string(1-32)
Unique Payplug transaction ID. Make sure to store this ID in your database.
Example: A1123456
Notification result parameters
Exactly the same result parameters than with hosted form integration.
Apart from result parameters obtained with hosted form integration, following specific parameters are available:
The IDENTIFICATIONDOCID and IDENTIFICATIONDOCTYPE parameters will be returned when BILLINGCOUNTRY’s value is DK/FI/NO/SE.
Refund
Refunds can either be processed through server-to-server request or Payplug Dashboard.
info
You can only refund a succeeded
paymentorcapturetransaction. A transaction can be refunded several times, up to the original transactionAMOUNT.
Example
Here is a server to server request example:
$> curl --request POST --url "https://secure-test.dalenys.com/front/service/rest/process" \
--data "method=refund" \
--data "params[IDENTIFIER]=Demo Shop" \
--data "params[OPERATIONTYPE]=refund" \
--data "params[TRANSACTIONID]=A1123456" \
--data "params[ORDERID]=1234" \
--data "params[DESCRIPTION]=Knows nothing" \
--data "params[VERSION]=3.0" \
--data "params[HASH]=15477dcb8687adf90fa51e418f3c1a2d025f40b177a978c2734514734633b3c4" \
Parameters
-
AMOUNT integer
The amount to refund. When not specified, refund 100% of the initial transaction resting amount. Could not be higher than the resting amount.
Example: 1000
-
DESCRIPTION string(1-510)
A short description of the operation, can be used to trigger fraud actions. Don’t hesitate to ask your Payment Manager for some advice on this topic.
Example: Knows nothing
-
EXTRADATA string(1-255)
Free field (Payplug will send you back the content of the EXTRADATA you specified ahead).
Example: referrer=myshop.com;order=premium
-
HASH string(64)
The transaction’s hash as described in the dedicated section.
Example: 15477dcb8687adf90fa51e418f3c1a2d025f40b177a978c2734514734633b3c4
-
IDENTIFIER string(1-32)
Your processing account technical identifier.
Example: Demo Shop
-
OPERATIONTYPE
refundThe action you want to process.
Example: payment
-
ORDERID string(1-40)
Unique ID associated to an order in the merchant’s database (as specified in your initial POST request)
Example: 1234
-
TRANSACTIONID string(1-32)
The
paymentorcapture’sTRANSACTIONIDyou want torefund.Example: A1123456
-
VERSION
3.0The API protocol version.
Example: 3.0
Request result
Here is the request result from the platform:
-
DESCRIPTOR string
The transaction label sent to the bank network. The transaction will display with this label on the user’s bank statement.
Example: myshop.com
-
EXECCODE string(4)
The operation result code. (See the complete list of execution code)
Example: 0000
-
MESSAGE string(no length limit)
The operation result description linked to
EXECCODE.Example: The transaction has been accepted
-
OPERATIONTYPE
refundThe action you want to process.
Example: payment
-
TRANSACTIONID string(1-32)
Unique Payplug transaction ID. Make sure to store this ID in your database.
Example: A1123456
Notification result parameters
Exactly the same result parameters than with hosted form integration.
Notification specific details
The IDENTIFICATIONDOCID and IDENTIFICATIONDOCTYPE parameters must be supplied when BILLINGCOUNTRY’s value is:
- DK
- FI
- NO
- SE
Parameters
-
IDENTIFICATIONDOCID string(1-32)
Identification number of the holder’s ID document.
Example: 42798
-
IDENTIFICATIONDOCTYPE
taxstatementHolder’s ID document type.
Example: taxstatement