My Profile_


Mag Swipe Force Post

Mag Swipe Force Post

Retrieves the locked funds and prepares them for settlement into the merchant’s account.

This is used when a merchant obtains the authorization number directly from the issuer by a third-party authorization method (such as by phone).

This transaction allows for the ability to pass a Track 2 value for processing that has been collected from a standard unencrypted MSR.

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaTrack2ForcePost
{
	public static void main(String[] args)
	{
		String store_id = "moneris";
		String api_token = "hurgle";
		java.util.Date createDate = new java.util.Date(); 
		String order_id = "Test"+createDate.getTime();
		String amount = "1.00";
		String track2 =  ";5258968987035454=06061015454001060101?";
		String auth_code = "123456";
		String processing_country_code = "CA";
		boolean status_check = false;

		Track2ForcePost track2forcePost = new Track2ForcePost();
		track2forcePost.setOrderId(order_id);
		track2forcePost.setAmount(amount);
		track2forcePost.setTrack2(track2);

		track2forcePost.setAuthCode(auth_code);

		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(track2forcePost);
		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("StatusCode = " + receipt.getStatusCode());
			//System.out.println("StatusMessage = " + receipt.getStatusMessage());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

                
USA Code Sample

package USA;

import JavaAPI.*;

public class TestUSATrack2ForcePost
{
	public static void main(String[] args)
	{
		String store_id = "monusqa002";
		String api_token = "qatoken";
		java.util.Date createDate = new java.util.Date(); 
		String order_id = "Test"+createDate.getTime();
		String amount = "10.00";
		String track2 = "";
		String pan = "4242424242424242";
		String expiry_date = "1212";
		String pos_code = "00";
		String auth_code = "AU4R6";
		String processing_country_code = "US";
		boolean status_check = false;

		Track2ForcePost track2forcePost = new Track2ForcePost();
		track2forcePost.setOrderId(order_id);
		track2forcePost.setAmount(amount);
		track2forcePost.setTrack2(track2);
		track2forcePost.setPan(pan);
		track2forcePost.setExpdate(expiry_date);
		track2forcePost.setPosCode(pos_code);
		track2forcePost.setAuthCode(auth_code);

		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(track2forcePost);
		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("StatusCode = " + receipt.getStatusCode());
			//System.out.println("StatusMessage = " + receipt.getStatusMessage());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

                

Mag Swipe Force Post - Transaction Values

Track2ForcePost track2forcePost = new Track2ForcePost();

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(track2forcePost);

Mag Swipe Force Post object mandatory values

Value Type Limits Set Method Description
Order ID String 50-character alphanumeric track2forcePost.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.

Canada: 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.

US: The last 32 characters of the order ID are sent on to the Client Line settlement reports.

For either countries, If the order ID has fewer than 3 characters, it may display a blank or 0000000000 in the Invoice Number field.
Amount String 9-character decimal track2forcePost.setAmount(amount); Transaction amount This must contain at least 3 digits, two of which are penny values.
The minimum allowable value is $0.01, and the maximum allowable value is $999999.99. Transaction amounts of $0.00 are not allowed.
Track 2 data String 40 – character alphanumeric track2forcePost.setTrack2(track2); Retrieved from the mag stripe of a credit card by swiping it through a card reader.
Credit card number String 20-character numeric track2forcePost.setPan(pan); Most credit card numbers today are 16 digits, but some 13-digit numbers are still accepted by some issuers. This field has been intentionally expanded to 20 digits in consideration for future expansion and potential support of private label card ranges.

This field is only applicable if processing a manually keyed card present transaction where the MSR was unable to read the card swipe Track 2 data. This requires the full card number to be passed.

If passing the credit card number, then the Track 2 data must be left blank.
Expiry date String 4-character numeric
YYMM format.
track2forcePost.setExpdate(exp); Submit in YYMM format.
Note: This is the reverse of the date displayed on the physical card, which is MMYY.

If the card is swiped and a Track 2 value is passed, then this field must be omitted or set to ‘0000’.

If processing a manually keyed card present transaction and passing the credit card number (pan) field then this field must be properly populated with the expiry date.
POS Code String 2-character numeric track2forcePost.setPosCode(pos_code); Supported values are:
  • 00 - normal presentment situations
  • 71 - If a Pre-Authorization transaction was card-present and keyed-in, then the POS code for the corresponding Completion transaction is 71.
  • 27 - In an unmanned kiosk environment where the card is present
  • If the solution is not “merchant and cardholder present”, contact Moneris for the proper POS code.
Authorization code String 8-character alphanumeric track2forcePost.setAuthCode(auth_code); Supported values are:
  • 00 - normal presentment situations
  • 71 - If a Pre-Authorization transaction was card-present and keyed-in, then the POS code for the corresponding Completion transaction is 71.
  • 27 - In an unmanned kiosk environment where the card is present
  • If the solution is not “merchant and cardholder present”, contact Moneris for the proper POS code.

Mag Swipe Force Post 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. To submit a Status Check request, resend the original transaction with all the same parameter values, but set the status check value to either true or false. Once set to “true”, the gateway will check the status of a transaction that has an order_id that matches the one passed.
  • If the transaction is found, the gateway will respond with the specifics of that transaction.
  • If the transaction is not found, the gateway will respond with a not found message.
  • Once it is set to “false”, the transaction will process as a new transaction.
Things to consider:
  • The Status Check request should only be used once and immediately (within 2 minutes) after the last transaction that had failed.
  • Do not resend the Status Check request if it has timed out. Additional investigation is required.
Customer ID String 50-character alphanumeric track2forcePost.setCustId(cust_id); This can be used for policy number, membership number, student ID, or invoice number. This field is searchable from the Moneris Merchant Resource Centre.

Predecessors
  • Pre-Authorization completed on an independent system
Successors
  • Mag Swipe Purchase Correction ( API )
  • Mag Swipe Refund ( API )
  • Tokenize ( API )