3DS - MPI

The Intrapay API allows you to get the 3DS authentication details of your customer.


MPI

To implement this method:

  1. The merchant securely obtains all the information needed to start an mpi transaction;
  2. The merchant then initiates a HTTPS POST method to the Intrapay endpoint URL with all the necessary information (sent as url-encoded key-value pairs);
    URL: payment.intrapay.com/transaction/mpi
  3. The Intrapay system will respond back to the Merchant with a form pointing to Issuing bank 3DS page of the customer.
  4. The Merchant uses the form to redirect the customer to the Issuing bank.
  5. The Customer completes the 3DS form (if applicable)
  6. The Intrapay system will redirect the customer back to the merchant along with the details of the 3DS transaction. Please coordinate with Intrapay technical team for your desired Return URL.
  7. The Merchant uses the 3DS details and passes it to one of the authorization APIs ie. STP Direct

MPI Fields

Order (pSign)Field NameDetailsMinMaxTypeRequired
01merchantIDMerchant id supplied by Intrapay18NumberYes
02amountThe purchase amount (ex. 1.99)112DecimalYes
03currencyThe purchase currency (ISO 4217)33StringYes
04orderIDThe unique Merchant Order ID164StringYes
05customerUserAgentCustomer's User Agent1128StringNo
06cardNumberCustomer's card number1226StringYes
07cardExpiryDateCustomer's card expiration date; format [mmyy]44StringYes
08cardHolderNameCustomer's card holder name (Name on Card)364StringYes
09descriptionTransaction or Product short description164StringNo
10pSignThe SHA signature used to secure protocol4040StringYes

Example MPI Request:

[POST URL] https://payment.intrapay.com/transaction/mpi

[POST PARAMS]

<?php
    	
require_once("classes/Api.php");
    	
$endPointUrl = "https://payment.intrapay.com/transaction/mpi";	// api name to be process
$passCode = "PASSCODE_GOES_HERE"; //your pass Code

$postData["merchantID"] = "MERCHANT_ID_GOES_HERE"; //your merchant ID
$postData["amount"] = "2.11";
$postData["currency"] = "CURRENCY_GOES_HERE"; //your assign currency
$postData["orderID"] = rand (100000,999999); //unique order ID
$postData["customerUserAgent"] = "";
$postData["cardNumber"] = "4773654827386427";
$postData["cardExpiryDate"] = "1020";
$postData["cardHolderName"] = "John Doe";
$postData["description"] = "";

try {
	$api = new Api();
   
	$data = $api->generatePsign( $passCode, $postData );
   
	echo $api->apiCurlRequest( $data , $endPointUrl);
   
} catch (Exception $e) {
	echo "Caught exception: ",  $e->getMessage(), "\n";
}
   
?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" %>
<%@ page import="java.net.*, java.util.*, com.intrapay.util.*" %>
<%
	String endPointUrl = "https://payment.intrapay.com/transaction/mpi";
	String passCode = "PASSCODE_GOES_HERE"; //your pass Code
	String merchantID = "MERCHANT_ID_GOES_HERE"; //your merchant ID
	String amount = "2.11";
	String currency = "CURRENCY_GOES_HERE"; //your assign currency
	String orderID = new Random().nextInt(999999) + ""; // unique order ID
	String customerUserAgent = "";
	String cardNumber = "4773654827386427";
	String cardExpiryDate = "1020";
	String cardHolderName = "John Doe";
	String description = "";

	String pSign = PSignUtil.generatePSign(passCode + merchantID + amount + currency + orderID + customerUserAgent + 
		cardNumber + cardExpiryDate + cardHolderName + description);
	String and = "&";
	StringBuffer requestData = new StringBuffer();

	requestData.append("merchantID=" + merchantID);
	requestData.append(and + "amount=" + amount);
	requestData.append(and + "currency=" + currency);
	requestData.append(and + "orderID=" + orderID);
	requestData.append(and + "customerUserAgent=" + customerUserAgent);
	requestData.append(and + "cardNumber=" + cardNumber);
	requestData.append(and + "cardExpiryDate=" + cardExpiryDate);
	requestData.append(and + "cardHolderName=" + cardHolderName);
	requestData.append(and + "description=" + description);
	requestData.append(and + "pSign=" + pSign);

	String result = ServerPost.post(requestData.toString(), endPointUrl);
%>
<%=result%>
var request = require('request');
var querystring = require('querystring');

/*
 * 
 * Merchant's Data Variables.
 * 
 */
var postUrl = 'https://payment.intrapay.com/transaction/mpi'; //api name to be process
var passCode = 'PASSCODE_GOES_HERE'; //your pass Code
var merchantID = 'MERCHANT_ID_GOES_HERE'; //your merchant ID
var amount = '2.11';
var currency = 'CURRENCY_GOES_HERE'; //your assign currency
var orderID = Date.now(); // unique order ID
var customerUserAgent = '';
var cardNumber = '4773654827386427';
var cardExpiryDate = '1020';
var cardHolderName = 'John Doe';
var description = '';

/*
*
* Generate pSign
*
*/
var crypto = require('crypto'), shasum = crypto.createHash('sha1');

shasum.update(passCode + merchantID + amount + currency + orderID + customerUserAgent + 
		cardNumber + cardExpiryDate + cardHolderName + description);
var pSign = shasum.digest('hex');

/*
*
* Ready HTTP Post with url-encoded data
*
*/

var data = {
		'passCode' : passCode,
		'merchantID' : merchantID,
		'amount' : amount,
		'currency' : currency,
		'orderID' : orderID,
		'customerUserAgent' : customerUserAgent,
		'cardNumber' : cardNumber,
		'cardExpiryDate' : cardExpiryDate,
		'cardHolderName' : cardHolderName,
		'description' : description,
};

var formData = querystring.stringify(data);
var contentLength = formData.length;
var headers = {
    "Content-Length" : contentLength,
    "Content-Type" : "application/x-www-form-urlencoded",
}

var options = {
    url : postUrl,
    method : "POST",
    headers : headers,
    body : formData,
}

request(options, function(err, res, body) {
    if (res && (res.statusCode === 200 || res.statusCode === 201)) {
        // return result
        console.log(body);
    }
});
require 'time'
require_relative 'classes/API'

api = API.new

postUrl = 'https://payment.intrapay.com/transaction/mpi' #api name to be process
passCode = 'PASSCODE_GOES_HERE' #your pass Code
merchantID = 'MERCHANT_ID_GOES_HERE' #your merchant ID
amount = '2.11'
currency = 'CURRENCY_GOES_HERE' #your assign currency
orderID = Time.now.to_i #unique order ID
customerUserAgent = ''
cardNumber = '4773654827386427'
cardExpiryDate = '1020'
cardHolderName = 'John Doe'
description = ''

postData = Hash[
	'merchantID' => merchantID,
	'amount' => amount,
	'currency' => currency,
	'orderID' => orderID,
	'customerUserAgent' => customerUserAgent,
	'cardNumber' => cardNumber,
	'cardExpiryDate' => cardExpiryDate,
	'cardHolderName' => cardHolderName,
	'description' => description
]

postData['pSign'] = api.generatePsign(passCode, postData)

puts api.apiPostRequest(postData, postUrl)
<%@ Page Language="C#" %>
<%@ Import Namespace="Intrapay.Api.Util" %> 
<%
	String endPointUrl = "https://payment.intrapay.com/transaction/mpi";
	String passCode = "PASSCODE_GOES_HERE"; //your pass Code
	String merchantID = "MERCHANT_ID_GOES_HERE"; //your merchant ID
	String amount = "2.11";
	String currency = "CURRENCY_GOES_HERE"; //your assign currency
	String orderID = new Random().Next(1, 999999).ToString(); //unique order ID
	String customerUserAgent = "";
	String cardNumber = "4773654827386427";
	String cardExpiryDate = "1020";
	String cardHolderName = "John Doe";
	String description = "";

	String pSign = PSignUtil.GeneratePSign(passCode + merchantID + amount + currency + orderID + customerUserAgent + 
		cardNumber + cardExpiryDate + cardHolderName + description);
	String and = "&";
	StringBuilder requestData = new StringBuilder();

	requestData.Append("merchantID=" + merchantID);
	requestData.Append(and + "amount=" + amount);
	requestData.Append(and + "currency=" + currency);
	requestData.Append(and + "orderID=" + orderID);
	requestData.Append(and + "customerUserAgent=" + customerUserAgent);
	requestData.Append(and + "cardNumber=" + cardNumber);
	requestData.Append(and + "cardExpiryDate=" + cardExpiryDate);
	requestData.Append(and + "cardHolderName=" + cardHolderName);
	requestData.Append(and + "description=" + description);
	requestData.Append(and + "pSign=" + pSign);

	String result = ServerPost.Post(requestData.ToString(), endPointUrl);
	Response.Write(result);
%>
from classes.API import API

import time

postUrl = 'https://payment.intrapay.com/transaction/mpi' #api name to be process
passCode = 'PASSCODE_GOES_HERE' //your pass Code
merchantID = 'MERCHANT_ID_GOES_HERE' //your merchant ID
amount = '2.11'
currency = 'CURRENCY_GOES_HERE' //your assign currency
orderID = time.time() #unique order ID
customerUserAgent = ''
cardNumber = '4773654827386427'
cardExpiryDate = '1020'
cardHolderName = 'John Doe'
description = ''

postData = {
	'passCode' => passCode,
	'merchantID' => merchantID,
	'amount' => amount,
	'currency' => currency,
	'orderID' => orderID,
	'customerUserAgent' => customerUserAgent,
	'cardNumber' => cardNumber,
	'cardExpiryDate' => cardExpiryDate,
	'cardHolderName' => cardHolderName,
	'description' => description
}

postData['pSign'] = API.generatePsign(passCode, postData)
print(API.apiPostRequest(postData, postUrl))

You will see the response here...

Response (After Customer 3DS)

Field NameDetailsMinMaxTypeRequired
responseCodeIndicates if api operation status13NumberYes
reasonCodeApi operation sub status13NumberYes
orderIDThe unique Merchant Order ID164StringYes
transactionIDThe unique mpi transaction ID on Intrapay155StringYes
status3DS status. Possible values are Y,A,N,U or blank11StringNo
eciEcommerce Indicator. Possible values are 00,01,02 for MC and 05,06,07 for VISA. Can be blank incase of api failure22StringNo
xidXID of the MPI transaction132StringNo
cavvCAVV of the MPI transaction132StringNo
cavv_algorithmalgorithm used to generate the CAVV11NumberNo
executedDate executed in UTC1919DatetimeYes
pSignThe SHA signature used to secure protocol4040StringYes

Example MPI Success Response (After Customer 3DS):

responseCode=1 
&reasonCode=306
&orderID=198273645001
&transactionID=20171109-2F4DB85D004F726850B5-EA4EA65AD0B8091BAC7D
&status=Y
&eci=05
&xid=ZGRmNzAyZGNkZmQ4NDFmOTgwYWY=
&cavv=AAACAFZJEBcJESIASEkQAAAAAAA=
&cavv_algorithm=1
&executed=2017-11-09 22:11:56
&pSign=d8d07d7582e2dcd479269ea785e1466b728b2ded
    

Example MPI Declined Response (After Customer 3DS):

responseCode=2
&reasonCode=304
&orderID=198273645001
&transactionID=20171109-2F4DB85D004F726850B5-EA4EA65AD0B8091BAC7D
&status=N
&eci=07
&xid=YjI1NTM0NzBlYjVhNDU5Yzk0OWQ=
&cavv=
&cavv_algorithm=
&executed=2017-11-09 22:32:56
&pSign=0a9b6f6920cc8c24d9a9fe09962acb8142ae785b