Recurring Transactions

Recurring Transaction

The Recurring transaction offer the possibility to the Merchant to make regular charges from the customer's credit card without saving card details in their system. This method must be supported by the payment gateway. Depending on the gateway / bank API this method returns detailed response with card saving data and has also some limitation rules in place as provided by the processing Bank. For detailed information, please contact your Intrapay representative.

To implement this method:

  1. The merchant securely obtains all the information needed to start a normal 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) in order to make an initial transaction (either STP or Web based) and passes the “saveCard” parameter set to “1” - see corresponding sections above;
    URL: payment.intrapay.com/transaction/execute
  3. The system will respond back to the Merchant with the same type of response as in previous sections (STP or Web based transactions);
  4. The Merchant holds information about this operation and if needed shows/notifies the result to the end user; the “transactionID” field should be kept for future recurring transactions on this customer's card;
  5. If the transaction has been successful then the card details have been saved; therefore the merchant can execute further recurrent transactions – merchant obtains necessary information needed to start a recurrent transaction;

    Only STP transactions with non-3D Secure terminals can be used in order to do further recurrent transactions in the same currency as the initial transaction!

  6. The merchant then initiates a HTTPS POST method to the Intrapay endpoint URL for recurring transactions with all the necessary information (sent as url-encoded key-value pairs);
    URL: payment.intrapay.com/transaction/recurrent
  7. The system will respond back to the Merchant with the same type of response as in previous sections (STP or Web based transactions);
  8. The Merchant holds information about this operation and must notify the result to the customer.

Recurring Transaction Fields

Order (pSign)Field NameDetailsMinMaxTypeRequired
01merchantIDMerchant id supplied by Intrapay18NumberYes
02amountThe purchase amount (ex. 1.99)112DecimalYes
03orderIDThe unique Merchant Order ID164StringYes
04originalTransactionIDIntrapay transactionID used in the initial transaction which saved the card details3850StringYes
05cardCVV2Customer's card security card code36StringNo*
06custom1Additional bank required field164StringNo*
07pSignThe SHA signature used to secure protocol4040StringYes

* Please note that some Gateways / Banks / Payment Methods do not support/use these parameters, or may consider them as mandatory! Our technical team will specify if any of these are required/supported.

Note: custom1 field must be in JSON format.


Example Recurrent Request:

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

[POST PARAMS]

<?php
    	
require_once("classes/Api.php");
    	
$endPointUrl = "https://payment.intrapay.com/transaction/recurrent";	// 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["orderID"] = rand (100000,999999); //unique order ID
$postData["originalTransactionID"] = "TRANSACTION_ID_GOES_HERE"; //your original transaction ID
$postData["cardCVV2"] = "777";

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/recurrent";
	String passCode = "PASSCODE_GOES_HERE"; //your pass Code
	String merchantID = "MERCHANT_ID_GOES_HERE"; //your merchant ID
	String amount = "2.11";
	String orderID = new Random().nextInt(999999) + ""; // unique order ID
	String originalTransactionID = "TRANSACTION_ID_GOES_HERE"; //your original transaction ID
	String cardCVV2 = "777";

	String pSign = PSignUtil.generatePSign(passCode + merchantID + amount + orderID + originalTransactionID + cardCVV2);

	String and = "&";
	StringBuffer requestData = new StringBuffer();

	requestData.append("merchantID=" + merchantID);
	requestData.append(and + "amount=" + amount);
	requestData.append(and + "orderID=" + orderID);
	requestData.append(and + "originalTransactionID=" + originalTransactionID);
	requestData.append(and + "cardCVV2=" + cardCVV2);
	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/recurrent'; //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 orderID = Date.now(); // unique order ID
var originalTransactionID = 'TRANSACTION_ID_GOES_HERE'; //your original transaction ID
var cardCVV2 = '777';

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

shasum.update(passCode + merchantID + amount + orderID + originalTransactionID + cardCVV2);
var pSign = shasum.digest('hex');

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

var data = {
		'passCode' : passCode,
		'merchantID' : merchantID,
		'amount' : amount,
		'orderID' : orderID,
		'originalTransactionID' : originalTransactionID,
		'cardCVV2' : cardCVV2,
};

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/recurrent' #api name to be process
passCode = 'PASSCODE_GOES_HERE' #your pass Code
merchantID = 'MERCHANT_ID_GOES_HERE' #your merchant ID
amount = '2.11'
orderID = Time.now.to_i #unique order ID
originalTransactionID = 'TRANSACTION_ID_GOES_HERE' #your original transaction ID
cardCVV2 = '777'

postData = Hash[
	'merchantID' => merchantID,
	'amount' => amount,
	'orderID' => orderID,
	'originalTransactionID' => originalTransactionID,
	'cardCVV2' => cardCVV2
]

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/recurrent";
	String passCode = "PASSCODE_GOES_HERE"; //your pass Code
	String merchantID = "MERCHANT_ID_GOES_HERE"; //your merchant ID
	String amount = "2.11";
	String orderID = new Random().Next(1, 999999).ToString(); //unique order ID
	String originalTransactionID = "TRANSACTION_ID_GOES_HERE"; //your original transaction ID
	String cardCVV2 = "777";

	String pSign = PSignUtil.GeneratePSign(passCode + merchantID + amount + orderID + originalTransactionID + cardCVV2);
	String and = "&";
	StringBuilder requestData = new StringBuilder();

	requestData.Append("merchantID=" + merchantID);
	requestData.Append(and + "amount=" + amount);
	requestData.Append(and + "orderID=" + orderID);
	requestData.Append(and + "originalTransactionID=" + originalTransactionID);
	requestData.Append(and + "cardCVV2=" + cardCVV2);
	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/recurrent' #api name to be process
passCode = 'PASSCODE_GOES_HERE' //your pass Code
merchantID = 'MERCHANT_ID_GOES_HERE' //your merchant ID
amount = '2.11'
orderID = time.time() #unique order ID
originalTransactionID = 'TRANSACTION_ID_GOES_HERE' //your original transaction ID
cardCVV2 = '777'

postData = {
	'passCode' => passCode,
	'merchantID' => merchantID,
	'amount' => amount,
	'orderID' => orderID,
	'originalTransactionID' => originalTransactionID,
	'cardCVV2' => cardCVV2
}

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

You will see the response here...

Recurring Transaction on Authorized (Pre-Auth) Initial Transactions


The merchant may need to Authorize the initial transaction and then either capture or void it, but to be able to make recurring transactions in the future by using the stored details of the customer credit card. Depending on the Acquirer/Bank this method may be supported or not. For detailed information, please contact your Intrapay representative. Also, please consider the examples from the above regarding the API calls.

Only STP transactions with non-3D Secure terminals can be used in order to do further recurrent transactions in the same currency as the initial transaction!

To implement this method:

  1. The merchant securely obtains all the information needed to start a normal 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) in order to Authorize an initial transaction (either STP or Web based) and passes the “saveCard” parameter set to “1” - see corresponding sections above;
    URL: payment.intrapay.com/transaction/authorize
  3. The system will respond back to the Merchant with the same type of response as in previous sections (STP or Web based transactions);
  4. The Merchant holds information about this operation and if needed shows/notifies the result to the end user; the “transactionID” field should be kept for future recurring transactions on this customer's card;
  5. If the transaction has been successfully Authorized then the card details have been saved; therefore the merchant can execute further recurrent transactions – merchant obtains necessary information needed to start a recurrent transaction;

    OPTIONAL: The merchant may void or capture the initial transaction if needed, but further recurrent transactions will still be possible;

  6. The merchant then initiates a HTTPS POST method to the Intrapay endpoint URL for recurring transactions with all the necessary information (sent as url-encoded key-value pairs);
    URL: payment.intrapay.com/transaction/recurrent
  7. The system will respond back to the Merchant with the same type of response as in previous sections (STP or Web based transactions);
  8. The Merchant holds information about this operation and must notify the result to the customer.