My Profile_


Transaction Flow for Non-Level 2/3 Transaction

Purchase

The purchase transaction verifies funds on the customer’s card, removes the funds and readies them for deposit into the merchant account.

Canada Code Sample

namespace Moneris
{
    using System;
	public class TestPurchase
	{
	  public static void Main(string[] args)
	  {
	        string host = ‘esqa.moneris.com’;
	        string store_id = ‘store1’;
	        string api_token = ‘yesguy’;
	        string order_id = ‘order_id_123’;
	        string amount = ‘4.00’;
	        string card = ‘5454545454545454’;
	        string exp = ‘1111’;
	        string crypt = ‘7’;
	
	        HttpsPostRequest mpgReq =
	            new HttpsPostRequest(host, store_id, api_token,
	                       new Purchase(order_id, amount, card, exp, crypt));
	
	        try
	        {
	            Receipt receipt = mpgReq.GetReceipt();
	
	    		Console.WriteLine("CardType = " + receipt.GetCardType());
	    		Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
	    		Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
	    		Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
	    		Console.WriteLine("TransType = " + receipt.GetTransType());
	    		Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
	    		Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
	    		Console.WriteLine("ISO = " + receipt.GetISO());
	    		Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
	    		Console.WriteLine("Message = " + receipt.GetMessage());
	    		Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
	    		Console.WriteLine("Complete = " + receipt.GetComplete());
	    		Console.WriteLine("TransDate = " + receipt.GetTransDate());
	    		Console.WriteLine("TransTime = " + receipt.GetTransTime());
	    		Console.WriteLine("Ticket = " + receipt.GetTicket());
	    		Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
	
	        }
	        catch (Exception e)
	        {
	            Console.WriteLine(e);
	        }
	  }
				
	} // end TestDrive Item
}

                

Purchase - Transaction Values

HttpsPostRequest mpgReq = new HttpsPostRequest(host, store_id, api_token, new Purchase(order_id, amount, card, exp, crypt));

Purchase object mandatory values

Value

Type

Limits

Variable

Description

Order ID

String

50-character alphanumeric

order_id

Merchant-defined transaction identifier that must be unique for every Purchase, Pre-Authorization and Independent Refund transaction. No two transactions of these types may have the same order ID.

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

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

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

If the order ID has fewer than 3 characters, it may display a blank or 0000000000 in the Invoice Number field.

Amount

String

9-character decimal

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.

Credit card number

String

20-character numeric

card

Most credit card numbers today are 16 digits, but some 13-digit numbers are still accepted by some issuers. This field has been intentionally expanded to 20 digits in consideration for future expansion and potential support of private label card ranges.

Expiry date

String

4-character numeric
YYMM format.

exp

Submit in YYMM format.
Note: This is the reverse of the date displayed on the physical card, which is MMYY.

E-Commerce indicator

String

1-character alphanumeric

crypt

Supported values are:

1 - Mail Order / Telephone Order—Single

2 - Mail Order / Telephone Order—Recurring

3 - Mail Order / Telephone Order—Instalment

4 - Mail Order / Telephone Order—Unknown classification

7 - SET non-authenticated transaction


Predecessors:
  • None
Successors:

Pre-Authorization

The pre-authorization verifies and locks funds on the customer’s credit card.  The funds are locked for a specified amount of time, based on the card issuer.  To retrieve the funds from a pre-authorization so that they may be settled in the merchant account a pre-authorization completion must be performed.

Note: Refer to CorporateCard being returned within the response to determine the next transaction. If the value is”true” proceed to Transaction Examples for MasterCard Level 2/3 for MC, Transaction Examples for Visa Level 2/3  for Visa or Transaction Examples for Amex Level 2/3  for American Express.

Canada Code Sample

namespace Moneris
{
    using System;
	public class MCTestPreauth
	{
	  public static void Main(string[] args)
	  {
	        string host = ‘esqa.moneris.com’;
	        string order_id = ‘order_id_1234’;
	        string amount = ‘4.00’;
	        string card = ‘5454545442424242’;
	        string exp = ‘1111’;
	        string crypt = ‘7’;
	
	        HttpsPostRequest mpgReq =
	            new HttpsPostRequest(host, ‘moneris’, ‘hurgle’,
	                       new Preauth(order_id, amount, card, exp, crypt));
	
	        try
	        {
	            Receipt receipt = mpgReq.GetReceipt();
	
	    		Console.WriteLine("CardType = " + receipt.GetCardType());
	    		Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
	    		Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
	    		Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
	    		Console.WriteLine("TransType = " + receipt.GetTransType());
	    		Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
	    		Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
	    		Console.WriteLine("ISO = " + receipt.GetISO());
	    		Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
	    		Console.WriteLine("Message = " + receipt.GetMessage());
	    		Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
	    		Console.WriteLine("Complete = " + receipt.GetComplete());
	    		Console.WriteLine("TransDate = " + receipt.GetTransDate());
	    		Console.WriteLine("TransTime = " + receipt.GetTransTime());
	    		Console.WriteLine("Ticket = " + receipt.GetTicket());
	    		Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CorporateCard = " + receipt.GetCorporateCard());
	
	        }
	        catch (Exception e)
	        {
	            Console.WriteLine(e);
	        }
	  }
				
	} // end TestDrive Item
}

 

                

Pre-Authorization- Transaction Values

HttpsPostRequest mpgReq = new HttpsPostRequest(host, store_id, api_token, new Preauth(order_id, amount, card, exp, crypt));

Pre-Authorization object mandatory values

Value

Type

Limits

Variable

Description

Order ID

String

50-character alphanumeric

order_id

Merchant-defined transaction identifier that must be unique for every Purchase, Pre-Authorization and Independent Refund transaction. No two transactions of these types may have the same order ID.

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

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

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

If the order ID has fewer than 3 characters, it may display a blank or 0000000000 in the Invoice Number field.

Amount

String

9-character decimal

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.

Credit card number

String

20-character numeric

card

Most credit card numbers today are 16 digits, but some 13-digit numbers are still accepted by some issuers. This field has been intentionally expanded to 20 digits in consideration for future expansion and potential support of private label card ranges.

Expiry date

String

4-character numeric
YYMM format.

exp

Submit in YYMM format.
Note: This is the reverse of the date displayed on the physical card, which is MMYY.

E-Commerce indicator

String

1-character alphanumeric

crypt

Supported values are:

1 - Mail Order / Telephone Order—Single

2 - Mail Order / Telephone Order—Recurring

3 - Mail Order / Telephone Order—Instalment

4 - Mail Order / Telephone Order—Unknown classification

7 - SET non-authenticated transaction


Predecessors:
  • None
Successors:
  • Pre-Authorization Completion
    • For non-Corporate Card ( API | Batch File)
    • For Visa Corporate Card ( API )
    • For MasterCard Corporate Card ( API )
    • For American Express Corporate Card ( API )
  • Vault Tokenize Credit Card ( API )

Pre-Authorization Completion

The completion transaction is used to secure the funds locked by a pre-authorization transaction. The completion retrieves the locked funds and readies them for settlement in to the merchant account.

Things to consider:

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

Canada Code Sample

namespace Moneris
{
    using System;
	public class TestCompletion
	{
	  public static void Main(string[] args)
	  {
            string host =’esqa.moneris.com’;
            string store_id = ‘store1’;
            string api_token = ‘yesguy’;
            string order_id = ‘order_id_1234’;
            string amount = ‘2.00’;
            string txn_number = ‘123456-01-0’;
            string crypt = ‘7’;
	
	        HttpsPostRequest mpgReq =
	            new HttpsPostRequest(host, store_id, api_token,
	                       new Completion(order_id, amount, txn_number, crypt));
	
	        try
	        {
	            Receipt receipt = mpgReq.GetReceipt();
	
	    		Console.WriteLine("CardType = " + receipt.GetCardType());
	    		Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
	    		Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
	    		Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
	    		Console.WriteLine("TransType = " + receipt.GetTransType());
	    		Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
	    		Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
	    		Console.WriteLine("ISO = " + receipt.GetISO());
	    		Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
	    		Console.WriteLine("Message = " + receipt.GetMessage());
	    		Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
	    		Console.WriteLine("Complete = " + receipt.GetComplete());
	    		Console.WriteLine("TransDate = " + receipt.GetTransDate());
	    		Console.WriteLine("TransTime = " + receipt.GetTransTime());
	    		Console.WriteLine("Ticket = " + receipt.GetTicket());
	    		Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
	
	        }
	        catch (Exception e)
	        {
	            Console.WriteLine(e);
	        }
	  }
				
	} // end TestCompletion
}
 

                

Pre-Authorization Completion- Transaction Values

HttpsPostRequest mpgReq = new HttpsPostRequest(host, store_id, api_token, new Completion(order_id, amount, txn_number, crypt));

Pre-Authorization Completion object mandatory values

Value

Type

Limits

Variable

Description

Order ID

String

50-character alphanumeric

order_id

Merchant-defined transaction identifier that must be unique for every Purchase, Pre-Authorization and Independent Refund transaction. No two transactions of these types may have the same order ID.

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

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

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

If the order ID has fewer than 3 characters, it may display a blank or 0000000000 in the Invoice Number field.

Amount

String

9-character decimal

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 number

String

255-character alphanumeric

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.

E-Commerce indicator

String

1-character alphanumeric

crypt

Supported values are:

1 - Mail Order / Telephone Order—Single

2 - Mail Order / Telephone Order—Recurring

3 - Mail Order / Telephone Order—Instalment

4 - Mail Order / Telephone Order—Unknown classification

5 - Authenticated e-commerce transaction (VBV)

6 - Non-authenticated e-commerce transaction (VBV)

7 - SSL-enabled merchant

8 - Non-secure transaction (web- or email-based)

9 - SET non-authenticated transaction


Predecessors:
  • Pre-Authorization (API - Refer to Pre-Authorization section | Batch File | HPP)
  • Re-Authorization ( API )
Successors:
  • Purchase Correction (API - Refer to Purchase Correction section | Batch)
  • Refund (API - Refer to Refund section | Batch)
  • Vault Tokenize Credit Card (API)

Purchase Correction

Purchase and Completion transactions can be voided/corrected the same day* that they occur.  The Purchase Correction transaction is used to cancel a transaction that was performed in the current batch.  No amount is required because a correction is always for 100% of the original transaction.  

* A purchase correction (void) can be performed against a transaction as long as the batch that contains the original transaction remains open.   When using the automated closing feature batch close occurs daily between 10 – 11 pm EST.  

If the batch has already closed, please refer to the Refund section below.

Canada Code Sample

namespace Moneris
{
    using System;
	public class TestPurchaseCorrection
	{
	  public static void Main(string[] args)
	  {
	   	string host =’esqa.moneris.com’;
            		string store_id = ‘store1’;
           		string api_token = ‘yesguy’;
            		string order_id = ‘order_id_123’;
           		string txn_number = ‘123456-01-0’;
            		string crypt = ‘7’;
	
	        	HttpsPostRequest mpgReq = new HttpsPostRequest(host, store_id, api_token,
	                		new PurchaseCorrection(order_id, txn_number, crypt));
	
	        	try
	        	{
	            		Receipt receipt = mpgReq.GetReceipt();
	
	    		Console.WriteLine("CardType = " + receipt.GetCardType());
	    		Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
	    		Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
	    		Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
	    		Console.WriteLine("TransType = " + receipt.GetTransType());
	    		Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
	    		Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
	    		Console.WriteLine("ISO = " + receipt.GetISO());
	    		Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
	    		Console.WriteLine("Message = " + receipt.GetMessage());
	    		Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
	    		Console.WriteLine("Complete = " + receipt.GetComplete());
	    		Console.WriteLine("TransDate = " + receipt.GetTransDate());
	    		Console.WriteLine("TransTime = " + receipt.GetTransTime());
	    		Console.WriteLine("Ticket = " + receipt.GetTicket());
	    		Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
	
	        	}
	        	catch (Exception e)
	        	{
	           		Console.WriteLine(e);
	       	 }
	  }
				
	} // end TestDrive Item
}

                

Purchase Correction - Transaction Values

HttpsPostRequest mpgReq = new HttpsPostRequest(host, store_id, api_token, new PurchaseCorrection(order_id, txn_number, crypt));

Purchase Correction object mandatory values

Value

Type

Limits

Variable

Description

Order ID

String

50-character alphanumeric

order_id

Merchant-defined transaction identifier that must be unique for every Purchase, Pre-Authorization and Independent Refund transaction. No two transactions of these types may have the same order ID.

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

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

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

If the order ID has fewer than 3 characters, it may display a blank or 0000000000 in the Invoice Number field.

Transaction number

String

255-character alphanumeric

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.

E-Commerce indicator

String

1-character alphanumeric

crypt

Supported values are:

1 - Mail Order / Telephone Order—Single

2 - Mail Order / Telephone Order—Recurring

3 - Mail Order / Telephone Order—Instalment

4 - Mail Order / Telephone Order—Unknown classification

5 - Authenticated e-commerce transaction (VBV)

6 - Non-authenticated e-commerce transaction (VBV)

7 - SSL-enabled merchant

8 - Non-secure transaction (web- or email-based)

9 - SET non-authenticated transaction


Predecessors:
  • Purchase (API (Refer to Purchase section)| Batch | HPP)
  • Pre-Authorization Completion (API (Refer to Pre-Authorization section) | Batch | HPP)
Successors:
  • Vault Tokenize Credit Card (API)

Refund

The Refund will credit a specified amount to the cardholder’s credit card. A refund can be sent up to the full value of the original pre-authorization completion or purchase. If the transaction is still in an open batch please refer to Purchase Correction. Unlike a Purchase Correction, after a Refund there is a record of both the initial charge and the refund on the cardholder's statement.

Canada Code Sample

namespace Moneris
{
    using System;
	public class TestRefund
	{
	  public static void Main(string[] args)
	  {
           		string host =’esqa.moneris.com’;
           		string store_id = ‘store1’;
            		string api_token = ‘yesguy’;
            		string order_id = ‘order_id_1234’;
            		string amount = ‘2.00’;
           		string txn_number = ‘123456-01-0’;
            		string crypt = ‘7’;
	
	        	HttpsPostRequest mpgReq =
	            		new HttpsPostRequest(host, store_id, api_token,
	                       		new Refund(order_id, amount, txn_number, crypt));
	
	        	try
	        	{
	            		Receipt receipt = mpgReq.GetReceipt();
	
	    		Console.WriteLine("CardType = " + receipt.GetCardType());
	    		Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
	    		Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
	    		Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
	    		Console.WriteLine("TransType = " + receipt.GetTransType());
	    		Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
	    		Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
	    		Console.WriteLine("ISO = " + receipt.GetISO());
	    		Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
	    		Console.WriteLine("Message = " + receipt.GetMessage());
	    		Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
	    		Console.WriteLine("Complete = " + receipt.GetComplete());
	    		Console.WriteLine("TransDate = " + receipt.GetTransDate());
	    		Console.WriteLine("TransTime = " + receipt.GetTransTime());
	    		Console.WriteLine("Ticket = " + receipt.GetTicket());
	    		Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
	
	       	 }
	        	catch (Exception e)
	        	{
	            		Console.WriteLine(e);
	        	}
	  }
				
	} // end TestRefund
}
                

Refund - Transaction Values

HttpsPostRequest mpgReq = new HttpsPostRequest(host, store_id, api_token, new Refund(order_id, amount, txn_number, crypt));

Refund object mandatory values

Value

Type

Limits

Variable

Description

Order ID

String

50-character alphanumeric

order_id

Merchant-defined transaction identifier that must be unique for every Purchase, Pre-Authorization and Independent Refund transaction. No two transactions of these types may have the same order ID.

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

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

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

If the order ID has fewer than 3 characters, it may display a blank or 0000000000 in the Invoice Number field.

Transaction number

String

255-character alphanumeric

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.

Amount

String

9-character decimal

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.

E-Commerce indicator

String

1-character alphanumeric

crypt

Supported values are:

1 - Mail Order / Telephone Order—Single

2 - Mail Order / Telephone Order—Recurring

3 - Mail Order / Telephone Order—Instalment

4 - Mail Order / Telephone Order—Unknown classification

5 - Authenticated e-commerce transaction (VBV)

6 - Non-authenticated e-commerce transaction (VBV)

7 - SSL-enabled merchant

8 - Non-secure transaction (web- or email-based)

9 - SET non-authenticated transaction


Predecessors:
  • Purchase (API - Refer to Purchase section | Batch | HPP)
  • Pre-Authorization Completion (API - Refer to Pre-Authorization Completion section | Batch | HPP)
Successors:
  • Vault Tokenize Credit card (API)

Independent Refund

Credits a specified amount to the cardholder’s credit card. The credit card number and expiry date are mandatory.

It is not necessary for the transaction that you are refunding to have been processed via the Moneris Payment Gateway.

Things to consider:

  • Because of the potential for fraud, permission for this transaction is not granted to all accounts by default. If it is required for your business, it must be requested via your account manager.

Canada Code Sample

namespace Moneris
{
    using System;
	public class TestIndependentRefund
	{
	  public static void Main(string[] args)
	  {
	        string host = ‘esqa.moneris.com’;
	        string order_id = ‘order_id_1234’;
	        string amount = ‘4.00’;
	        string card = ‘5454545454545454’;
	        string exp = ‘1111’;
	        string crypt = ‘7’;
	
	        HttpsPostRequest mpgReq =
	            new HttpsPostRequest(host, ‘store1’, ‘yesguy’,
	                       new IndependentRefund (order_id, amount, card, exp, crypt));
	
	        try
	        {
	            		Receipt receipt = mpgReq.GetReceipt();
	
	    		Console.WriteLine("CardType = " + receipt.GetCardType());
	    		Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
	    		Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
	    		Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
	    		Console.WriteLine("TransType = " + receipt.GetTransType());
	    		Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
	    		Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
	    		Console.WriteLine("ISO = " + receipt.GetISO());
	    		Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
	    		Console.WriteLine("Message = " + receipt.GetMessage());
	    		Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
	    		Console.WriteLine("Complete = " + receipt.GetComplete());
	    		Console.WriteLine("TransDate = " + receipt.GetTransDate());
	    		Console.WriteLine("TransTime = " + receipt.GetTransTime());
	    		Console.WriteLine("Ticket = " + receipt.GetTicket());
	    		Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
	
	        }
	        catch (Exception e)
	        {
	            Console.WriteLine(e);
	        }
	  }
				
	} // end TestDrive Item
}

                

Independent Refund - Transaction Values

HttpsPostRequest mpgReq = new HttpsPostRequest(host, store_id, api_token, new IndependentRefund (order_id, amount, card, exp, crypt));

Independent Refund object mandatory values

Value

Type

Limits

Variable

Description

Order ID

String

50-character alphanumeric

order_id

Merchant-defined transaction identifier that must be unique for every Purchase, Pre-Authorization and Independent Refund transaction. No two transactions of these types may have the same order ID.

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

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

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

If the order ID has fewer than 3 characters, it may display a blank or 0000000000 in the Invoice Number field.

Amount

String

9-character decimal

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.

Credit card number

String

20-character numeric

card

Most credit card numbers today are 16 digits, but some 13-digit numbers are still accepted by some issuers. This field has been intentionally expanded to 20 digits in consideration for future expansion and potential support of private label card ranges.

Expiry date

String

4-character numeric
YYMM format.

exp

Submit in YYMM format.
Note: This is the reverse of the date displayed on the physical card, which is MMYY.

E-Commerce indicator

String

1-character alphanumeric

crypt

Supported values are:

1 - Mail Order / Telephone Order—Single

2 - Mail Order / Telephone Order—Recurring

3 - Mail Order / Telephone Order—Instalment

4 - Mail Order / Telephone Order—Unknown classification

5 - Authenticated e-commerce transaction (VBV)

6 - Non-authenticated e-commerce transaction (VBV)

7 - SSL-enabled merchant

8 - Non-secure transaction (web- or email-based)

9 - SET non-authenticated transaction


Predecessors:
  • Transaction that was completed on an independent system
Successors:
  • Vault Tokenize Credit card (API)

Batch Close

When a batch close is performed it takes the monies from all purchase, pre-authorization completion, purchase correction and refund transactions so they will be deposited the following business day.  For funds to be deposited the following business day the batch must close before 11pm EST.

By default Moneris Gateway will close your batch automatically for you daily whenever there are funds in the open batch.  Some merchants prefer to control batch close, and disable the automatic functionality.  For these merchants we have provided the ability to close your batch through the API. When a batch is closed the response will include the transaction count and amount for each type of transaction for each type of card. To disable automatic close please log into the Moneris Gateway Merchant Resource Centre ( Canada QA | Canada Production) and proceed to Admin and Store Settings to change the Batch Close settings.

Canada Code Sample

namespace Moneris
{
    using System;
	public class TestBatchClose
	{
	  public static void Main(string[] args)
	  {
	        string host = "esqa.moneris.com";
	        string store_id = "store5";
	        string api_token = "yesguy";
	        string ecr_no = args[3];	//ecr within store
	
	        HttpsPostRequest mpgReq = new HttpsPostRequest(host,store_id, api_token, new BatchClose (ecr_no));
	        try {
	            Receipt receipt = mpgReq.GetReceipt();
	
	            if ( (receipt.GetReceiptId()).Equals("Global Error Receipt") ) 
	            {
	    		    Console.WriteLine("CardType = " + receipt.GetCardType());
	    		    Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
	    		    Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
	    		    Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
	    		    Console.WriteLine("TransType = " + receipt.GetTransType());
	    		    Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
	    		    Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
	    		    Console.WriteLine("ISO = " + receipt.GetISO());
	    		    Console.WriteLine("BankTotals = null");
	    		    Console.WriteLine("Message = " + receipt.GetMessage());
	    		    Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
	    		    Console.WriteLine("Complete = " + receipt.GetComplete());
	    		    Console.WriteLine("TransDate = " + receipt.GetTransDate());
	    		    Console.WriteLine("TransTime = " + receipt.GetTransTime());
	    		    Console.WriteLine("Ticket = " + receipt.GetTicket());
	    		    Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
	            }
	            else {    
		            foreach ( string ecr in receipt.GetTerminalIDs() )
		            {
		                Console.WriteLine("ECR: " + ecr);
		                foreach ( string cardType in receipt.GetCreditCards(ecr) )
		                {
		                    Console.WriteLine("\tCard Type: " + cardType);
		                    Console.WriteLine("\t\tPurchase: Count = " + receipt.GetPurchaseCount(ecr,cardType)
		                                        + " Amount = " + receipt.GetPurchaseAmount(ecr, cardType));
		                    Console.WriteLine("\t\tRefund: Count = "  + receipt.GetRefundCount(ecr,cardType)
		                                        + " Amount = " + receipt.GetRefundAmount(ecr,cardType));
		                    Console.WriteLine("\t\tCorrection: Count = " + receipt.GetCorrectionCount(ecr,cardType)
		                                        + " Amount = " + receipt.GetCorrectionAmount(ecr, cardType));
		                }
		            }
	            }
	        }
	        catch (Exception e)
	        {
	            Console.WriteLine(e);
	        }
		}		
	} // end TestBatchClose
}
                

Batch Close - Transaction Values

HttpsPostRequest mpgReq = new HttpsPostRequest(host, store_id, api_token, new BatchClose (ecr_no));

Batch Close object mandatory values

Value

Type

Limits

Variable

Description

ECR (electronic cash register) number

String

No limit (value provided by Moneris)

ecr_no

Electronic cash register number


Predecessors:
  • None
Successors:
  • None

Open Totals

Open Totals can be performed to determine what Moneris has recorded as the current batch totals.Returns the details about the currently open batch.

This transaction is similar to the Batch Close. The difference is that it does not close the batch for settlement.

Canada Code Sample

namespace Moneris
{
    using System;
	public class TestOpenTotals
	{
	  public static void Main(string[] args)
	  {
	        string host = args[0];
	        string store_id = args[1];
	        string api_token = args[2];
	        string ecr_no = args[3];
	
	        HttpsPostRequest mpgReq =
	            new HttpsPostRequest(host, store_id, api_token, new OpenTotals (ecr_no));
	        try
	        {
	            Receipt receipt = mpgReq.GetReceipt();
	
	            if ( (receipt.GetReceiptId()).Equals("Global Error Receipt") ) 
	            {
	    		    Console.WriteLine("CardType = " + receipt.GetCreditCards(ecr_no));
	    		    Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
	    		    Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
	    		    Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
	    		    Console.WriteLine("TransType = " + receipt.GetTransType());
	    		    Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
	    		    Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
	    		    Console.WriteLine("ISO = " + receipt.GetISO());
	    		    Console.WriteLine("BankTotals = null");
	    		    Console.WriteLine("Message = " + receipt.GetMessage());
	    		    Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
	    		    Console.WriteLine("Complete = " + receipt.GetComplete());
	    		    Console.WriteLine("TransDate = " + receipt.GetTransDate());
	    		    Console.WriteLine("TransTime = " + receipt.GetTransTime());
	    		    Console.WriteLine("Ticket = " + receipt.GetTicket());
	    		    Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
	            }
	            else
	            {    
		            foreach ( string ecr in receipt.GetTerminalIDs() )
		            {
		                Console.WriteLine("ECR: " + ecr);
		                foreach ( string cardType in receipt.GetCreditCards(ecr) )
		                {
		                    Console.WriteLine("\tCard Type: " + cardType);
		
		                    Console.WriteLine("\t\tPurchase: Count = " + receipt.GetPurchaseCount(ecr,cardType)  + " Amount = "
		                                        + receipt.GetPurchaseAmount(ecr, cardType));
		
		                    Console.WriteLine("\t\tRefund: Count = "  + receipt.GetRefundCount(ecr,cardType) + " Amount = "
		                                        + receipt.GetRefundAmount(ecr,cardType));
		  
		                    Console.WriteLine("\t\tCorrection: Count = " + receipt.GetCorrectionCount(ecr,cardType)  + " Amount = "
		                                        + receipt.GetCorrectionAmount(ecr, cardType));
			 }
		            }
	            }
	        }
	        catch (Exception e)
	        {
	            Console.WriteLine(e);
	        }
		}
				
	} // end TestOpenTotals
}
 

                

Open Totals - Transaction Values

HttpsPostRequest mpgReq = new HttpsPostRequest(host, store_id, api_token, new OpenTotals(ecr_no));

Open Totals object mandatory values

Value

Type

Limits

Variable

Description

ECR (electronic cash register) number

String

No limit (value provided by Moneris)

ecr_no

Electronic cash register number


Predecessors:
  • None
Successors:
  • None

Definition of Request Fields

Variable

Limits

Description

order_id

50 – character alphanumeric

Merchant defined unique transaction identifier - must be unique for every Purchase, PreAuth and Independent Refund attempt.  For Refunds, Completions and Purchase corrections the order_id is must reference the original transaction.

card

20-character numeric

Credit Card Number - no spaces or dashes. Most credit card numbers today are 16 digits in length but some 13 digits are still accepted by some issuers. This field has been intentionally expanded to 20 digits in consideration for future expansion and/or potential support of private label card ranges.

exp

4-character numeric

YYMM format

Expiry Date - format YYMM no spaces or slashes.

PLEASE NOTE THAT THIS IS REVERSED FROM THE DATE DISPLAYED ON THE PHYSICAL CARD WHICH IS MMYY

amount

9-character decimal

Amount of the transaction. This must contain 3 digits with two penny values. The minimum value passed can be 0.01 and the maximum 9999999.99

crypt

1-character alphanumeric

E-Commerce Indicator:

1 - Mail Order/Telephone Order - Single

2 - Mail Order/Telephone Order - Recurring

3 - Mail Order Telephone Order - Installment

4 - Mail Order Telephone Order - Unknown Classification

5 - Authenticated Ecommerce Transaction (VBV or MCSC)

6 – Non Authenticated Ecommerce Transaction (VBV or MCSC)

7 - SSL enabled merchant

8 - Non Secure Transaction (Web or Email Based)

9 - SET non Authenticated transaction

txn_number

255-character variable character

Used when performing follow on transactions - this must be filled with the value that was return as the trans_id in the response of the original transaction.  When performing a pre-authorization completion this must reference the Pre-authorization.  When performing a refund or a purchase correction this must reference the pre-authorization completion or the purchase.

cust_id

99-character alphanumeric

This is an optional field that can be sent as part of a purchase or pre-authorization request.  It is searchable from the Moneris Merchant Interface.  It is commonly used for policy number, membership number, student id or invoice number.

customerCode

99-character alphanumeric

This is an optional field that can be sent as part of the completion request.  It is searchable from the Merchant Resource Center.

invoiceNumber

99-character alphanumeric

This is an optional field that can be sent as part of the completion request.  It is searchable from the Merchant Resource Center.

Variable Limits Description
ReceiptId 50 – character alphanumeric  The order id specified in the request will be echoed back in the response.  This field is recommended to be displayed on the receipt for tracking and troubleshooting purposes.
ReferenceNum 18 – character numeric This is a bank transaction reference number.  The entire reference number must be displayed on the receipt.  This information should also be stored by the merchant. The following illustrates the breakdown of this field where "660123450010690030” is the reference number returned in the message. Example: 660123450010690030
  • 66012345: Terminal ID
  • 001: Shift number
  • 069: Batch number
  • 003: Transaction number within the batch.
Format: nnnnnnnnnnnnnnnnnn (18 digits)  
ResponseCode 3 – character numeric The response code is used to determine whether the transaction was approved or declined.  The receipt message is determined by the Response Code and the ISO code.

 
Response Code Result
0 – 49 (inclusive) Approved
50 – 999 (inclusive) Declined
null Incomplete


  Custom Apple Pay SDK Responses:
ResponseCode Message Definition
900 Global Error Unable to decrypt payload
  For a full list of response codes and the associated message please refer to the Financial Response Codes.
ISO 2 – character numeric The ISO code is a bank issued response code.  The ISO code and the response code are used to determine the receipt message.
AuthCode 8 – character alphanumeric The authorization code is returned by the issuer as part of the transaction response.  This field must be displayed on the receipt.
TransTime ##:##:## Processing host time stamp. Time of the transaction.  Must be displayed on the transaction receipt. Format: HH:II:SS  HH = 2 digit hour, 24 hour clock (“0” left padded | 02 = 2am, 14 = 2pm) II = 2 digit minute (“0” left padded) SS = 2 digit seconds (“0” left padded  
TransDate YYYY-MM-DD Processing host date stamp. Date of the transaction.  Must be displayed on the transaction receipt. Format: YYYY-MM-DD  YYYY = 4 digit year MM = 2 digit month (“0” left padded | Jan = 01) DD = 2 digit day of month (“0” left padded)  
TransType 2 – character numeric (variable length) Transaction Type defines what type of transaction was performed.  See below for definitions.  A full description of the type of transaction performed must be displayed on the transaction receipt (Sale, Refund, . . . )

            00 – Sale

            01 – Authorization (Credit Cards only)

            02 – Completion (Credit Cards only)

            04 – Refund / Independent Refund

            11 – Void  
Complete true/false Transaction was sent to authorization host and a response was received
Message 100 – character alphanumeric (variable length) Response description returned from issuing institution. The response message indicating in details whether the transaction was Approved or Declined.
TransAmount 9 decimal (variable length) Returns the amount sent in request for processing. The amount represents the amount that the cardholder was charged/refunded.  The amount must be displayed on the receipt. Format: nnnnnnN.NN   The amount will always contain one (1) dollar value and two (2) cent values separated by a period “.”. N = always returned n = returned when required    
CardType 2 – character alphanumeric (variable length) CardType defines the card type used for a transaction.  See below for definitions.  On the transaction receipt the Card Type field must be displayed as “Account” and must be displayed with the full description of the card (Visa, MasterCard . . .)
M = MasterCard 
V = Visa 
AX = American Express 
NO = Novus/Discover in (Canada only)
DS= Discover (US only)
C = JCB (US only)
C1 = JCB (Canada only)
SE = Sears (Canada only)
P = Pin Debit (US only)
D = Debit (Canada only)  
TxnNumber 20 – character alphanumeric (variable length) The transaction number is an identifier used by Moneris Gateway to identify the transaction.  This value is used for follow-on transactions (void, capture, refund).  It does not need to be displayed on the receipt but should be stored in the application database.
TimedOut true/false Transaction failed due to a process timing out
Ticket n/a reserved
DeviceManufacturerIdentifier 12 – character alphanumeric Token requestor ID. Returned from decrypted payload. Hex-encoded device manufacturer identifier.
CAVV 40 – character alphanumeric Decrypted CAVV value for the transaction. Returned for Apple Pay Purchase/Pre-Authorization transaction if payload is successfully decrypted.
CorporateCard                    true/false Indicates whether the card is a corporate card or not
 RecurSucess true/false Indicates whether the transaction successfully registered.
 AvsResultCode 1 – character alphanumeric Indicates the address verification result: Please refer to the AVS Result Codes table for list of possible results.  
 CvdResultCode 2 – character alphanumeric The CVD response is an alphanumeric 2 byte variable. The first byte is the numeric CVD indicator; the second byte would be the response code. The CVD value is keyed on the PINpad when doing a manually keyed transaction.  Please refer to the CVD Result Codes table for list of possible results.
 IsVisaDebit true/false/null Indicates whether the card that the transaction was performed on is Visa debit.
  • true = Card is Visa Debit
  • false = Card is not Visa Debit
  • null = there was an error in identifying the card

Definition of Response Fields

Variable

Limits

Description

ReceiptId

50 – character alphanumeric

The order id specified in the request will be echoed back in the response. This field is recommended to be displayed on the receipt for tracking and troubleshooting purposes.

ReferenceNum

18 – character numeric

This is a bank transaction reference number. The entire reference number must be displayed on the receipt. This information should also be stored by the merchant. The following illustrates the breakdown of this field where "660123450010690030” is the reference number returned in the message. Example: 660123450010690030

  • 66012345: Terminal ID
  • 001: Shift number
  • 069: Batch number
  • 003: Transaction number within the batch.

Format: nnnnnnnnnnnnnnnnnn (18 digits)

ResponseCode

3 – character numeric

The response code is used to determine whether the transaction was approved or declined. The receipt message is determined by the Response Code and the ISO code.

Response Code Result
0 – 49 (inclusive) Approved
50 – 999 (inclusive) Declined
null Incomplete

For a full list of response codes and the associated message please refer to the Financial Response Codes.

ISO

2 – character numeric

The ISO code is a bank issued response code. The ISO code and the response code are used to determine the receipt message.

AuthCode

8 – character alphanumeric

The authorization code is returned by the issuer as part of the transaction response. This field must be displayed on the receipt.

TransTime

##:##:##

Processing host time stamp. Time of the transaction. Must be displayed on the transaction receipt. Format: HH:II:SS HH = 2 digit hour, 24 hour clock (“0” left padded | 02 = 2am, 14 = 2pm) II = 2 digit minute (“0” left padded) SS = 2 digit seconds (“0” left padded

TransDate

YYYY-MM-DD

Processing host date stamp. Date of the transaction. Must be displayed on the transaction receipt. Format: YYYY-MM-DD YYYY = 4 digit year MM = 2 digit month (“0” left padded | Jan = 01) DD = 2 digit day of month (“0” left padded)

TransType

2 – character numeric (variable length)

  • Transaction Type defines what type of transaction was performed. See below for definitions. A full description of the type of transaction performed must be displayed on the transaction receipt (Sale, Refund, . . . )

    • 00 – Sale
    • 01 – Authorization (Credit Cards only)
    • 02 – Completion (Credit Cards only)
    • 04 – Refund / Independent Refund
    • 11 – Void

Complete

true/false

Transaction was sent to authorization host and a response was received

Message

100 – character alphanumeric (variable length)

Response description returned from issuing institution. The response message indicating in details whether the transaction was Approved or Declined.

TransAmount

9 decimal (variable length)

Returns the amount sent in request for processing. The amount represents the amount that the cardholder was charged/refunded. The amount must be displayed on the receipt. Format: nnnnnnN.NN The amount will always contain one (1) dollar value and two (2) cent values separated by a period “.”. N = always returned n = returned when required

CardType

2 – character alphanumeric (variable length)

CardType defines the card type used for a transaction. See below for definitions. On the transaction receipt the Card Type field must be displayed as “Account” and must be displayed with the full description of the card (Visa, MasterCard . . .)

  • M = MasterCard
  • V = Visa
  • AX = American Express
  • NO = Novus/Discover in (Canada only)
  • DS= Discover (US only)
  • C = JCB (US only)
  • C1 = JCB (Canada only)
  • SE = Sears (Canada only)
  • P = Pin Debit (US only)
  • D = Debit (Canada only)

TxnNumber

20 – character alphanumeric (variable length)

The transaction number is an identifier used by Moneris Gateway to identify the transaction. This value is used for follow-on transactions (void, capture, refund). It does not need to be displayed on the receipt but should be stored in the application database.

TimedOut

true/false

Transaction failed due to a process timing out

Ticket

n/a

reserved

DeviceManufacturerIdentifier

12 – character alphanumeric

Token requestor ID. Returned from decrypted payload. Hex-encoded device manufacturer identifier.

CAVV

40 – character alphanumeric

Decrypted CAVV value for the transaction. Returned for Apple Pay Purchase/Pre-Authorization transaction if payload is successfully decrypted.

CorporateCard

true/false

Indicates whether the card is a corporate card or not

RecurSucess

true/false

Indicates whether the transaction successfully registered.

AvsResultCode

1 – character alphanumeric

Indicates the address verification result: Please refer to the AVS Result Codes table for list of possible results.

CvdResultCode

2 – character alphanumeric

The CVD response is an alphanumeric 2 byte variable. The first byte is the numeric CVD indicator; the second byte would be the response code. The CVD value is keyed on the PINpad when doing a manually keyed transaction. Please refer to the CVD Result Codes table for list of possible results.

IsVisaDebit

true/false/null

Indicates whether the card that the transaction was performed on is Visa debit.

  • true = Card is Visa Debit
  • false = Card is not Visa Debit
  • null = there was an error in identifying the card