My Profile_


ACH Debit

Verifies and collects the customer’s bank account information, removes the funds directly from the bank account and prepares them for deposit into the merchant’s account.

The ACH Debit transaction object has the ACHInfo object as a property. Therefore, before invoking the connection object's setTransaction method, you need to pass the ACHInfo object to the ACH transaction object by using its setAchInfo method.

Things to consider:

  • All alphanumeric ACHInfo fields allow the following characters: a-z A-Z 0-9 _ - : . @ $ = /
  • If you send characters that are not included in the allowed list, the ACH transaction may not be properly registered.
  • ACHInfo fields are not used for any type of address verification or fraud check.

ACH transactions are available to US integrations only.

USA Code Sample

package USA;

import JavaAPI.*;

public class TestUSAACHDebit
{
	public static void main(String[] args)
	{
		java.util.Date createDate = new java.util.Date();
		String order_id = "Test"+createDate.getTime();
		String store_id = "monusqa002";
		String api_token = "qatoken";
		//String status = "true";
		String amount = "1.00";

		//ACHInfo Variables
		String sec = "ppd";
		String cust_first_name = "Christian";
		String cust_last_name = "M";
		String cust_address1 = "3300 Bloor St W";
		String cust_address2 = "4th floor west tower";
		String cust_city = "Toronto";
		String cust_state = "ON";
		String cust_zip = "M1M1M1";
		String routing_num = "490000018";
		String account_num = "222222";
		String check_num = "11";
		String account_type = "checking";
		String micr = "t071000013t742941347o128";
		String dl_num = "CO-12312312";
		String magstripe = "no";
		String image_front = "";
		String image_back = ""; 
		String processing_country_code = "US";
		boolean status_check = false;

		ACHInfo achinfo = new ACHInfo(sec, cust_first_name, cust_last_name,
				cust_address1, cust_address2, cust_city, cust_state, cust_zip,
				routing_num, account_num, check_num, account_type, micr);


		achinfo.setImgFront(image_front);
		achinfo.setImgBack(image_back);
		achinfo.setDlNum(dl_num);
		achinfo.setMagstripe(magstripe);

		ACHDebit achdebit = new ACHDebit();
		achdebit.setOrderId(order_id);
		achdebit.setAmount(amount);
		achdebit.setAchInfo(achinfo);

		//************************OPTIONAL VARIABLES***************************

		//Cust_id Variable
		String cust_id = "customer1";
		achdebit.setCustId(cust_id);

		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(achdebit);
		mpgReq.setStatusCheck(status_check);
		mpgReq.send();

		/*Status Check Example
		  ACHHttpsPostRequest mpgReq = new ACHHttpsPostRequest(host, store_id, api_token, status, achdebit);
		 */

		/**********************   REQUEST  ************************/

		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("Message = " + receipt.getMessage());
			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();
		}
	}
}

                

ACH Debit transaction object definition

ACHDebit achdebit = new ACHDebit();

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(achdebit);

ACH Debit transaction object mandatory values

Value Type Limits Set method Description
Order ID String 50-character alphanumeric achdebit.setOrderId(order_id); Merchant-defined transaction identifier that must be unique for every ACH debit and credit transaction. No two transactions of these types may have the same order ID. For ACH Reversal transactions, the order ID must be the same as that of the original transaction.
Amount String 9-character decimal achdebit.setAmount(amount); Transaction amount. Used in a number of transactions. Note that this is different from the amount used in a Completion transaction, which is an alphanumeric value.

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 999 999.99. Transaction amounts of $0.00 are not allowed.
ACH Info Object ACHInfo achinfo = new ACHInfo(sec, cust_first_name, cust_last_name, cust_address1, cust_address2, cust_city, cust_state, cust_zip, routing_num, account_num, check_num, account_type, micr);
achdebit.setAchInfo(achinfo);
Refer below for further breakdown and definition.

ACH Debit transaction object optional values

Value Type Limits Set method Description
Customer ID String 50-character alphanumeric achdebit.setCustId(cust_id); 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.
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 information Object CustInfo customer = new CustInfo();
achdebit.setCustInfo(customer);
Refer below for further breakdown and definition.
Convenience fee Object ConvFeeInfo convFeeInfo = new ConvFeeInfo();
achdebit.setConvFeeInfo(convFeeInfo);
Refer below for further breakdown and definition. Please note, if the Convenience Fee is set, then Recurring Billing is not supported.
Recurring billing Object Recur recurring_cycle = new Recur(recur_unit, start_now, start_date, num_recurs, period, recur_amount);
achdebit.setRecurInfo(recurInfo);
Refer below for further breakdown and definition.

ACH Info Mandatory Values

VALUE TYPE LIMITS VARIABLE DESCRIPTION
SEC code String ppd/ccd/web sec ACH sec Code: 
The following sec codes apply 
ppd - Prearranged Payment and Deposit 
ccd - Cash Concentration or Disbursement 
web - Internet Initiated Entry 
Routing Number String 9-character numeric routing_num The first number in the MICR, or magnetic ink character recognition, line at the bottom of a check is the bank's check routing number. It is exactly nine digits long and always starts with 0, 1, 2 or 3.
Account Number String 15-character alphanumeric account_num The account number may appear before or after the check number in the check's MICR line at the bottom of the check. The length of the account number varies with a maximum length of 50 digits.
Account Type String savings/checking account_type Identifies the type of bank account. The account type must be submitted as either ‘savings’ or ‘checking’. This field is case sensitive.

ACH Info Optional Values

VALUE TYPE LIMITS VARIABLE DESCRIPTION
Customer First Name String 50 – character alphanumeric cust_first_name Account holder’s first name.
Customer Last Name String 50 – character alphanumeric cust_last_name Account holder’s last name.
Customer Address 1 String 50 – character alphanumeric cust_address1 Account holder’s address line 1.
Customer Address 2 String 50 – character alphanumeric cust_address2 Account holder’s address line 2.
Customer City String 50 – character alphanumeric cust_city Account holder’s city.
Customer State String 2 – character alphanumeric cust_state The state must be submitted as exactly 2 characters (ex. MI – Michigan)
Customer Zip Code String 10-character numeric cust_zip Account holder’s zip code.
Check Number String 16-character numeric check_num The sequential number for checks appears in both the MICR line at the bottom of the check and the upper right corner of the check. The check number length may vary; the maximum length is 16 digits.

Predecessors
  • NA
Successors

ACH Debit with Customer Information

The Customer Information object is an optional add-on to a number of transactions. The Customer Information object offers a number of fields to be submitted as part of the financial transaction, and stored by Moneris. These details may be viewed in the future in the Merchant Resource Center.

In addition to instantiating a transaction object and a connection object (as you would for a normal transaction), you must instantiate a CustInfo object.

Any transaction that supports CustInfo has a setCustInfo method. This is used to write the customer information to the transaction object.

The Customer Information object holds three types of information:

  • Miscellaneous customer information properties
  • Billing/Shipping information
  • Item information

Things to consider:

  • If you send characters that are not included in the allowed list, these extra transaction details may not be stored.
  • All fields are alphanumeric and allow the following characters: a-z A-Z 0-9 _ - : . @ $ = /
  • All French accents should be encoded as HTML entities, such as é
  • The data sent in Billing and Shipping Address fields will not be used for any address verification.

ACH transactions are available to US integrations only.

USA Code Sample

package USA;
                                                                            
import java.util.*;
import JavaAPI.*;

public class TestUSAACHDebitCustInfo
{
	public static void main(String[] args)
	{
		String order_id = "dotnetachdessbitcusti33nfotest1";
		String store_id = "monusqa002";
		String api_token = "qatoken";
		String amount = "1.00";

		//ACHInfo Variables
		String sec = "ppd";
		String cust_first_name = "Bob";
		String cust_last_name = "Smith";
		String cust_address1 = "3300 Bloor St W";
		String cust_address2 = "4th floor west tower";
		String cust_city = "Toronto";
		String cust_state = "ON";
		String cust_zip = "M1M1M1";
		String routing_num = "490000018";
		String account_num = "222222";
		String check_num = "11";
		String account_type = "checking";
		String micr = "t071000013t742941347o127";
		String dl_num = "CO-12312312";
		String magstripe = "no";
		String image_front = "";
		String image_back = "";
		String processing_country_code = "US";
		boolean status_check = false;

		ACHInfo achinfo = new ACHInfo(sec, cust_first_name, cust_last_name,
				cust_address1, cust_address2, cust_city, cust_state, cust_zip,
				routing_num, account_num, check_num, account_type, micr);


		achinfo.setImgFront(image_front);
		achinfo.setImgBack(image_back);
		achinfo.setDlNum(dl_num);
		achinfo.setMagstripe(magstripe);

		ACHDebit achdebit = new ACHDebit();
		achdebit.setOrderId(order_id);
		achdebit.setAmount(amount);
		achdebit.setAchInfo(achinfo);

		//************************OPTIONAL VARIABLES***************************

		//Cust_id Variable
		String cust_id = "customer1";
		achdebit.setCustId(cust_id);

		//CustInfo Variables
		CustInfo custInfo = new CustInfo();

		custInfo.setEmail("nick@widget.com");
		custInfo.setInstructions("Make it fast!");


		Hashtable<String, String> b = new Hashtable<String, String>();

		b.put("first_name", "Bob");
		b.put("last_name", "Smith");
		b.put("company_name", "Widget Company Inc.");
		b.put("address", "111 Bolts Ave.");
		b.put("city", "Toronto");
		b.put("province", "Ontario");
		b.put("postal_code", "M8T 1T8");
		b.put("country", "Canada");
		b.put("phone", "416-555-5555");
		b.put("fax", "416-555-5555");
		b.put("tax1", "123.45");       //federal tax
		b.put("tax2", "12.34");        //prov tax
		b.put("tax3", "15.45");        //luxury tax
		b.put("shipping_cost", "456.23");   //shipping cost

		custInfo.setBilling(b);

		/* OR you can pass the individual args.
		   custInfo.setBilling(
		   "Bob",                  //first name
		   "Smith",                //last name
		   "Widget Company Inc.",  //company name
		   "111 Bolts Ave.",       //address
		   "Toronto",              //city
		   "Ontario",              //province
		   "M8T 1T8",              //postal code
		   "Canada",               //country
		   "416-555-5555",         //phone
		   "416-555-5555",         //fax
		   "123.45",               //federal tax
		   "12.34",                //prov tax
		   "15.45",                //luxury tax
		   "456.23"                //shipping cost
		   );
		 */

		Hashtable<String, String> s = new Hashtable<String, String>();

		s.put("first_name", "Bob");
		s.put("last_name", "Smith");
		s.put("company_name", "Widget Company Inc.");
		s.put("address", "111 Bolts Ave.");
		s.put("city", "Toronto");
		s.put("province", "Ontario");
		s.put("postal_code", "M8T 1T8");
		s.put("country", "Canada");
		s.put("phone", "416-555-5555");
		s.put("fax", "416-555-5555");
		s.put("tax1", "123.45");       //federal tax
		s.put("tax2", "12.34");        //prov tax
		s.put("tax3", "15.45");        //luxury tax
		s.put("shipping_cost", "456.23");   //shipping cost

		custInfo.setShipping(s);

		/* OR you can pass the individual args.
		   custInfo.setShipping(
		   "Bob",                  //first name
		   "Smith",                //last name
		   "Widget Company Inc.",  //company name
		   "111 Bolts Ave.",       //address
		   "Toronto",              //city
		   "Ontario",              //province
		   "M8T 1T8",              //postal code
		   "Canada",               //country
		   "416-555-5555",         //phone
		   "416-555-5555",         //fax
		   "123.45",               //federal tax
		   "12.34",                //prov tax
		   "15.45",                //luxury tax
		   "456.23"                //shipping cost
		   );
		 */

		Hashtable<String, String> i1 = new Hashtable<String, String>();

		i1.put("name", "item1's name");
		i1.put("quantity", "5");
		i1.put("product_code", "item1's product code");
		i1.put("extended_amount", "1.01");

		custInfo.setItem(i1);

		/* OR you can pass the individual args.
		   custInfo.setItem(
		   "item1's name",         //name
		   "5",                    //quantity
		   "item1's product code", //product code
		   "1.01"                  //extended amount
		   );
		 */

		Hashtable<String, String> i2 = new Hashtable<String, String>();

		i2.put("name", "item2's name");
		i2.put("quantity", "7");
		i2.put("product_code", "item2's product code");
		i2.put("extended_amount", "5.01");

		custInfo.setItem(i2);

		achdebit.setCustInfo(custInfo);

		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(achdebit);
		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("Message = " + receipt.getMessage());
			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());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

                

ACH Debit transaction object definition

ACHDebit achdebit = new ACHDebit();

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(achdebit);

ACH Debit transaction with Customer Information object mandatory values

Value Type Limits Set method Description
Order ID String 50-character alphanumeric achdebit.setOrderId(order_id); Merchant-defined transaction identifier that must be unique for every ACH debit and credit transaction. No two transactions of these types may have the same order ID. For ACH Reversal transactions, the order ID must be the same as that of the original transaction.
Amount String 9-character decimal achdebit.setAmount(amount); Transaction amount. Used in a number of transactions. Note that this is different from the amount used in a Completion transaction, which is an alphanumeric value.

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 999 999.99. Transaction amounts of $0.00 are not allowed.
ACH Info Object ACHInfo achinfo = new ACHInfo(sec, cust_first_name, cust_last_name, cust_address1, cust_address2, cust_city, cust_state, cust_zip, routing_num, account_num, check_num, account_type, micr);
achdebit.setAchInfo(achinfo);
Refer below for further breakdown and definition.

ACH Debit with Customer Information optional values

Value Type Limits Set method Description
Customer ID String 50-character alphanumeric achdebit.setCustId(cust_id); 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.
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 information Object CustInfo customer = new CustInfo();
achdebit.setCustInfo(customer);
Refer below for further breakdown and definition.
Convenience fee Object ConvFeeInfo convFeeInfo = new ConvFeeInfo();
achdebit.setConvFeeInfo(convFeeInfo);
Refer below for further breakdown and definition.
Please note, if the Convenience Fee is set, then Recurring Billing is not supported.
Recurring billing Object Recur recurring_cycle = new Recur(recur_unit, start_now, start_date, num_recurs, period, recur_amount);
achdebit.setRecurInfo(recurInfo);
Refer below for further breakdown and definition.

ACH Info Mandatory Values

VALUE TYPE LIMITS VARIABLE DESCRIPTION
SEC code String ppd/ccd/web sec ACH sec Code: 
The following sec codes apply 
ppd - Prearranged Payment and Deposit 
ccd - Cash Concentration or Disbursement 
web - Internet Initiated Entry 
Routing Number String 9-character numeric routing_num The first number in the MICR, or magnetic ink character recognition, line at the bottom of a check is the bank's check routing number. It is exactly nine digits long and always starts with 0, 1, 2 or 3.
Account Number String 15-character alphanumeric account_num The account number may appear before or after the check number in the check's MICR line at the bottom of the check. The length of the account number varies with a maximum length of 50 digits.
Account Type String savings/checking account_type Identifies the type of bank account. The account type must be submitted as either ‘savings’ or ‘checking’. This field is case sensitive.

ACH Info Optional Values

VALUE TYPE LIMITS VARIABLE DESCRIPTION
Customer First Name String 50 – character alphanumeric cust_first_name Account holder’s first name.
Customer Last Name String 50 – character alphanumeric cust_last_name Account holder’s last name.
Customer Address 1 String 50 – character alphanumeric cust_address1 Account holder’s address line 1.
Customer Address 2 String 50 – character alphanumeric cust_address2 Account holder’s address line 2.
Customer City String 50 – character alphanumeric cust_city Account holder’s city.
Customer State String 2 – character alphanumeric cust_state The state must be submitted as exactly 2 characters (ex. MI – Michigan)
Customer Zip Code String 10-character numeric cust_zip Account holder’s zip code.
Check Number String 16-character numeric check_num The sequential number for checks appears in both the MICR line at the bottom of the check and the upper right corner of the check. The check number length may vary; the maximum length is 16 digits.
 

CustInfo object mandatory properties

Value Type Limits Set method Decription
Email Address String 60-character alphanumeric customer.setEmail("nick@widget.com"); Customer email address.
Instructions String 100-character alphanumeric customer.setInstructions("Rush!"); Instructions or notes.
Billing Information Object Option 1:
customer.setBilling(first_name, last_name, company_name, address, city, province, postal_code, country, phone, fax, tax1, tax2, tax3, shipping_cost);

Option 2:
customer.setBilling(billing_hash);
Billing information is stored as part of the CustInfo object. A maximum of 1 billing object may be set. They can be written to the object in one of two ways:
  • Using set methods
  • Using hash tables.
Refer below for further breakdown and definition.
Shipping Information Object Option 1:
customer.setShipping(first_name, last_name, company_name, address, city, province, postal_code, country, phone, fax, tax1, tax2, tax3, shipping_cost);

Option 2:
customer.setShipping(shipping_hash);
Shipping information is stored as part of the CustInfo object. A maximum of 1 shipping object may be set. They can be written to the object in one of two ways:
  • Using set methods
  • Using hash tables.
Refer below for further breakdown and definition.
Items Array Object Option 1:
customer.setItem(item_description[0], item_quantity[0], item_product_code[0], item_extended_amount[0]);

Option 2:
Customer.setItem(item_hash);
Item information is stored as part of the CustInfo object. Multiple items may be set. They can be written to the object in one of two ways:
  • Using set methods
  • Using hash tables.
Refer below for further breakdown and definition.

Setting Billing & Shipping using Set Methods

The billing information and the shipping information for a given CustInfo object are written by using the customer.setBilling() and customer.setShipping() methods respectively:

customer.setBilling(first_name, last_name, company_name, address, city, province, postal_code, country, phone, fax, tax1, tax2, tax3, shipping_cost);

customer.setShipping(first_name, last_name, company_name, address, city, province, postal_code, country, phone, fax, tax1, tax2, tax3, shipping_cost);

Both of these methods have the same set of mandatory arguments.

Setting Billing & Shipping using Hash Tables

Writing billing or shipping information using hash tables is done as follows:

  1. Instantiate a CustInfo object.
  2. Instantiate a Hashtable object. (The sample code uses a different hash table for billing and shipping for clarity purposes. However, the skillful developer can re-use the same one.)
  3. Build the hashtable using put methods with the hash table keys in the table below.
  4. Call the CustInfo object's setBilling()/setShipping() method to pass the hashtable information to the CustInfo object
  5. Call the transaction object's setCustInfo() method to write the CustInfo object (with the billing/shipping information to the transaction object.

Billing & Shipping mandatory values

Value Type Limits Variable/Hash Table Key Description
First Name String 30-character alphanumeric "first_name" Customer first name
Last Name String 30-character alphanumeric "last_name" Customer last name
Company Name String 50-character alphanumeric "company_name" Customer 's company name
Address String 70-character alphanumeric "address" Customer's address
City String 30-character alphanumeric "city" Customer's city
Province / State String 30-character alphanumeric "province" Customer's province or state
Postal / Zip Code String 30-character alphanumeric "postal_code" Customer's postal or zip code
Country String 30-character alphanumeric "country" Customer's country
Phone Number String 30-character alphanumeric "phone" Customer's phone number
Fax Number String 30-character alphanumeric fax" Customer's fax number
Federal Tax String 10-character alphanumeric "tax1" Federal tax amount. Amount is not used for calculating total amount.
Provincial / State Tax String 10-character alphanumeric "tax2" Provincial or state tax amount. Amount is not used for calculating total amount.
Country / Local / Specialty Tax String 10-character alphanumeric "tax3" County, local or specialty tax amount. Amount is not used for calculating total amount.
Shipping Cost String 10-character alphanumeric "shipping_cost" Shipping cost. Amount is not used for calculating total amount.

Setting Items using Set Methods

All the item information in the table below is written to the CustInfo object in one instruction for a given item. Multiples items may be set. Such as:

customer.setItem(item_description, item_quantity, item_product_code, item_extended_amount);

Setting Items using Hash Tables

Writing item information using hash tables is done as follows:

  1. Instantiate a CustInfo object.
  2. Instantiate a Hashtable object. (The sample code uses a different hash table for each item for clarity purposes. However, the skillful developer can re-use the same one.)
  3. Build the hashtable using put methods with the hash table keys in the table below.
  4. Call the CustInfo object's setItem() method to pass the hashtable information to the CustInfo object
  5. Call the transaction object's setCustInfo() method to write the CustInfo object (with the item information to the transaction object.

Item mandatory values

Value Type Limits Variable/Hash Table Key Description
Item Name String 45-character alphanumeric "name" Item name or description.
Item Quantity String 5-character numeric "quantity" You must send a quantity > 0 or the item will not be added to the item list (i.e. minimum 1, maximum 99999)
Item Product Code String 20-character alphanumeric "product_code" Item product code or SKU.
Item Extended Amount String 9-character decimal "extended_amount" Must contain at least 3 digits and 2 penny values.
0.01-999999.99

Predecessors
  • NA
Successors

ACH Debit with Recurring Billing

Verifies and collects the customer’s bank account information, removes the funds directly from the bank account and prepares them for deposit into the merchant’s account.

Recurring Billing allows you to set up payments whereby Moneris automatically processes the transactions and bills customers on your behalf based on the billing cycle information you provide.

In addition to instantiating a transaction object and a connection object (as you would for a normal transaction), you must instantiate a Recur object. This object has a number of mandatory properties that must be set.

Any transaction that supports Recurring Billing has a setRecur method. This is used to write the Recurring Billing information to the transaction object before writing the transaction object to the connection object.

Things to consider:

  • To avoid shifting, do not set the start_date after the 28th if the recur_unit is month. To set the billing date for the last day of the month, set recur_unit to eom.

ACH transactions are available to US integrations only.

USA Code Sample

package USA;

import JavaAPI.*;

public class TestUSAACHDebitRecur
{
	public static void main(String[] args)
	{
		String order_id = "dotnetaschdebitssrecurtest12323";
		String store_id = "monusqa002";
		String api_token = "qatoken";
		String amount = "1.00";

		//ACHInfo Variables
		String sec = "ppd";
		String cust_first_name = "Bob";
		String cust_last_name = "Smith";
		String cust_address1 = "3300 Bloor St W";
		String cust_address2 = "4th floor west tower";
		String cust_city = "Toronto";
		String cust_state = "ON";
		String cust_zip = "M1M1M1";
		String routing_num = "490000018";
		String account_num = "222222";
		String check_num = "11";
		String account_type = "checking";
		String micr = "t071000013t742941347o128";
		String dl_num = "CO-12312312";
		String magstripe = "no";
		String image_front = "";
		String image_back = "";
		String processing_country_code = "US";
		boolean status_check = false;

		ACHInfo achinfo = new ACHInfo(sec, cust_first_name, cust_last_name,
				cust_address1, cust_address2, cust_city, cust_state, cust_zip,
				routing_num, account_num, check_num, account_type, micr);


		achinfo.setImgFront(image_front);
		achinfo.setImgBack(image_back);
		achinfo.setDlNum(dl_num);
		achinfo.setMagstripe(magstripe);

		ACHDebit achdebit = new ACHDebit();
		achdebit.setOrderId(order_id);
		achdebit.setAmount(amount);
		achdebit.setAchInfo(achinfo);

		//************************OPTIONAL VARIABLES***************************

		//Cust_id Variable
		String cust_id = "customer1";
		achdebit.setCustId(cust_id);

		//Recur Variables
		//hard coded values for testing
		String recur_unit = "month";   //valid values are (day,week,month)
		String start_now = "true";	   //valid values are (true,false)
		String start_date = "2018/10/01";
		String num_recurs = "12";
		String period = "1";
		String recur_amount = "1.01";

		Recur recurInfo = new Recur(recur_unit, start_now, start_date, num_recurs, period, recur_amount);
		achdebit.setRecurInfo(recurInfo);

		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(achdebit);
		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("Message = " + receipt.getMessage());
			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());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

                

ACH Debit transaction object definition

ACHDebit achdebit = new ACHDebit();

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(achdebit);

ACH Debit with Recurring Billing mandatory values

Value Type Limits Set method Description
Order ID String 50-character alphanumeric achdebit.setOrderId(order_id); Merchant-defined transaction identifier that must be unique for every ACH debit and credit transaction. No two transactions of these types may have the same order ID. For ACH Reversal transactions, the order ID must be the same as that of the original transaction.
Amount String 9-character decimal achdebit.setAmount(amount); Transaction amount. Used in a number of transactions. Note that this is different from the amount used in a Completion transaction, which is an alphanumeric value.

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 999 999.99. Transaction amounts of $0.00 are not allowed.
ACH Info Object ACHInfo achinfo = new ACHInfo(sec, cust_first_name, cust_last_name, cust_address1, cust_address2, cust_city, cust_state, cust_zip, routing_num, account_num, check_num, account_type, micr);
achdebit.setAchInfo(achinfo);
Refer below for further breakdown and definition.

ACH Debit with Recurring Billing optional values

Value Type Limits Set method Description
Customer ID String 50-character alphanumeric achdebit.setCustId(cust_id); 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.
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 information Object CustInfo customer = new CustInfo();
achdebit.setCustInfo(customer);
Refer below for further breakdown and definition.
Recurring billing Object Recur recurring_cycle = new Recur(recur_unit, start_now, start_date, num_recurs, period, recur_amount);
achdebit.setRecurInfo(recurInfo);
Refer below for further breakdown and definition.

ACH Info Mandatory Values

VALUE TYPE LIMITS VARIABLE DESCRIPTION
SEC code String ppd/ccd/web sec ACH sec Code: 
The following sec codes apply 
ppd - Prearranged Payment and Deposit 
ccd - Cash Concentration or Disbursement 
web - Internet Initiated Entry 
Routing Number String 9-character numeric routing_num The first number in the MICR, or magnetic ink character recognition, line at the bottom of a check is the bank's check routing number. It is exactly nine digits long and always starts with 0, 1, 2 or 3.
Account Number String 15-character alphanumeric account_num The account number may appear before or after the check number in the check's MICR line at the bottom of the check. The length of the account number varies with a maximum length of 50 digits.
Account Type String savings/checking account_type Identifies the type of bank account. The account type must be submitted as either ‘savings’ or ‘checking’. This field is case sensitive.

ACH Info Optional Values

VALUE TYPE LIMITS VARIABLE DESCRIPTION
Customer First Name String 50 – character alphanumeric cust_first_name Account holder’s first name.
Customer Last Name String 50 – character alphanumeric cust_last_name Account holder’s last name.
Customer Address 1 String 50 – character alphanumeric cust_address1 Account holder’s address line 1.
Customer Address 2 String 50 – character alphanumeric cust_address2 Account holder’s address line 2.
Customer City String 50 – character alphanumeric cust_city Account holder’s city.
Customer State String 2 – character alphanumeric cust_state The state must be submitted as exactly 2 characters (ex. MI – Michigan)
Customer Zip Code String 10-character numeric cust_zip Account holder’s zip code.
Check Number String 16-character numeric check_num The sequential number for checks appears in both the MICR line at the bottom of the check and the upper right corner of the check. The check number length may vary; the maximum length is 16 digits.
 

Recurring object mandatory values
Value Type Limits Argument name in example Description
Recur unit String day, week, month or eom recur_unit Unit to be used as a basis for the interval. This can be set as day, week, month or the end of the month.
Works in conjunction with the period argument (see below) to define the billing frequency.
Start Now String true/false start_now IIf a single charge is to be made against the card immediately, set this value to true. The amount to be billed immediately may differ from the amount billed on a regular basis thereafter.
If the billing is to start in the future, set this value to false.
Start Date String YYYY/MM/DD format start_date Date of the first future recurring billing transaction. This value must be a date in the future.
If an additional charge is to be made immediately, the start_now argument must be set to true.
Number of Recurs String numeric 1-99 num_recurs The number of times that the transaction must recur.
Period String numeric 1-999 period Number of recur units that must pass between recurring billings.
Recurring Amount String 9-character decimal 0.01-9999999.99. recur_amount Amount of the recurring transaction. This must contain at least three digits, two of which are penny values.
This is the amount that will be billed on the start_date, and then billed repeatedlybased on the interval defined by period and recur_unit.

Recurring Billing Response Fields

Value Limits Get Method Description
Recurring billing success true/false receipt.getRecurSuccess(); Indicates whether the recurring billing transaction has been successfully set up for future billing.

Predecessors
  • NA
Successors
  • ACH Reversal (API | Batch)
  • Recurring Billing Update (API)

ACH Debit with Convenience Fee

The Convenience Fee program allows merchants to apply an additional charge to a customer’s bill (with their consent) for the convenience of being able to pay for goods and services using an alternative payment channel. This applies only when providing a true convenience in the form of a channel outside the merchant's customary face-to-face payment channels.

The convenience fee is a charge in addition to what the consumer is paying for the provided goods/services. This charge appears as a separate line item on the consumer’s statement.

The Convenience Fee program provides several benefits. It may allow you an opportunity to reduce or eliminate transaction processing fees and improve customer satisfaction.

In addition to instantiating a transaction object and a connection object (as you would for a normal transaction), you must instantiate a ConvFeeInfo object. This object has one mandatory value that must be set.

ACH transactions are available to US integrations only.

USA Code Sample

package USA;
import JavaAPI.*;

public class TestUSAConvFeeACHDebit
{
	public static void main(String args[])
	{
		String store_id = "monusqa002";
		String api_token = "qatoken";
		String processing_country_code = "US";

		java.util.Date createDate = new java.util.Date();
		String order_id = "Test"+createDate.getTime();
		String cust_id = "moneristest";
		String amount = "10.00";

		String sec = "web";
		String cust_first_name = "Moneris";
		String cust_last_name = "Solutions";
		String cust_address1 = "3300 Bloor St W";
		String cust_address2 = "4th floor west tower";
		String cust_city = "Toronto";
		String cust_state = "ON";
		String cust_zip = "M1M1M1";
		String routing_num = "071000013";
		String account_num = "742941347";
		String check_num = "9995";
		String account_type = "checking";
		String micr = "";

		ACHInfo achinfo = new ACHInfo (sec,cust_first_name,cust_last_name,cust_address1,cust_address2,cust_city,cust_state,
				cust_zip,routing_num,account_num,check_num,account_type,micr);

		ACHDebit ach_debit = new ACHDebit (order_id, cust_id, amount, achinfo);

		ConvFeeInfo convFeeInfo = new ConvFeeInfo();
		convFeeInfo.setConvenienceFee("5.00");
		ach_debit.setConvFeeInfo(convFeeInfo);

		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(ach_debit);
		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("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("CfSuccess = " + receipt.getCfSuccess());
			System.out.println("CfStatus = " + receipt.getCfStatus());
			System.out.println("FeeAmount = " + receipt.getFeeAmount());
			System.out.println("FeeRate = " + receipt.getFeeRate());
			System.out.println("FeeType = " + receipt.getFeeType());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
} 

                

ACH Debit - Transaction Values

ACHDebit achdebit = new ACHDebit();

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(achdebit);

ACH Debit with Convenience Fee mandatory values

Value Type Limits Set method Description
Order ID String 50-character alphanumeric achdebit.setOrderId(order_id); Merchant-defined transaction identifier that must be unique for every ACH debit and credit transaction. No two transactions of these types may have the same order ID. For ACH Reversal transactions, the order ID must be the same as that of the original transaction.
Amount String 9-character decimal achdebit.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.
ACH Info Object ACHInfo achinfo = new ACHInfo(sec, cust_first_name, cust_last_name, cust_address1, cust_address2, cust_city, cust_state, cust_zip, routing_num, account_num, check_num, account_type, micr);
achdebit.setAchInfo(achinfo);
Refer below for further breakdown and definition.

ACH Debit with Convenience Fee optional values

Value Type Limits Set method Decription
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 achdebit.setCustId(cust_id); This can be used for policy number, membership number, student ID, invoice number.
This field is searchable from the Moneris Merchant Resource Centre.
Customer Information Object CustInfo customer = new CustInfo();
achdebit.setCustInfo(customer);
Refer below for further breakdown and definition.
Convenience fee Object ConvFeeInfo convFeeInfo = new ConvFeeInfo();
achdebit.setConvFeeInfo(convFeeInfo);
Refer below for further breakdown and definition.
Please note, if the Convenience Fee is set, then Recurring Billing is not supported.
Recurring Billing Object Recur recurring_cycle = new Recur(recur_unit, start_now, start_date, num_recurs, period, recur_amount); achdebit.setRecurInfo(recurInfo); Refer below for further breakdown and definition.

ACH Info Mandatory Values

VALUE TYPE LIMITS VARIABLE DESCRIPTION
SEC code String ppd/ccd/web sec ACH sec Code: 
The following sec codes apply 
ppd - Prearranged Payment and Deposit 
ccd - Cash Concentration or Disbursement 
web - Internet Initiated Entry 
Routing Number String 9-character numeric routing_num The first number in the MICR, or magnetic ink character recognition, line at the bottom of a check is the bank's check routing number. It is exactly nine digits long and always starts with 0, 1, 2 or 3.
Account Number String 15-character alphanumeric account_num The account number may appear before or after the check number in the check's MICR line at the bottom of the check. The length of the account number varies with a maximum length of 50 digits.
Account Type String savings/checking account_type Identifies the type of bank account. The account type must be submitted as either ‘savings’ or ‘checking’. This field is case sensitive.

ACH Info Optional Values

VALUE TYPE LIMITS VARIABLE DESCRIPTION
Customer First Name String 50 – character alphanumeric cust_first_name Account holder’s first name.
Customer Last Name String 50 – character alphanumeric cust_last_name Account holder’s last name.
Customer Address 1 String 50 – character alphanumeric cust_address1 Account holder’s address line 1.
Customer Address 2 String 50 – character alphanumeric cust_address2 Account holder’s address line 2.
Customer City String 50 – character alphanumeric cust_city Account holder’s city.
Customer State String 2 – character alphanumeric cust_state The state must be submitted as exactly 2 characters (ex. MI – Michigan)
Customer Zip Code String 10-character numeric cust_zip Account holder’s zip code.
Check Number String 16-character numeric check_num The sequential number for checks appears in both the MICR line at the bottom of the check and the upper right corner of the check. The check number length may vary; the maximum length is 16 digits.
 

Convenience Fee Mandatory Values

VALUE TYPE LIMITS SET METHOD DESCRIPTION
Convenience fee amount String 9-character decimal convFeeInfo.setConvenienceFee("5.00"); Amount customer is being charged as a convenience fee
 

Recurring object mandatory values
Value Type Limits Argument name in example Description
Recur unit String day, week, month or eom recur_unit Unit to be used as a basis for the interval. This can be set as day, week, month or the end of the month.
Works in conjunction with the period argument (see below) to define the billing frequency.
Start Now String true/false start_now IIf a single charge is to be made against the card immediately, set this value to true. The amount to be billed immediately may differ from the amount billed on a regular basis thereafter.
If the billing is to start in the future, set this value to false.
Start Date String YYYY/MM/DD format start_date Date of the first future recurring billing transaction. This value must be a date in the future.
If an additional charge is to be made immediately, the start_now argument must be set to true.
Number of Recurs String numeric 1-99 num_recurs The number of times that the transaction must recur.
Period String numeric 1-999 period Number of recur units that must pass between recurring billings.
Recurring Amount String 9-character decimal 0.01-9999999.99. recur_amount Amount of the recurring transaction. This must contain at least three digits, two of which are penny values.
This is the amount that will be billed on the start_date, and then billed repeatedlybased on the interval defined by period and recur_unit.

Convenience Fee Response Fields

Value Limits Get Method Description
Convenience fee success true/false receipt.getCfSuccess(); Indicates whether the Convenience Fee transaction processed successfully.
Convenience fee status 2-character alphanumeric receipt.getCfStatus(); Indicates the status of the merchant and convenience fee transactions. The CfStatus field provides details about the transaction behavior and should be referenced when contacting Moneris Customer Support.
Possible values are:
1 or 1F - Completed 1st purchase transaction
2 or 2F - Completed 2nd purchase transaction
3 - Completed void transaction
4A or 4D - Completed refund transaction
7 or 7F - Completed merchant independent refund transaction
8 or 8F - Completed merchant refund transaction
9 or 9F - Completed 1st void transaction
10 or 10F - Completed 2nd void transaction
11A or 11D - Completed refund transaction
Convenience fee amount 9-character decimal receipt.getFeeAmount(); The expected Convenience Fee amount. This field will return the amount submitted by the merchant for a successful transaction. For an unsuccessful transaction, it will return the expected convenience fee amount.
Convenience fee rate 9-character decimal receipt.getFeeRate(); The convenience fee rate that has been defined on the merchant’s profile. For example:
1.00 - a fixed amount or
10.0 - a percentage amount
Convenience fee type AMT/PCT receipt.getFeeType(); The type of convenience fee that has been defined on the merchant’s profile.
Available options are:
AMT - fixed amount
PCT - percentage

Predecessors
  • NA
Successors

ACH Debit with Vault

Refer to Purchase with Vault and ACH

This transaction uses the data key to identify a previously registered ACH profile. The details saved within the profile are then submitted to perform the transaction.
This transaction is also referred to as Purchase with Vault and ACH.
Recurring Billing allows you to set up payments whereby Moneris automatically processes the transactions and bills customers on your behalf based on the billing cycle information you provide.
In addition to instantiating a transaction object and a connection object (as you would for a normal transaction), you must instantiate a Recur object. This object has a number of mandatory properties that must be set.

Any transaction that supports Recurring Billing has a setRecur method. This is used to write the Recurring Billing information to the transaction object before writing the transaction object to the connection object.

Things to consider:
• To avoid shifting, do not set the start_date after the 28th if the recur_unit is month. To set the billing date for the last day of the month, set recur_unit to eom.

ACH transactions are available to US integrations only.

USA Code Sample

package USA;

import JavaAPI.*;

public class TestUSAResPurchaseAch
{
	public static void main(String args[])
	{

		/********************** Request Variables ****************************/

		String store_id = "monusqa002";
		String api_token = "qatoken";

		/********************** Transaction Variables ************************/

		java.util.Date createDate = new java.util.Date(); 
		String order_id = "Test"+createDate.getTime();
		String data_key = "QMlFZodHBk5K102EKnoyobs1N";
		String cust_id = "Hilton_1";
		String amount = "1.00";
		String processing_country_code = "US";

		/************************ Request Object ******************************/

		ResPurchaseAch resPurchaseAch = new ResPurchaseAch();
		resPurchaseAch.setDataKey(data_key);
		resPurchaseAch.setOrderId(order_id);
		resPurchaseAch.setCustId(cust_id);
		resPurchaseAch.setAmount(amount);
		
		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(resPurchaseAch);
		mpgReq.send();

		/************************ Receipt Object ******************************/

		try
		{
			Receipt receipt = mpgReq.getReceipt();
			
			System.out.println("DataKey = " + receipt.getDataKey());
			System.out.println("ReceiptId = " + receipt.getReceiptId());
			System.out.println("ReferenceNum = " + receipt.getReferenceNum());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("AuthCode = " + receipt.getAuthCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("TransType = " + receipt.getTransType());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TransAmount = " + receipt.getTransAmount());
			System.out.println("CardType = " + receipt.getCardType());
			System.out.println("TxnNumber = " + receipt.getTxnNumber());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("ResSuccess = " + receipt.getResSuccess());
			System.out.println("PaymentType = " + receipt.getPaymentType() + "\n");

			System.out.println("Cust ID = " + receipt.getResCustId());
			System.out.println("Phone = " + receipt.getResPhone());
			System.out.println("Email = " + receipt.getResEmail());
			System.out.println("Note = " + receipt.getResNote());
			System.out.println("Sec = " + receipt.getResSec());
			System.out.println("Cust First Name = " + receipt.getResCustFirstName());
			System.out.println("Cust Last Name = " + receipt.getResCustLastName());
			System.out.println("Cust Address1 = " + receipt.getResCustAddress1());
			System.out.println("Cust Address2 = " + receipt.getResCustAddress2());
			System.out.println("Cust City = " + receipt.getResCustCity());
			System.out.println("Cust State = " + receipt.getResCustState());
			System.out.println("Cust Zip = " + receipt.getResCustZip());
			System.out.println("Routing Num = " + receipt.getResRoutingNum());
			System.out.println("Account Num = " + receipt.getResAccountNum());
			System.out.println("Masked Account Num = " + receipt.getResMaskedAccountNum());
			System.out.println("Check Num = " + receipt.getResCheckNum());
			System.out.println("Account Type = " + receipt.getResAccountType());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}  
}

                

ACH Debit with Vault - Transaction Values

ResPurchaseAch resPurchaseAch = new ResPurchaseAch();

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(resPurchaseAch);

ACH Debit with Vault mandatory values

Value Type Limits Set method Description
Data key String 25-character decimal resPurchaseAch.setData(data_key); The data key is the token that points to a previously stored profile. Profile identifier that all future financial Vault transactions will use to associate with the saved information.
The data key is generated by Moneris, and is returned to the merchant (via the Receipt object) when the profile is first registered.
Order ID String 50-character alphanumeric resPurchaseAch.setOrderId(order_id); Merchant-defined transaction identifier that must be unique for every ACH debit and credit transaction. No two transactions of these types may have the same order ID. For ACH Reversal transactions, the order ID must be the same as that of the original transaction.
Amount String 9-character decimal resPurchaseAch.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.

ACH Debit with Vault optional values

Value Type Limits Set method Decription
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 resPurchaseAch.setCustId(cust_id); This can be used for policy number, membership number, student ID, invoice number.
This field is searchable from the Moneris Merchant Resource Centre.
Customer Information Object CustInfo customer = new CustInfo();
resPurchaseAch.setCustInfo(customer);
Refer below for further breakdown and definition.
Recurring Billing Object Recur recurring_cycle = new Recur(recur_unit, start_now, start_date, num_recurs, period, recur_amount);
resPurchaseAch.setRecur(recurring_cycle);
Refer below for further breakdown and definition.

Vault Response Fields

Value Limits Get Method Description
Data Key 25-character alphanumeric receipt.getDataKey(); This field is created when a profile is created and a token is returned.
It is a unique profile identifier, and is a required value for all future Vault transactions.
Vault Success true/false receipt.getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc/ach receipt.getPaymentType(); Indicates the payment type associated with a Vault profile.
Customer ID 30-character alphanumeric receipt.getResCustId(); Returns the customer ID saved in the profile.
Phone Number 30-character alphanumeric receipt.getResPhone(); Returns the phone number saved in the profile.
Email Address 30-character alphanumeric receipt.getResEmail(); Returns the email address saved in the profile.
Note 30-character alphanumeric receipt.getResNote(); Returns the note saved in the profile.
ACH Fields
SEC Code 3-character alphanumeric receipt.getResSec(); Returns the ACH SEC code saved in the profile.
Customer First Name 50-character alphanumeric receipt.getResCustFirstName(); Returns the customer first name saved in the profile.
Customer Last Name 50-character alphanumeric receipt.getResCustLastName(); Returns the customer last name saved in the profile.
Customer Address 1 50-character alphanumeric receipt.getResCustAddress1(); Returns the customer address line 1 saved in the profile.
Customer Address 2 50-character alphanumeric receipt.getResCustAddress2(); Returns the customer address line 2 saved in the profile.
Customer City 50-character alphanumeric receipt.getResCustCity(); Returns the customer city saved in the profile.
Customer State 2-character alphanumeric receipt.getResCustState(); Returns the customer state code saved in the profile.
Customer Zip Code 10-character numeric receipt.getResCustZip(); Returns the customer zip code saved in the profile.
Check Routing Number 9-character numeric receipt.getResRoutingNum(); Returns the customer check routing number saved in the profile.
Masked Account Number 15-character alphanumeric receipt.getResMaskedAccountNum(); Returns the masked first 4 last 4 of the account number saved in the profile.
Check Number 16-character numeric receipt.getResCheckNum(); Returns the check number saved in the profile.
Account Type savings/checking receipt.getResAccountType(); Returns the type of account saved in the profile.

Predecessors
Successors

ACH Debit with Vault and Customer Information

Refer to Purchase with Vault and ACH

This transaction uses the data key to identify a previously registered ACH profile. The details saved within the profile are then submitted to perform the transaction.

This transaction is also referred to as Purchase with Vault and ACH.

Recurring Billing allows you to set up payments whereby Moneris automatically processes the transactions and bills customers on your behalf based on the billing cycle information you provide.

In addition to instantiating a transaction object and a connection object (as you would for a normal transaction), you must instantiate a Recur object. This object has a number of mandatory properties that must be set.

Any transaction that supports Recurring Billing has a setRecur method. This is used to write the Recurring Billing information to the transaction object before writing the transaction object to the connection object.

Things to consider:

  • To avoid shifting, do not set the start_date after the 28th if the recur_unit is month. To set the billing date for the last day of the month, set recur_unit to eom.

ACH transactions are available to US integrations only.

USA Code Sample

package USA;

import JavaAPI.*;

public class TestUSAResPurchaseAchCustInfo
{
	public static void main(String args[])
	{
		/********************** Request Variables ****************************/

		String store_id = "monusqa002";
		String api_token = "qatoken";

		/********************** Transaction Variables ************************/

		String data_key = "QMlFZodHBk5K102EKnoyobs1N";
		java.util.Date createDate = new java.util.Date();
		String order_id = "Test"+createDate.getTime();
		String cust_id = "Hilton_1";
		String amount = "1.00";
		String processing_country_code = "US";

		/********************* Billing/Shipping Variables ********************/

		String last_name = "Harris";
		String first_name = "Tommie";
		String company_name = "Da Bears";
		String address = "454 Michigan Ave";
		String city = "Chicago";
		String province = "Illinois";
		String zip_code = "99879";
		String country = "USA";
		String phone_number = "764-908-9989";
		String fax = "764-908-9990";
		String tax1 = "1.00";
		String tax2 = "1.00";
		String tax3 = "1.00";
		String shipping_cost = "2.00";

		/************************* Line Item Variables *************************/

		String[] name = new String[]{"Mini Bears Helmet", "Mini Bills Helmet"};
		String[] quantity = new String[]{"1", "2"};
		String[] product_code = new String[] {"BEOOOWS9", "BUFD099D"};
		String[] extended_amount = new String[] {"4.00", "6.00"};

		/************************ Miscellaneous Variables **********************/

		String email = "T.Harris@ChicagoBears.com";
		String instructions = "Must arrive before opening day at Lambeau";

		/*********************** Transaction Object *******************************/

		ResPurchaseAch resPurchaseAch = new ResPurchaseAch();
		resPurchaseAch.setDataKey(data_key);
		resPurchaseAch.setOrderId(order_id);
		resPurchaseAch.setAmount(amount);
		resPurchaseAch.setCustId(cust_id);

		/*********************** Billing/Shipping Object **************************/

		BillingLocation billingAddress =
				new BillingLocation  (last_name, first_name, company_name, address,
						city, province, zip_code, country, phone_number,
						fax, tax1, tax2, tax3, shipping_cost);

		ShippingLocation shippingAddress =
				new ShippingLocation  (last_name, first_name, company_name, address,
						city, province, zip_code, country, phone_number,
						fax, tax1, tax2, tax3, shipping_cost);

		/************************ Line Item Object ************************************/

		Item[] lineItems = new Item[]{new Item(name[0], quantity[0], product_code[0], extended_amount[0]),
				new Item(name[1], quantity[1], product_code[1], extended_amount[1])};


		/************************* Customer Information Object *************************/

		CustomerInfo custData =
				new CustomerInfo (billingAddress, shippingAddress, email, instructions, lineItems);


		resPurchaseAch.setCustInfo (custData);

		/************************ Request Object ******************************/

		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(resPurchaseAch);
		mpgReq.send();

		/************************ Receipt Object ******************************/

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("DataKey = " + receipt.getDataKey());
			System.out.println("ReceiptId = " + receipt.getReceiptId());
			System.out.println("ReferenceNum = " + receipt.getReferenceNum());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("AuthCode = " + receipt.getAuthCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("TransType = " + receipt.getTransType());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TransAmount = " + receipt.getTransAmount());
			System.out.println("CardType = " + receipt.getCardType());
			System.out.println("TxnNumber = " + receipt.getTxnNumber());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("ResSuccess = " + receipt.getResSuccess());
			System.out.println("PaymentType = " + receipt.getPaymentType() + "\n");

			System.out.println("Cust ID = " + receipt.getResCustId());
			System.out.println("Phone = " + receipt.getResPhone());
			System.out.println("Email = " + receipt.getResEmail());
			System.out.println("Note = " + receipt.getResNote());
			System.out.println("Sec = " + receipt.getResSec());
			System.out.println("Cust First Name = " + receipt.getResCustFirstName());
			System.out.println("Cust Last Name = " + receipt.getResCustLastName());
			System.out.println("Cust Address1 = " + receipt.getResCustAddress1());
			System.out.println("Cust Address2 = " + receipt.getResCustAddress2());
			System.out.println("Cust City = " + receipt.getResCustCity());
			System.out.println("Cust State = " + receipt.getResCustState());
			System.out.println("Cust Zip = " + receipt.getResCustZip());
			System.out.println("Routing Num = " + receipt.getResRoutingNum());
			System.out.println("Account Num = " + receipt.getResAccountNum());
			System.out.println("Masked Account Num = " + receipt.getResMaskedAccountNum());
			System.out.println("Check Num = " + receipt.getResCheckNum());
			System.out.println("Account Type = " + receipt.getResAccountType());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}  
}

                

ACH Debit with Vault - Transaction Values

ResPurchaseAch resPurchaseAch = new ResPurchaseAch();

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(resPurchaseAch);

ACH Debit with Vault and Customer Information mandatory values

Value Type Limits Set method Description
Data key String 25-character decimal resPurchaseAch.setData(data_key); The data key is the token that points to a previously stored profile. Profile identifier that all future financial Vault transactions will use to associate with the saved information.
The data key is generated by Moneris, and is returned to the merchant (via the Receipt object) when the profile is first registered.
Order ID String 50-character alphanumeric resPurchaseAch.setOrderId(order_id); Merchant-defined transaction identifier that must be unique for every ACH debit and credit transaction. No two transactions of these types may have the same order ID. For ACH Reversal transactions, the order ID must be the same as that of the original transaction.
Amount String 9-character decimal resPurchaseAch.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.

ACH Debit with Vault and Customer Information optional values

Value Type Limits Set method Decription
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 resPurchaseAch.setCustId(cust_id); This can be used for policy number, membership number, student ID, invoice number.
This field is searchable from the Moneris Merchant Resource Centre.
Customer Information Object CustInfo customer = new CustInfo();
resPurchaseAch.setCustInfo(customer);
Refer below for further breakdown and definition.
Recurring Billing Object Recur recurring_cycle = new Recur(recur_unit, start_now, start_date, num_recurs, period, recur_amount);
resPurchaseAch.setRecur(recurring_cycle);
Refer below for further breakdown and definition.

CustInfo object mandatory properties

Value Type Limits Set method Decription
Email Address String 60-character alphanumeric customer.setEmail("nick@widget.com"); Customer email address.
Instructions String 100-character alphanumeric customer.setInstructions("Rush!"); Instructions or notes.
Billing Information Object Option 1:
customer.setBilling(first_name, last_name, company_name, address, city, province, postal_code, country, phone, fax, tax1, tax2, tax3, shipping_cost);

Option 2:
customer.setBilling(billing_hash);
Billing information is stored as part of the CustInfo object. A maximum of 1 billing object may be set. They can be written to the object in one of two ways:
  • Using set methods
  • Using hash tables.
Refer below for further breakdown and definition.
Shipping Information Object Option 1:
customer.setShipping(first_name, last_name, company_name, address, city, province, postal_code, country, phone, fax, tax1, tax2, tax3, shipping_cost);

Option 2:
customer.setShipping(shipping_hash);
Shipping information is stored as part of the CustInfo object. A maximum of 1 shipping object may be set. They can be written to the object in one of two ways:
  • Using set methods
  • Using hash tables.
Refer below for further breakdown and definition.
Items Array Object Option 1:
customer.setItem(item_description[0], item_quantity[0], item_product_code[0], item_extended_amount[0]);

Option 2:
Customer.setItem(item_hash);
Item information is stored as part of the CustInfo object. Multiple items may be set. They can be written to the object in one of two ways:
  • Using set methods
  • Using hash tables.
Refer below for further breakdown and definition.

Setting Billing & Shipping using Set Methods

The billing information and the shipping information for a given CustInfo object are written by using the customer.setBilling() and customer.setShipping() methods respectively:

customer.setBilling(first_name, last_name, company_name, address, city, province, postal_code, country, phone, fax, tax1, tax2, tax3, shipping_cost);

customer.setShipping(first_name, last_name, company_name, address, city, province, postal_code, country, phone, fax, tax1, tax2, tax3, shipping_cost);

Both of these methods have the same set of mandatory arguments.

Setting Billing & Shipping using Hash Tables

Writing billing or shipping information using hash tables is done as follows:

  1. Instantiate a CustInfo object.
  2. Instantiate a Hashtable object. (The sample code uses a different hash table for billing and shipping for clarity purposes. However, the skillful developer can re-use the same one.)
  3. Build the hashtable using put methods with the hash table keys in the table below.
  4. Call the CustInfo object's setBilling()/setShipping() method to pass the hashtable information to the CustInfo object
  5. Call the transaction object's setCustInfo() method to write the CustInfo object (with the billing/shipping information to the transaction object.

Billing & Shipping mandatory values

Value Type Limits Variable/Hash Table Key Description
First Name String 30-character alphanumeric "first_name" Customer first name
Last Name String 30-character alphanumeric "last_name" Customer last name
Company Name String 50-character alphanumeric "company_name" Customer 's company name
Address String 70-character alphanumeric "address" Customer's address
City String 30-character alphanumeric "city" Customer's city
Province / State String 30-character alphanumeric "province" Customer's province or state
Postal / Zip Code String 30-character alphanumeric "postal_code" Customer's postal or zip code
Country String 30-character alphanumeric "country" Customer's country
Phone Number String 30-character alphanumeric "phone" Customer's phone number
Fax Number String 30-character alphanumeric fax" Customer's fax number
Federal Tax String 10-character alphanumeric "tax1" Federal tax amount. Amount is not used for calculating total amount.
Provincial / State Tax String 10-character alphanumeric "tax2" Provincial or state tax amount. Amount is not used for calculating total amount.
Country / Local / Specialty Tax String 10-character alphanumeric "tax3" County, local or specialty tax amount. Amount is not used for calculating total amount.
Shipping Cost String 10-character alphanumeric "shipping_cost" Shipping cost. Amount is not used for calculating total amount.

Setting Items using Set Methods

All the item information in the table below is written to the CustInfo object in one instruction for a given item. Multiples items may be set. Such as:

customer.setItem(item_description, item_quantity, item_product_code, item_extended_amount);

Setting Items using Hash Tables

Writing item information using hash tables is done as follows:

  1. Instantiate a CustInfo object.
  2. Instantiate a Hashtable object. (The sample code uses a different hash table for each item for clarity purposes. However, the skillful developer can re-use the same one.)
  3. Build the hashtable using put methods with the hash table keys in the table below.
  4. Call the CustInfo object's setItem() method to pass the hashtable information to the CustInfo object
  5. Call the transaction object's setCustInfo() method to write the CustInfo object (with the item information to the transaction object.

Item mandatory values

Value Type Limits Variable/Hash Table Key Description
Item Name String 45-character alphanumeric "name" Item name or description.
Item Quantity String 5-character numeric "quantity" You must send a quantity > 0 or the item will not be added to the item list (i.e. minimum 1, maximum 99999)
Item Product Code String 20-character alphanumeric "product_code" Item product code or SKU.
Item Extended Amount String 9-character decimal "extended_amount" Must contain at least 3 digits and 2 penny values.
0.01-999999.99

Vault Response Fields

Value Limits Get Method Description
Data Key 25-character alphanumeric receipt.getDataKey(); This field is created when a profile is created and a token is returned.
It is a unique profile identifier, and is a required value for all future Vault transactions.
Vault Success true/false receipt.getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc/ach receipt.getPaymentType(); Indicates the payment type associated with a Vault profile.
Customer ID 30-character alphanumeric receipt.getResCustId(); Returns the customer ID saved in the profile.
Phone Number 30-character alphanumeric receipt.getResPhone(); Returns the phone number saved in the profile.
Email Address 30-character alphanumeric receipt.getResEmail(); Returns the email address saved in the profile.
Note 30-character alphanumeric receipt.getResNote(); Returns the note saved in the profile.
ACH Fields
SEC Code 3-character alphanumeric receipt.getResSec(); Returns the ACH SEC code saved in the profile.
Customer First Name 50-character alphanumeric receipt.getResCustFirstName(); Returns the customer first name saved in the profile.
Customer Last Name 50-character alphanumeric receipt.getResCustLastName(); Returns the customer last name saved in the profile.
Customer Address 1 50-character alphanumeric receipt.getResCustAddress1(); Returns the customer address line 1 saved in the profile.
Customer Address 2 50-character alphanumeric receipt.getResCustAddress2(); Returns the customer address line 2 saved in the profile.
Customer City 50-character alphanumeric receipt.getResCustCity(); Returns the customer city saved in the profile.
Customer State 2-character alphanumeric receipt.getResCustState(); Returns the customer state code saved in the profile.
Customer Zip Code 10-character numeric receipt.getResCustZip(); Returns the customer zip code saved in the profile.
Check Routing Number 9-character numeric receipt.getResRoutingNum(); Returns the customer check routing number saved in the profile.
Masked Account Number 15-character alphanumeric receipt.getResMaskedAccountNum(); Returns the masked first 4 last 4 of the account number saved in the profile.
Check Number 16-character numeric receipt.getResCheckNum(); Returns the check number saved in the profile.
Account Type savings/checking receipt.getResAccountType(); Returns the type of account saved in the profile.

Predecessors
Successors

ACH Debit with Vault and Recurring Billing

Refer to Purchase with Vault and ACH

This transaction uses the data key to identify a previously registered ACH profile. The details saved within the profile are then submitted to perform the transaction.

This transaction is also referred to as Purchase with Vault and ACH.

Recurring Billing allows you to set up payments whereby Moneris automatically processes the transactions and bills customers on your behalf based on the billing cycle information you provide.

In addition to instantiating a transaction object and a connection object (as you would for a normal transaction), you must instantiate a Recur object. This object has a number of mandatory properties that must be set.

Any transaction that supports Recurring Billing has a setRecur method. This is used to write the Recurring Billing information to the transaction object before writing the transaction object to the connection object.

 

Things to consider:

  • To avoid shifting, do not set the start_date after the 28th if the recur_unit is month. To set the billing date for the last day of the month, set recur_unit to eom.

ACH transactions are available to US integrations only.

USA Code Sample

package USA;

import JavaAPI.*;

public class TestUSAResPurchaseAchRecur
{
	public static void main(String args[])
	{

		/********************** Request Variables ****************************/

		String store_id = "monusqa002";
		String api_token = "qatoken";

		/********************** Transaction Variables ************************/

		String data_key = "QMlFZodHBk5K102EKnoyobs1N";
		java.util.Date createDate = new java.util.Date();
		String order_id = "Test"+createDate.getTime();
		String cust_id = "Hilton_1";
		String amount = "1.00";
		String processing_country_code = "US";

		/*********************** Recur Varables ******************************/

		String recur_unit = "month";
		String start_now = "true";
		String start_date = "2019/12/12";
		String num_recurs = "12";
		String period = "1";
		String recur_amount = "1.00";

		/************************** Recur Object ******************************/

		Recur monthlyPayment = new Recur (recur_unit, start_now, start_date,
				num_recurs, period, recur_amount);

		/************************ Request Object ******************************/

		ResPurchaseAch resPurchaseAch = new ResPurchaseAch();
		resPurchaseAch.setDataKey(data_key);
		resPurchaseAch.setOrderId(order_id);
		resPurchaseAch.setCustId(cust_id);
		resPurchaseAch.setAmount(amount);
		resPurchaseAch.setRecur(monthlyPayment);

		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(resPurchaseAch);
		mpgReq.send();

		/************************ Receipt Object ******************************/

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("DataKey = " + receipt.getDataKey());
			System.out.println("ReceiptId = " + receipt.getReceiptId());
			System.out.println("ReferenceNum = " + receipt.getReferenceNum());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("AuthCode = " + receipt.getAuthCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("TransType = " + receipt.getTransType());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TransAmount = " + receipt.getTransAmount());
			System.out.println("CardType = " + receipt.getCardType());
			System.out.println("TxnNumber = " + receipt.getTxnNumber());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("RecurSuccess = " + receipt.getRecurSuccess());
			System.out.println("ResSuccess = " + receipt.getResSuccess());
			System.out.println("PaymentType = " + receipt.getPaymentType() + "\n");

			System.out.println("Cust ID = " + receipt.getResCustId());
			System.out.println("Phone = " + receipt.getResPhone());
			System.out.println("Email = " + receipt.getResEmail());
			System.out.println("Note = " + receipt.getResNote());
			System.out.println("Sec = " + receipt.getResSec());
			System.out.println("Cust First Name = " + receipt.getResCustFirstName());
			System.out.println("Cust Last Name = " + receipt.getResCustLastName());
			System.out.println("Cust Address1 = " + receipt.getResCustAddress1());
			System.out.println("Cust Address2 = " + receipt.getResCustAddress2());
			System.out.println("Cust City = " + receipt.getResCustCity());
			System.out.println("Cust State = " + receipt.getResCustState());
			System.out.println("Cust Zip = " + receipt.getResCustZip());
			System.out.println("Routing Num = " + receipt.getResRoutingNum());
			System.out.println("Account Num = " + receipt.getResAccountNum());
			System.out.println("Masked Account Num = " + receipt.getResMaskedAccountNum());
			System.out.println("Check Num = " + receipt.getResCheckNum());
			System.out.println("Account Type = " + receipt.getResAccountType());	
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}  
}

                

ACH Debit with Vault - Transaction Values

ResPurchaseAch resPurchaseAch = new ResPurchaseAch();

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(resPurchaseAch);

ACH Debit with Vault and Recurring Billing mandatory values

Value Type Limits Set method Description
Data key String 25-character decimal resPurchaseAch.setData(data_key); The data key is the token that points to a previously stored profile. Profile identifier that all future financial Vault transactions will use to associate with the saved information.
The data key is generated by Moneris, and is returned to the merchant (via the Receipt object) when the profile is first registered.
Order ID String 50-character alphanumeric resPurchaseAch.setOrderId(order_id); Merchant-defined transaction identifier that must be unique for every ACH debit and credit transaction. No two transactions of these types may have the same order ID. For ACH Reversal transactions, the order ID must be the same as that of the original transaction.
Amount String 9-character decimal resPurchaseAch.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.

ACH Debit with Vault and Recurring Billing optional values

Value Type Limits Set method Decription
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 resPurchaseAch.setCustId(cust_id); This can be used for policy number, membership number, student ID, invoice number.
This field is searchable from the Moneris Merchant Resource Centre.
Customer Information Object CustInfo customer = new CustInfo();
resPurchaseAch.setCustInfo(customer);
Refer below for further breakdown and definition.
Recurring Billing Object Recur recurring_cycle = new Recur(recur_unit, start_now, start_date, num_recurs, period, recur_amount);
resPurchaseAch.setRecur(recurring_cycle);
Refer below for further breakdown and definition.

Recurring object mandatory values
Value Type Limits Argument name in example Description
Recur unit String day, week, month or eom recur_unit Unit to be used as a basis for the interval. This can be set as day, week, month or the end of the month.
Works in conjunction with the period argument (see below) to define the billing frequency.
Start Now String true/false start_now IIf a single charge is to be made against the card immediately, set this value to true. The amount to be billed immediately may differ from the amount billed on a regular basis thereafter.
If the billing is to start in the future, set this value to false.
Start Date String YYYY/MM/DD format start_date Date of the first future recurring billing transaction. This value must be a date in the future.
If an additional charge is to be made immediately, the start_now argument must be set to true.
Number of Recurs String numeric 1-99 num_recurs The number of times that the transaction must recur.
Period String numeric 1-999 period Number of recur units that must pass between recurring billings.
Recurring Amount String 9-character decimal 0.01-9999999.99. recur_amount Amount of the recurring transaction. This must contain at least three digits, two of which are penny values.
This is the amount that will be billed on the start_date, and then billed repeatedlybased on the interval defined by period and recur_unit.

Recurring Billing Response Fields

Value Limits Get Method Description
Recurring billing success true/false receipt.getRecurSuccess(); Indicates whether the recurring billing transaction has been successfully set up for future billing.

Vault Response Fields

Value Limits Get Method Description
Data Key 25-character alphanumeric receipt.getDataKey(); This field is created when a profile is created and a token is returned.
It is a unique profile identifier, and is a required value for all future Vault transactions.
Vault Success true/false receipt.getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc/ach receipt.getPaymentType(); Indicates the payment type associated with a Vault profile.
Customer ID 30-character alphanumeric receipt.getResCustId(); Returns the customer ID saved in the profile.
Phone Number 30-character alphanumeric receipt.getResPhone(); Returns the phone number saved in the profile.
Email Address 30-character alphanumeric receipt.getResEmail(); Returns the email address saved in the profile.
Note 30-character alphanumeric receipt.getResNote(); Returns the note saved in the profile.
ACH Fields
SEC Code 3-character alphanumeric receipt.getResSec(); Returns the ACH SEC code saved in the profile.
Customer First Name 50-character alphanumeric receipt.getResCustFirstName(); Returns the customer first name saved in the profile.
Customer Last Name 50-character alphanumeric receipt.getResCustLastName(); Returns the customer last name saved in the profile.
Customer Address 1 50-character alphanumeric receipt.getResCustAddress1(); Returns the customer address line 1 saved in the profile.
Customer Address 2 50-character alphanumeric receipt.getResCustAddress2(); Returns the customer address line 2 saved in the profile.
Customer City 50-character alphanumeric receipt.getResCustCity(); Returns the customer city saved in the profile.
Customer State 2-character alphanumeric receipt.getResCustState(); Returns the customer state code saved in the profile.
Customer Zip Code 10-character numeric receipt.getResCustZip(); Returns the customer zip code saved in the profile.
Check Routing Number 9-character numeric receipt.getResRoutingNum(); Returns the customer check routing number saved in the profile.
Masked Account Number 15-character alphanumeric receipt.getResMaskedAccountNum(); Returns the masked first 4 last 4 of the account number saved in the profile.
Check Number 16-character numeric receipt.getResCheckNum(); Returns the check number saved in the profile.
Account Type savings/checking receipt.getResAccountType(); Returns the type of account saved in the profile.

Predecessors
Successors

ACH Credit

Verifies and collects the customer’s bank account information, and transfers merchant funds directly to the customer.

ACH transactions are available to US integrations only.

USA Code Sample

package USA;

import JavaAPI.*;

public class TestUSAACHCredit
{
	public static void main(String[] args)
	{
		java.util.Date createDate = new java.util.Date();
		String order_id = "Test"+createDate.getTime();
		String store_id = "monusqa002";
		String api_token = "qatoken";
		String amount = "1.00";

		//ACHInfo Variables
		String sec = "ppd";
		String cust_first_name = "Christian";
		String cust_last_name = "M";
		String cust_address1 = "3300 Bloor St W";
		String cust_address2 = "4th floor west tower";
		String cust_city = "Toronto";
		String cust_state = "ON";
		String cust_zip = "M1M1M1";
		String routing_num = "011000015";
		String account_num = "12345678946";
		String check_num = "11";
		String account_type = "checking";
		String micr = "t071000013t742941347o129";
		String dl_num = "CO-12312312";
		String magstripe = "no";
		String image_front = "SUkqAG4AAABUMDcxMDAwMDEzVDc0Mjk0MTM0N0E5OTkwAE1hZ1RlaywgSW5jLgAATUlDUkltYWdlIFJTMjMyIChBMDM3Nkw0KQBWZXJzaW9uIE1JMS4wNi4yMk0AAMgAAAABAAAAyAAAAAEAAAASAP4AAwABAAAAAAAAAAABAwABAAAAuAQAAAEBAwABAAAAIAIAAAMBAwABAAAABAAAAAYBAwABAAAAAAAAAAoBAwABAAAAAQAAAA4BAgAaAAAACAAAAA8BAgANAAAAIgAAABABAgAaAAAAMAAAABEBBAABAAAATAEAABIBAwABAAAAAQAAABYBAwABAAAAIAIAABcBBAABAAAABBkAABoBBQABAAAAXgAAABsBBQABAAAAZgAAACUBBAABAAAAAAAAACgBAwABAAAAAgAAADEBAgATAAAASgAAAAAAAADyzmjrhUtcm5jlktYIh9iOwRBvsNMgrIbcwCIOFTTQhpyuZxkscF8kGzIRQeyoI4KnyrawnCDkEtw36eXWGVOkJJS2rmSU7hFEecEX/H0idl8johYJUlbhkKOm50xGGdkm4ZUcguyvSQSHCc64LGXAZFDhzsSS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mEiglJsLaBEeOcUg4xH//OwyKA5KjOoU6CnQOQw5rM1hDIpDlBlWFNAXJzKsyMEOlUJkMPhBggaDCa2RAqa+umgyDBCLA5QC/VdU1v1/9P7KcaeTguaA/mo75dHcubRdOVD5GPyNuY/wf1/TncfQf0E8yNB6DbvwQP/7lXcvty6ZqdOEHrs3Q/10/h80Pr3/a+nP5i6feY+ZG//////f//v/3/117f/pr////////X/v+vj/7+//+0P//79f//vXx/f//qh9fr8a+vr//66rr/6eC4XW/1f/v6+/gv//+awuEsqwsflOFwT/tVW/6+v+//w+F/8PCC8PHHr/+En//6DfhcE+negvH477u8JEJ9/u90Qox35wpjHOEiFEXOEGrcgYynHf////+v7X/3/93Igv54tf/v//PFxXx/H///X////9Pv//1//3/69fr/7+H//3f79/33/6+uVA/IgtSMH76r8e1+11tJtdQwve/98R//x/FRxx5IBx/kKI6kME//Xte7TTC///X/4ZeI4tphewmmmna3qqpr/9iKiIiIiIiGhEREREafaiItAyKb1CP//8tQRwiLZ3IOOXZMcm5Mc7nwhXPBbludzjl2THJwQg5CQScmOdyEU0d0EJ3M4gi+juJTiU4+dzY0CBCCBC4giPo74KVYIIS7aCBOCBCkRx4eCI5ghQxvEOGRz7a8UmNMKnFMYYwloLh3pKCY1Y4gi704iWOOCI4EdUGwyOMvzw9E3hHHBQy7ljhl/hSrO+VhQ6TMMuyOsRKgRFCxBAhBEfhxEqBCI5xTEER/qI2IRHP1ERERERFhCIie2EIqIj6+uvr6gAwAYAMAA==";
		String image_back = "SUkqAGoAAAA/Pz8wPz8/Pz8/MD8/Pz8/Pz8/Pz80Pz8/MD8ATWFnVGVrLCBJbmMuAABNSUNSSW1hZ2UgUlMyMzIgKCBBMDRXNFc1KQAATUkxLjA3LjI0TQAAyAAAAAEAAADIAAAAAQAAABIA/gADAAEAAAAAAAAAAAEDAAEAAADgBAAAAQEDAAEAAAAjAgAAAwEDAAEAAAAEAAAABgEDAAEAAAAAAAAACgEDAAEAAAABAAAADgECABwAAAAIAA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aP56NOxI YgRnmIjhMEKBAh5TUfMBy8R0InMHCCMbDhl8jhriIiIjhzDlDnsq2ECxBCIjkK1Q6pi8xWYBcj5vHdoRBiIjiJ2sLD//////9f////3/ABABAA==";
		String processing_country_code = "US";
		boolean status_check = false;
		String cust_id = "customer1";

		ACHInfo achinfo = new ACHInfo(sec, cust_first_name, cust_last_name,
				cust_address1, cust_address2, cust_city, cust_state, cust_zip,
				routing_num, account_num, check_num, account_type, micr);

		//achinfo.setImgFront(image_front);
	//	achinfo.setImgBack(image_back);
		achinfo.setDlNum(dl_num);
		achinfo.setMagstripe(magstripe);

		ACHCredit achcredit = new ACHCredit();
		achcredit.setOrderId(order_id);
		achcredit.setAmount(amount);
		achcredit.setAchInfo(achinfo);
		achcredit.setCustId(cust_id);

		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(achcredit);
		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("Message = " + receipt.getMessage());
			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();
		}
	}
}

                

ACH Credit transaction object definition

ACHCredit achcredit = new ACHCredit();

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(achcredit);

ACH Credit transaction object mandatory values

Value Type Limits Set method Description
Order ID String 50-character alphanumeric achcredit.setOrderId(order_id); Merchant-defined transaction identifier that must be unique for every ACH debit and credit transaction. No two transactions of these types may have the same order ID. For ACH Reversal transactions, the order ID must be the same as that of the original transaction.
Amount String 9-character decimal achcredit.setAmount(amount); Transaction amount. Used in a number of transactions. Note that this is different from the amount used in a Completion transaction, which is an alphanumeric value.

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 999 999.99. Transaction amounts of $0.00 are not allowed.
ACH Info Object ACHInfo achinfo = new ACHInfo(sec, cust_first_name, cust_last_name, cust_address1, cust_address2, cust_city, cust_state, cust_zip, routing_num, account_num, check_num, account_type, micr);
achcredit.setAchInfo(achinfo);achcredit.setAchInfo(achinfo);
Refer below for further breakdown and definition.

ACH Credit transaction object optional values

Value Type Limits Set method Description
Customer ID String 50-character alphanumeric achcredit.setCustId(cust_id); 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.
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.

ACH Info Mandatory Values

VALUE TYPE LIMITS VARIABLE DESCRIPTION
SEC code String ppd/ccd/web sec ACH sec Code: 
The following sec codes apply 
ppd - Prearranged Payment and Deposit 
ccd - Cash Concentration or Disbursement 
web - Internet Initiated Entry 
Routing Number String 9-character numeric routing_num The first number in the MICR, or magnetic ink character recognition, line at the bottom of a check is the bank's check routing number. It is exactly nine digits long and always starts with 0, 1, 2 or 3.
Account Number String 15-character alphanumeric account_num The account number may appear before or after the check number in the check's MICR line at the bottom of the check. The length of the account number varies with a maximum length of 50 digits.
Account Type String savings/checking account_type Identifies the type of bank account. The account type must be submitted as either ‘savings’ or ‘checking’. This field is case sensitive.

ACH Info Optional Values

VALUE TYPE LIMITS VARIABLE DESCRIPTION
Customer First Name String 50 – character alphanumeric cust_first_name Account holder’s first name.
Customer Last Name String 50 – character alphanumeric cust_last_name Account holder’s last name.
Customer Address 1 String 50 – character alphanumeric cust_address1 Account holder’s address line 1.
Customer Address 2 String 50 – character alphanumeric cust_address2 Account holder’s address line 2.
Customer City String 50 – character alphanumeric cust_city Account holder’s city.
Customer State String 2 – character alphanumeric cust_state The state must be submitted as exactly 2 characters (ex. MI – Michigan)
Customer Zip Code String 10-character numeric cust_zip Account holder’s zip code.
Check Number String 16-character numeric check_num The sequential number for checks appears in both the MICR line at the bottom of the check and the upper right corner of the check. The check number length may vary; the maximum length is 16 digits.
 

Predecessors
  • NA
Successors
  • NA

ACH Credit with Vault

Refer to Independent Refund with Vault and ACH

This transaction uses the data key to identify a previously registered ACH profile. The details saved within the profile are then submitted to perform the transaction.

This transaction is processed as an ACH Credit. The ACH Info registered for this profile will be used. The details submitted within ACHInfo object are returned in the response.

The transaction is also referred to as Independent Refund with Vault and ACH.

ACH transactions are available to US integrations only.

USA Code Sample

package USA;

import JavaAPI.*;

public class TestUSAResIndRefundAch
{
	public static void main(String[] args)
	{
		java.util.Date createDate = new java.util.Date(); 
		String order_id = "Test"+createDate.getTime(); 
		String store_id = "monusqa002";
		String api_token = "qatoken";
		String data_key = "hYa5CcGERZkfzzWReCAlXzB0e";
		String amount = "1.00";
		String cust_id = "customer1";
		String processing_country_code = "US";

		ResIndRefundAch resIndRefundAch = new ResIndRefundAch();
		resIndRefundAch.setOrderId(order_id);
		resIndRefundAch.setCustId(cust_id);
		resIndRefundAch.setAmount(amount);
		resIndRefundAch.setData(data_key);

		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(resIndRefundAch);
		mpgReq.send();

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("DataKey = " + receipt.getDataKey());
			System.out.println("ReceiptId = " + receipt.getReceiptId());
			System.out.println("ReferenceNum = " + receipt.getReferenceNum());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("AuthCode = " + receipt.getAuthCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("TransType = " + receipt.getTransType());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TransAmount = " + receipt.getTransAmount());
			System.out.println("CardType = " + receipt.getCardType());
			System.out.println("TxnNumber = " + receipt.getTxnNumber());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("ResSuccess = " + receipt.getResSuccess());
			System.out.println("PaymentType = " + receipt.getPaymentType()); 
			System.out.println("Cust ID = " + receipt.getResCustId());
			System.out.println("Phone = " + receipt.getResPhone());
			System.out.println("Email = " + receipt.getResEmail());
			System.out.println("Note = " + receipt.getResNote());
			System.out.println("Sec = " + receipt.getResSec());
			System.out.println("Cust First Name = " + receipt.getResCustFirstName());
			System.out.println("Cust Last Name = " + receipt.getResCustLastName());
			System.out.println("Cust Address 1 = " + receipt.getResCustAddress1());
			System.out.println("Cust Address 2 = " + receipt.getResCustAddress2());
			System.out.println("Cust City = " + receipt.getResCustCity());
			System.out.println("Cust State = " + receipt.getResCustState());
			System.out.println("Cust Zip = " + receipt.getResCustZip());
			System.out.println("Routing Num = " + receipt.getResRoutingNum());
			System.out.println("Masked Account Num = " + receipt.getResMaskedAccountNum());
			System.out.println("Check Num = " + receipt.getResCheckNum());
			System.out.println("Account Type = " + receipt.getResAccountType());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

                

ACH Credit with Vault transaction object definition

ResIndRefundAch resIndRefundAch = new ResIndRefundAch();

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(resIndRefundAch);

ACH Credit with Vault transaction object mandatory values

Value Type Limits Set method Description
Data key String 25-character alphanumeric resIndRefundAch.setData(data_key); Profile identifier that all future financial Vault transactions (that is, they occur after the profile was registered by a ResAddCC or ResTokenizeCC transaction) will use to associate with the saved information.

The data key is generated by Moneris, and is returned to the merchant (via the Receipt object) when the profile is first registered.
Order ID String 50-character alphanumeric resIndRefundAch.setOrderId(order_id); Merchant-defined transaction identifier that must be unique for every ACH debit and credit transaction. No two transactions of these types may have the same order ID. For ACH Reversal transactions, the order ID must be the same as that of the original transaction.
Amount String 9-character decimal resIndRefundAch.setAmount(amount); Transaction amount. Used in a number of transactions. Note that this is different from the amount used in a Completion transaction, which is an alphanumeric value.

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 999 999.99. Transaction amounts of $0.00 are not allowed.

ACH Credit with Vault optional values

Value Type Limits Set method Description
Customer ID String 50-character alphanumeric resIndRefundAch.setCustId(cust_id); 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.
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.

Vault Response Fields

Value Limits Get Method Description
Data Key 25-character alphanumeric receipt.getDataKey(); This field is created when a profile is created and a token is returned.
It is a unique profile identifier, and is a required value for all future Vault transactions.
Vault Success true/false receipt.getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc/ach receipt.getPaymentType(); Indicates the payment type associated with a Vault profile.
Customer ID 30-character alphanumeric receipt.getResCustId(); Returns the customer ID saved in the profile.
Phone Number 30-character alphanumeric receipt.getResPhone(); Returns the phone number saved in the profile.
Email Address 30-character alphanumeric receipt.getResEmail(); Returns the email address saved in the profile.
Note 30-character alphanumeric receipt.getResNote(); Returns the note saved in the profile.
ACH Fields
SEC Code 3-character alphanumeric receipt.getResSec(); Returns the ACH SEC code saved in the profile.
Customer First Name 50-character alphanumeric receipt.getResCustFirstName(); Returns the customer first name saved in the profile.
Customer Last Name 50-character alphanumeric receipt.getResCustLastName(); Returns the customer last name saved in the profile.
Customer Address 1 50-character alphanumeric receipt.getResCustAddress1(); Returns the customer address line 1 saved in the profile.
Customer Address 2 50-character alphanumeric receipt.getResCustAddress2(); Returns the customer address line 2 saved in the profile.
Customer City 50-character alphanumeric receipt.getResCustCity(); Returns the customer city saved in the profile.
Customer State 2-character alphanumeric receipt.getResCustState(); Returns the customer state code saved in the profile.
Customer Zip Code 10-character numeric receipt.getResCustZip(); Returns the customer zip code saved in the profile.
Check Routing Number 9-character numeric receipt.getResRoutingNum(); Returns the customer check routing number saved in the profile.
Masked Account Number 15-character alphanumeric receipt.getResMaskedAccountNum(); Returns the masked first 4 last 4 of the account number saved in the profile.
Check Number 16-character numeric receipt.getResCheckNum(); Returns the check number saved in the profile.
Account Type savings/checking receipt.getResAccountType(); Returns the type of account saved in the profile.

Predecessors
Successors

ACH Reversal

Refunds the full amount of an ACH Debit transaction.

This transaction can only be performed against an ACH Debit transaction that was performed within the last 3 months.

ACH transactions are available to US integrations only.

USA Code Sample

package USA;

import JavaAPI.*;

public class TestUSAACHReversal
{
	public static void main(String[] args)
	{
		String order_id = "Test1432136975473";
		String txn_number = "43592-0_25";          
		String store_id = "monusqa002";
		String api_token = "qatoken";
		String processing_country_code = "US";
		boolean status_check = false;

		ACHReversal achreversal = new ACHReversal();
		achreversal.setOrderId(order_id);
		achreversal.setTxnNumber(txn_number);

		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(achreversal);
		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("Message = " + receipt.getMessage());
			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();
		}
	}
}

                

ACH Reversal transaction object definition

ACHReversal achreversal = new ACHReversal();

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(achreversal);

ACH Reversal transaction object mandatory values

Value Type Limits Set method Description
Order ID String 50-character alphanumeric achreversal.setOrderId(order_id); Merchant-defined transaction identifier that must be unique for every ACH debit and credit transaction. No two transactions of these types may have the same order ID. For ACH Reversal transactions, the order ID must be the same as that of the original transaction.
Transaction number String 255-character variable achreversal.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.

ACH Reversal 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. 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.

Predecessors
Successors
  • NA

ACH Financial Inquiry

Verifies which financial institution a routing number belongs to.

Can also be used to verify whether the routing number is valid before submitting an ACH Debit transaction or an ACH Credit transaction.

ACH transactions are available to US integrations only.

USA Code Sample

package USA;

import JavaAPI.*;

public class TestUSAACHFiInquiry
{
	public static void main(String[] args)
	{
		String store_id = "monusqa002";
		String api_token = "qatoken";
		String routing_num = "071000013";
		String processing_country_code = "US";
		boolean status_check = false;

		ACHFiInquiry achfiinquiry = new ACHFiInquiry();
		achfiinquiry.setRoutingNum(routing_num);

		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(achfiinquiry);
		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("Message = " + receipt.getMessage());
			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());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

                

ACH Financial Inquiry transaction object definition

ACHFiInquiry achfiinquiry = new ACHFiInquiry();

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(achfiinquiry);

ACH Financial Inquiry transaction object mandatory values

Value Type Limits Set method Description
Routing number String 9-character numeric achfiinquiry.setRoutingNum(routing_num); The first number in the MICR, or magnetic ink character recognition, line at the bottom of a check is the bank's check routing number. It is exactly nine digits long and always starts with 0, 1, 2 or 3

Predecessors
  • NA
Successors