Double Message Transactions

Capture Transaction

This method is used to finalize a previously authorized transaction in an attempt to capture the funds from the customer's credit card account and transfer them in the merchant's account. If the action succeeds then the transaction status will be approved (successful).

To implement this method:

  1. The merchant securely obtains all the necessary details in order to start the capture 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/capture
  3. The system will respond to the Merchant with the result of the transaction capture operation.
  4. The Merchant computes all necessary operations in his system and may notify the customer with the result of this action

Capture Transaction fields

Order (pSign)Field NameDetailsMinMaxTypeRequired
01merchantIDMerchant id supplied by Intrapay18NumberYes
02amountThe purchase amount (ex. 1.99)112DecimalNo*
03transactionIDIntrapay transaction ID150StringYes
04pSignThe SHA signature used to secure protocol4040StringYes

* Please note that usually Gateways/Banks do not support partial captures. Our technical team will specify if any of these are required/supported.


Example Capture Request:

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

[POST PARAMS]

<?php
    	
require_once("classes/Api.php");
    	
$endPointUrl = "https://payment.intrapay.com/transaction/capture";	// 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["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/capture";
	String passCode = "PASSCODE_GOES_HERE"; //your pass Code
	String merchantID = "MERCHANT_ID_GOES_HERE"; //your merchant ID
	String amount = "2.11";
	String transactionID = "TRANSACTION_ID_GOES_HERE"; //transaction ID

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

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

	requestData.append("merchantID=" + merchantID);
	requestData.append(and + "amount=" + amount);
	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/capture'; //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 transactionID = 'TRANSACTION_ID_GOES_HERE'; //transaction ID

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

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

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

var data = {
		'passCode' : passCode,
		'merchantID' : merchantID,
		'amount' : amount,
		'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/capture' #api name to be process
passCode = 'PASSCODE_GOES_HERE' #your pass Code
merchantID = 'MERCHANT_ID_GOES_HERE' #your merchant ID
amount = '2.11'
transactionID = 'TRANSACTION_ID_GOES_HERE' //transaction ID

postData = Hash[
	'merchantID' => merchantID,
	'amount' => amount,
	'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/capture";
	String passCode = "PASSCODE_GOES_HERE"; //your pass Code
	String merchantID = "MERCHANT_ID_GOES_HERE"; //your merchant ID
	String amount = "2.11";
	String transactionID = "TRANSACTION_ID_GOES_HERE"; //transaction ID

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

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

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

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

You will see the response here...