Finalize Card Payment Indirect

This function is used to credit a wallet using a card when the Money-In has been previously initialized with Initiate a Web Payment function of the DirectKit webservice. 3D-Secure is used if the bank of the user enables 3D Secure.

Please refer to Annex Payment Page Customization to customize the payment web page.

How it works

💡 Prerequisite

You have initialized money-in using the Initiate a Web Payment method of DirectKit. Your server owns a Money-In token now.

  1. Your server redirects the user to Lemonway WebKit with the Money-In token using a GET
  2. The WebKit does some checking and redirects the user to the card payment page.
  3. On this payment webpage, the user can enter the card data.
  4. Then a 3D Secure verification is processed if the bank owning the card has a 3D Secure payment for this card.
  5. The Money-In transaction is saved and the user is redirected to your website.

Request

Requests are sent to Lemonway WebKit using the following parameters in the query string.

VariableDescriptionMandatoryFormatExample
moneyInTokenMoney-In token received in the output of moneyInWebInit of DirectKitYes[1:256] char62612109COhhmoY3kOBhf9O7op8g1m8NE
pURL of the CSS to customize the payment pageNohttps%3A%2F%2Fwww.lemonway.fr%2Fmercanet_lw.css
langISO2 language code for the payment page. Non-exhaustive lists of accepted codes:No[2] char
en, no, sp, fr, xz, ge, it, br, da, fi, sw, po, fl, ci, pl, ne
tplThe name of the template to use on the payment pageNo[1:256] charCustom template
Example
<?php
/*
$wkURL : URL of WEBKIT
$moneyInToken : Token retrieved from DIRECTKIT
$p : URL of customization CSS, encoded URL 
$lang : Language to use for the page
*/
header('Location: '.$wkURL.'?moneyInToken='.$moneyInToken.'&p='.$p.'&lang='.$lang);
?>

Response

Your system returns the URL (success, error, or cancel depending on the response) and receives 2 different responses:

When the client terminates its payment or when the payment is cancelled by the user, a notification (callback) is sent from Lemonway's server to your URL. Data are transmitted in POST.
When the client terminates its operation, he is redirected to your URL with data in a GET.

🚧

Important

For security reasons, in any case of return by the POST, your server has to double-check the payment using the GetMoneyInTransDetails method of DirectKit to make sure the payment was done.

POST Response:
ItemDescriptionExample
response_codeAnswer code:0
0000: success
3000: error
response_wkTokenwkToken sent by you when initializing the Money-inrhjzekdzejkd
response_msgComment on the answer code
response_transactionIdLemonway transaction ID755
response_transactionAmountAmount of the payment transaction34
response_transactionMessageCommentpizza
response_codeDescription
2001Command not recognised
2002Operation cancelled by the user
2003Authentication failed on Webkit
2004Bad format Request
3000Server Error
4000Unknown Error
ItemDescriptionExample
response_wkTokenwkToken went to you in the entry of Money-in initialization.rhjzekdzejkd