Private
MPI
Payer's card verification for participating in 3D-Secure

Scheme of API MPI
Forming a request to API for self-integration:
Example of using SDK:
#!/bin/bash
PUBLIC_KEY='your_public_key'
PRIVATE_KEY='your_private_key'
API_URL='https://www.liqpay.ua/api/request'
JSON="{ 
	\"action\" : \"mpi\",
	\"version\" : 3,
	\"public_key\" : \"${PUBLIC_KEY}\", 
	\"phone\" : \"380950000001\", 
	\"amount\" : \"1\", 
	\"currency\" : \"USD\", 
	\"description\" : \"description text\", 
	\"order_id\" : \"order_id_1\", 
	\"card\" : \"4731195301524634\", 
	\"card_exp_month\" : \"03\", 
	\"card_exp_year\" : \"22\", 
	\"card_cvv\" : \"111\"
}"
# DATA is base64_encode result from JSON string
DATA=$(echo -n ${JSON} | base64)
# SIGNATURE is base64 encode result from sha1 binary hash from concatenate string ${PRIVATE_KEY}${DATA}${PRIVATE_KEY}
SIGNATURE=$(echo -n "${PRIVATE_KEY}${DATA}${PRIVATE_KEY}" | openssl dgst -binary -sha1 | base64)
# REQ is json response from liqpay
REQ=$(curl --silent -XPOST ${API_URL} --data-urlencode data="${DATA}" --data-urlencode signature="${SIGNATURE}")
echo "Result: ${REQ}"
$liqpay = new LiqPay($public_key, $private_key);
$res = $liqpay->api("request", array(
	'action'         => 'mpi',
	'version'        => '3',
	'phone'          => '380950000001',
	'amount'         => '1',
	'currency'       => 'USD',
	'description'    => 'description text',
	'order_id'       => 'order_id_1',
	'card'           => '4731195301524634',
	'card_exp_month' => '03',
	'card_exp_year'  => '22',
	'card_cvv'       => '111'
));
HashMap<String, String> params = new HashMap<String, String>();
params.put("action", "mpi");
params.put("version", "3");
params.put("phone", "380950000001");
params.put("amount", "1");
params.put("currency", "USD");
params.put("description", "description text");
params.put("order_id", "order_id_1"); 
params.put("card", "4731195301524634");
params.put("card_exp_month", "03");
params.put("card_exp_year", "22");
params.put("card_cvv", "111");
LiqPay liqpay = new LiqPay(PUBLIC_KEY, PRIVATE_KEY);
HashMap<String, Object> res = liqpay.api("request", params);    
System.out.println(res.get("status"));
  
liqpay = LiqPay(public_key, private_key)
res = liqpay.api("request", {
	"action"         : "mpi",
	"version"        : "3",
	"phone"          : "380950000001",
	"amount"         : "1",
	"currency"       : "USD",
	"description"    : "description text",
	"order_id"       : "order_id_1",
	"card"           : "4731195301524634",
	"card_exp_month" : "03",
	"card_exp_year"  : "22",
	"card_cvv"       : "111"
})
liqpay = Liqpay::Liqpay.new(
:public_key  => 'public_key',
:private_key => 'private_key'
)
res = liqpay.api("request", {
	:action         => "mpi",
	:version        => "3",
	:phone          => "380950000001",
	:amount         => "1",
	:currency       => "USD",
	:description    => "description text",
	:order_id       => "order_id_1",
	:card           => "4731195301524634",
	:card_exp_month => "03",
	:card_exp_year  => "22",
	:card_cvv       => "111"
})
LiqPay = liqpay:init(PublicKey, PrivateKey),
Res = liqpay:api("request", [
	{<<"action">>,         <<"mpi">>}, 
	{<<"version">>,        <<"3">>}, 
	{<<"phone">>,          <<"380950000001">>}, 
	{<<"amount">>,         <<"1">>}, 
	{<<"currency">>,       <<"USD">>}, 
	{<<"description">>,    <<"description text">>}, 
	{<<"order_id">>,       <<"order_id_1">>}, 
	{<<"card">>,           <<"4731195301524634">>}, 
	{<<"card_exp_month">>, <<"03">>}, 
	{<<"card_exp_year">>,  <<"22">>}, 
	{<<"card_cvv">>,       <<"111">>}
], LiqPay)
var LiqPay = require('liqpay');
var liqpay = new LiqPay(public_key, private_key);
liqpay.api("request", {
	"action"         : "mpi",
	"version"        : "3",
	"phone"          : "380950000001",
	"amount"         : "1",
	"currency"       : "USD",
	"description"    : "description text",
	"order_id"       : "order_id_1",
	"card"           : "4731195301524634",
	"card_exp_month" : "03",
	"card_exp_year"  : "22",
	"card_cvv"       : "111"
}, function( json ){
	console.log( json.status );
});
my $liqpay = Liqpay->new($public_key,$private_key);
my $res = $liqpay->api("request",
	{
	'action'         => 'mpi',
	'version'        => '3',
	'phone'          => '380950000001',
	'amount'         => '1',
	'currency'       => 'USD',
	'description'    => 'description text',
	'order_id'       => 'order_id_1',
	'card'           => '4731195301524634',
	'card_exp_month' => '03',
	'card_exp_year'  => '22',
	'card_cvv'       => '111'
	}
);
Init("my_public_key", "my_private_key")
Api("request", map[string]interface{}{
    "action": "mpi",
    "version": 3,
    "public_key": PublicKey,
    "phone": "380950000001",
    "amount": 1,
    "currency": "UAH",
    "description": "Test payment",
    "order_id": "order_id_1",
    "card": "4731195301524634",
    "card_exp_month": "03", 
    "card_exp_year": "22", 
    "card_cvv": "111",
})
Options for generating data:
Main
Parameter Required Type Description
version Required Number Version API. Current value - 3
public_key Required String Public key - the store identifier. You can get the key in the store settings
action Required String mpi
amount Required Number Payment amount. For example: 5, 7.34
card Required String Card number of the payer
card_cvv Required String CVV/CVV2
card_exp_month Required String Expiry month of the payer's card. For example: 08
card_exp_year Required String Expiry year of the payer's card.For example: 19
currency Required String Payment currency. Possible values: USD, EUR, RUB, UAH
description Required String Payment description.
ip Required String Client IP
order_id Required String Unique purchase ID in your shop. Maximum length is 255 symbols.
language Optional String Customer's language ru, uk, en
Other parameters
mpi_action Optional String Parameters defining payment type. Possible values:
pay - Acquiring
p2p - Money transfer from card to card
Example response:
{
  "status": "success",
  "mpi_req_pareq": "eJxVUe1OwjAUfRWyB1jbMWAjlybIjJI4J1454B/TlKuUsA+6zTCf3lvYRPvrnJN72tNz4XlrEZMn\n1I1FCSlWlfrgdnMvNX8fTyKAx7xwJOwmj/iQcIX2soUuRQ+9wNgPSWj1VV1xKUPlwt10Uowng8\nBNZRyNAuEyl4d2IRjfgI2FmGXGUovQ/jATtB0EWT17aVEQ+B9QQ7ld5fbui6rKWOoi4zcGv29OZSq\n9Rt10VhWGorn5oFdsq0ahyq6/2g2Mr15ad+S9ret0l34/LDhPk2Vw93o9A+YmYKNqlAEXEx4J\nMRBiOpMQ4p90kFlLpjkPhf00T0r0xPxOS/1Kgki3mupVxxOlbPQM8lkWNEGZfzGwS9zFrStW\n19RVvxNX7UlwbkPtiLGL0ETFgzsK6rbFur4T+7fsHPamnMg==",
  "mpi_req_md": "MGUyZDYxMjYDfhKOC00MDI2LWFhMWUOpDFJjNzIyMmDffShZjli",
  "mpi_req_url": "https://acs.bankname.com/mpi",
  "mpi_status": "Y"
}
Response parameters
Parameter Type Description
mpi_req_md String Parameter required for sender authentification on ACS page
mpi_req_pareq String Parameter required for sender authentification on ACS page
mpi_req_url String Issuer bank page url (ACS page) to which customer should be redirected to confirm payment with 3D-Secure
mpi_status String N - card does not participate, client redirection for 3D-Secure is not required,
U - failed to verify the card for participation, client redirection for 3D-Secure is not required,
Y - card supports the 3D-Secure service and there will be page of issuing bank in mpi_req_url parameter where mpi_req_pareq and mpi_req_md parameters should be transferred by POST method int he next form:
<form name="MPIform" action='${mpi_req_url}' method="POST">
   <input type="hidden" name="PaReq" value='${mpi_req_pareq}'>
   <input type="hidden" name="MD" value='${mpi_req_md}'>
   <input type="hidden" name="TermUrl" value='${TermUrl}'>
</form>
  
where TermUrl – page address to which issuer will return the answer with PaRes and MD parameters. To make a payment with already passed 3DS you need to transfer mpi_pares and mpi_md, parameters with PaRes and MD values which were received from issuer bank ACS while payment is created.
status String Payment status.
Available values:
Final payment statuses
failure Failed payment
success Successful payment