My Profile_


Pre-Authorization Completion

Retrieves funds that have been locked (by either a Pre-Authorization or a Re-Authorization transaction), and prepares them for settlement into the merchant’s account.

Things to consider:

  • Pre-Authorization Completion is also known as "capture" or "completion".
  • A Pre-Authorization or Re-Authorization transaction can only be completed once. Refer to the Re-Authorization transaction for more information on how to perform multiple Completion transactions.
  • To reverse the full amount of a Pre-Authorization transaction, use the Pre-Authorization Completion transaction with the amount set to 0.00.

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaCompletion
{
	public static void main(String[] args)
	{
		String store_id = "store5";
		String api_token = "yesguy";
		String order_id = "Test1436981327037";
		String amount = "1.00";
		String txn_number = "152900-0_10";
		String crypt = "7";
		String cust_id = "my customer id";
		String dynamic_descriptor = "my descriptor";
		String processing_country_code = "CA";
		boolean status_check = false;

		Completion completion = new Completion();
		completion.setOrderId(order_id);
		completion.setCompAmount(amount);
		completion.setTxnNumber(txn_number);
		completion.setCryptType(crypt);
		completion.setCustId(cust_id);
		completion.setDynamicDescriptor(dynamic_descriptor);

		HttpsPostRequest mpgReq = new HttpsPostRequest();
		mpgReq.setProcCountryCode(processing_country_code);
		mpgReq.setTestMode(true); //false or comment out this line for production transactions
		mpgReq.setStoreId(store_id);
		mpgReq.setApiToken(api_token);
		mpgReq.setTransaction(completion);
		mpgReq.setStatusCheck(status_check);
		mpgReq.send();

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("CardType = " + receipt.getCardType());
			System.out.println("TransAmount = " + receipt.getTransAmount());
			System.out.println("TxnNumber = " + receipt.getTxnNumber());
			System.out.println("ReceiptId = " + receipt.getReceiptId());
			System.out.println("TransType = " + receipt.getTransType());
			System.out.println("ReferenceNum = " + receipt.getReferenceNum());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("ISO = " + receipt.getISO());
			System.out.println("BankTotals = " + receipt.getBankTotals());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("AuthCode = " + receipt.getAuthCode());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("Ticket = " + receipt.getTicket());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("IsVisaDebit = " + receipt.getIsVisaDebit());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}
                
USA Code Sample

package USA;

import JavaAPI.*;

public class TestUSACompletion
{
	public static void main(String[] args)
	{
		String store_id = "monusqa002";
		String api_token = "qatoken";
		String amount = "1.00";
		String crypt = "7";
		String commcard_invoice = "INVC090";
		String commcard_tax_amount = "1.00";
		String dynamic_descriptor = "123456";
		String custid = "mycustomerid";
		String order_id = "Test1437167057352";
		String txn_number = "138748-0_25";
		String processing_country_code = "US";
		boolean status_check = false;

		Completion completion = new Completion();
		completion.setOrderId(order_id);
		completion.setCompAmount(amount);
		completion.setTxnNumber(txn_number);
		completion.setCryptType(crypt);
		completion.setCommcardInvoice(commcard_invoice);
		completion.setCommcardTaxAmount(commcard_tax_amount);
		completion.setCustId(custid);
		completion.setDynamicDescriptor(dynamic_descriptor);

		HttpsPostRequest mpgReq = new HttpsPostRequest();
		mpgReq.setProcCountryCode(processing_country_code);
		mpgReq.setTestMode(true); //false or comment out this line for production transactions
		mpgReq.setStoreId(store_id);
		mpgReq.setApiToken(api_token);
		mpgReq.setTransaction(completion);
		mpgReq.setStatusCheck(status_check);
		mpgReq.send();

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("CardType = " + receipt.getCardType());
			System.out.println("TransAmount = " + receipt.getTransAmount());
			System.out.println("TxnNumber = " + receipt.getTxnNumber());
			System.out.println("ReceiptId = " + receipt.getReceiptId());
			System.out.println("TransType = " + receipt.getTransType());
			System.out.println("ReferenceNum = " + receipt.getReferenceNum());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("ISO = " + receipt.getISO());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("AuthCode = " + receipt.getAuthCode());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("Ticket = " + receipt.getTicket());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			//System.out.println("CardLevelResult = " + receipt.getCardLevelResult());
			//System.out.println("StatusCode = " + receipt.getStatusCode());
			//System.out.println("StatusMessage = " + receipt.getStatusMessage());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}
                

Completion object

Completion completion = new Completion();

HttpsPostRequest object for Completion transaction

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(completion);

Completion transaction object mandatory values

Value Type Limits Set method Description
Order ID String 50-character alphanumeric completion.setOrderId(order_id); Merchant-defined transaction identifier that must be unique for every Purchase, Pre-Authorization and Independent Refund transaction. No two transactions of these types may have the same order ID.

For Refund, Completion and Purchase Correction transactions, the order ID must be the same as that of the original transaction.

The last 10 characters of the order ID are displayed in the “Invoice Number” field on the Merchant Direct Reports. However only letters, numbers and spaces are sent to Merchant Direct.

A minimum of 3 and a maximum of 10 valid characters are sent to Merchant Direct. Only the last characters beginning after any invalid characters are sent. For example, if the order ID is 1234-567890, only 567890 is sent to Merchant Direct.

If the order ID has fewer than 3 characters, it may display a blank or 0000000000 in the Invoice Number field.
Completion Amount String 9-character decimal completion.setCompAmount(amount); Amount of a Completion transaction. This may not be equal to the amount value which appeared in the original Pre-Authorization transaction.
Transaction number String 255-character variable character) completion.setTxnNumber(txn_number); Used when performing follow-on transactions. (That is, Completion, Purchase Correction or Refund.) This must be the value that was returned as the transaction number in the response of the original transaction.

When performing a Completion, this value must reference the Pre-Authorization. When performing a Refund or a Purchase Correction, this value must reference the Completion or the Purchase.
E-commerce indicator String 1-character alphanumeric completion.setCryptType(crypt); 1: Mail Order / Telephone Order—Single
2: Mail Order / Telephone Order—Recurring
3: Mail Order / Telephone Order—Instalment
4: Mail Order / Telephone Order—Unknown classification
5: Authenticated e-commerce transaction (VBV)
6: Non-authenticated e-commerce transaction (VBV)
7: SSL-enabled merchant
8: Non-secure transaction (web- or email-based)
9: SET non-authenticated transaction

Completion transaction object optional values

Value Type Limits Set method Description
Status Check Boolean true/false mpgReq.setStatusCheck(status_check); Status Check is a connection object value that allows merchants to verify whether a previously sent transaction was processed successfully.
Dynamic descriptor String 20-character alphanumeric completion.setDynamicDescriptor("2134565"); Merchant-defined description sent on a per-transaction basis that will appear on the credit card statement appended to the merchant’s business name.
Commercial card invoice
String 17-character alphanumeric completion.setCommcardInvoice(commcard_invoice); Available to US integrations only. Level 2 Invoice Number for the transaction used for Corporate Credit Card transactions (Commercial Purchasing Cards). Characters allowed for commcard_invoice: a-z A-Z 0-9 spaces
Commercial card tax amount
String 9-character decimal
Must contain at least 3 digits, two of which must be penny values.
completion.setCommcardTaxAmount(commcard_tax_amount); Available to US integrations only. Level 2 Tax Amount of the transaction used for Corporate Credit Card transactions (Commercial Purchasing Cards). This must contain 3 digits with two penny values. The minimum value passed can be 0.00 and the maximum is 9999999.99
Customer ID String 50-character alphanumeric completion.setCustId(cust_id); Note: Only supported for Canada.
This can be used for policy number, membership number, student ID, invoice number and so on.

This field is searchable from the Moneris Merchant Resource Centre.

Predecessors
Successors