Double Message Transactions

Void Transaction

This method is used to undo and finalize a previously authorized transaction. The reserved funds will be unblocked from the customer's credit card account. If the action succeeds then the transaction status will be Void and the transaction can be considered as finalized.

To implement this method:

  1. The merchant securely obtains all the necessary details in order to to start the void procedure from their system;
  2. The merchant initiates a HTTPS POST method to the Intrapay endpoint URL with all the necessary information as url-encoded key-value pairs;
    URL: payment.intrapay.com/transaction/void
  3. The system will respond to the Merchant with the result of the transaction void operation;
  4. The Merchant computes all necessary operations in his system and may notify the customer with the result of this action

Void Transaction fields

Order (pSign)Field NameDetailsMinMaxTypeRequired
01merchantIDMerchant id supplied by Intrapay18NumberYes
02transactionIDIntrapay transaction ID150StringYes
03pSignThe SHA signature used to secure protocol4040StringYes

Example Void Request:

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

[POST PARAMS]

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

$postData["merchantID"] = "MERCHANT_ID_GOES_HERE"; //your merchant ID
$postData["transactionID"] = "TRANSACTION_ID_GOES_HERE"; //transaction ID

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/void";
	String passCode = "PASSCODE_GOES_HERE"; //your pass Code
	String merchantID = "MERCHANT_ID_GOES_HERE"; //your merchant ID
	String transactionID = "TRANSACTION_ID_GOES_HERE"; //transaction ID

	String pSign = PSignUtil.generatePSign(passCode + merchantID + transactionID);

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

	requestData.append("merchantID=" + merchantID);
	requestData.append(and + "transactionID=" + transactionID);
	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/void'; //api name to be process
var passCode = 'PASSCODE_GOES_HERE'; //your pass Code
var merchantID = 'MERCHANT_ID_GOES_HERE'; //your merchant ID
var transactionID = 'TRANSACTION_ID_GOES_HERE'; //transaction ID

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

shasum.update(passCode + merchantID + transactionID);
var pSign = shasum.digest('hex');

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

var data = {
		'passCode' : passCode,
		'merchantID' : merchantID,
		'transactionID' : transactionID,
};

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/void' #api name to be process
passCode = 'PASSCODE_GOES_HERE' #your pass Code
merchantID = 'MERCHANT_ID_GOES_HERE' #your merchant ID
transactionID = 'TRANSACTION_ID_GOES_HERE' //transaction ID

postData = Hash[
	'merchantID' => merchantID,
	'transactionID' => transactionID
]

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/void";
	String passCode = "PASSCODE_GOES_HERE"; //your pass Code
	String merchantID = "MERCHANT_ID_GOES_HERE"; //your merchant ID
	String transactionID = "TRANSACTION_ID_GOES_HERE"; //transaction ID

	String pSign = PSignUtil.GeneratePSign(passCode + merchantID + transactionID);
	String and = "&";
	StringBuilder requestData = new StringBuilder();

	requestData.Append("merchantID=" + merchantID);
	requestData.Append(and + "transactionID=" + transactionID);
	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/void' #api name to be process
passCode = 'PASSCODE_GOES_HERE' //your pass Code
merchantID = 'MERCHANT_ID_GOES_HERE' //your merchant ID
transactionID = 'TRANSACTION_ID_GOES_HERE' //transaction ID

postData = {
	'passCode' => passCode,
	'merchantID' => merchantID,
	'transactionID' => transactionID
}

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

You will see the response here...