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 credit card 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:
VALUE |
TYPE |
LIMITS |
SET METHOD |
DESCRIPTION |
Order ID |
String |
50-character alphanumeric |
purchase.SetOrderId(order_id); |
Merchant-defined transaction identifier that must be unique for every Purchase, Pre-Authorization and Independent Refund transaction. No two transactions of these types may have the same order ID.
For Refund, Completion and Purchase Correction transactions, the order ID must be the same as that of the original transaction.
The last 10 characters of the order ID are displayed in the “Invoice Number” field on the Merchant Direct Reports. However only letters, numbers and spaces are sent to Merchant Direct.
A minimum of 3 and a maximum of 10 valid characters are sent to Merchant Direct. Only the last characters beginning after any invalid characters are sent. For example, if the order ID is 1234-567890, only 567890 is sent to Merchant Direct.
If the order ID has fewer than 3 characters, it may display a blank or 0000000000 in the Invoice Number field. |
Amount |
String |
10-character decimal |
purchase.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 $9999999.99. Transaction amounts of $0.00 are not allowed. |
Credit card number |
String |
20-character numeric |
purchase.SetPan(pan); |
Most credit card numbers today are 16 digits, but some 13-digit numbers are still accepted by some issuers. This field has been intentionally expanded to 20 digits in consideration for future expansion and potential support of private label card ranges. |
Expiry date |
String |
4-character numeric
YYMM format. |
purchase.SetExpdate(expdate); |
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 |
purchase.SetCryptType(crypt); |
Describes the category of e-commerce transaction being processed. Allowable 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
In Credential on File transactions where the request field e-commerce indicator is also being sent: the allowable values for e-commerce indicator are dependent on the value sent for payment indicator, as follows:
if payment indicator = R, then allowable values for e-commerce indicator: 2, 5 or 6
if payment indicator = C, then allowable values for e-commerce indicator: 1, 5, 6 or 7
if payment indicator = U, then allowable values for e-commerce indicator: 1 or 7
if payment indicator = Z, then allowable values for e-commerce indicator: 1, 5, 6 or 7
|
Convenience Fee |
Object |
|
ConvFeeInfo convFeeInfo = new ConvFeeInfo();
purchase.SetConvFeeInfo(convFeeInfo); |
Refer below for further breakdown and definition. Please note, if the Convenience Fee is set, then Recurring Billing is not supported. |
Purchase optional values
Convenience Fee Mandatory Values
Convenience Fee Response Fields
Purchase with INTERAC® Online
Purchase with 3-D Secure
The Purchase with 3-D Secure transaction follows a 3-D Secure MPI authentication. After receiving confirmation from the MPI ACS transaction, this Purchase verifies funds on the customer’s card, removes the funds and prepares them for deposit into the merchant’s account.
To perform the 3-D Secure authentication, the Moneris MPI or any 3rd party MPI may be used.
In addition to 3-D Secure transactions, this transaction can also be used to process Apple Pay and Google Pay™ transactions. This transaction is applicable only if choosing to integrate directly to Apple Wallet or Google Wallet (if not using the Moneris Apple Pay or Google Pay™ SDKs).
Refer to Apple or Google developer portals for details on integrating directly to their wallets to retrieve the payload data.
NOTE: Moneris strongly discourages the use of frames as part of a 3-D Secure implementation, and cannot guarantee their reliability when processing transactions in the production environment.
namespace Moneris
{
using System;
using System.Collections;
public class TestCanadaCavvPurchase
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "CUS887H67";
string amount = "10.42";
string pan = "4242424242424242";
string expdate = "1901"; //YYMM
string cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA=";
string dynamic_descriptor = "123456";
string wallet_indicator = "APP";
string crypt_type = "5";
bool status_check = false;
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("168451306048014");
CavvPurchase cavvPurchase = new CavvPurchase();
cavvPurchase.SetOrderId(order_id);
cavvPurchase.SetCustId(cust_id);
cavvPurchase.SetAmount(amount);
cavvPurchase.SetPan(pan);
cavvPurchase.SetExpDate(expdate);
cavvPurchase.SetCavv(cavv);
cavvPurchase.SetCryptType(crypt_type); //Mandatory for AMEX cards only
cavvPurchase.SetDynamicDescriptor(dynamic_descriptor);
//cavvPurchase.SetNetwork("Interac"); //set only for Interac e-commerce
//cavvPurchase.SetDataType("3DSecure"); //set only for Interac e-commerce
//cavvPurchase.SetWalletIndicator(wallet_indicator); //set only wallet transactions e.g. APPLE PAY
//cavvPurchase.SetCmId("8nAK8712sGaAkls56"); //set only for usage with Offlinx - Unique max 50 alphanumeric characters transaction id generated by merchant
cavvPurchase.SetCofInfo(cof);
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(cavvPurchase);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
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("CavvResultCode = " + receipt.GetCavvResultCode());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Purchase with 3-D Secure - Transaction
CavvPurchase cavvPurchase = new CavvPurchase();
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(cavvPurchase);
Purchase object mandatory values
Purchase optional values
3-D Secure Response Fields
Purchase with Vault
This transaction uses the data key to identify a previously registered credit card profile. The details saved within the profile are then submitted to perform a Purchase transaction.
The data key may be a temporary one generated using Hosted Tokenization or it may be a permanent one from the Vault.
The Vault feature allows merchants to create long term customer profiles, edit those profiles, and use them to process transactions without having to enter financial information each time.
The only difference between charging a temporary token and charging a standard Vault token is whether the expiry date is sent. With the Vault token, the expiry date is stored along with the card number as part of the Vault profile. Therefore, there is no need to send the expiry date again with each normal Vault transaction.
However, a temporary token transaction may have only stored the card number. Therefore, in this scenario the expiry date must be sent when you charge the card.
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResPurchaseCC
{
public static void Main(string[] args)
{
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string store_id = "store1";
string api_token = "yesguy";
string data_key = "eLqsADfwqHDxIpJG9vLnELx01";
string amount = "1.00";
string cust_id = "customer1"; //if sent will be submitted, otherwise cust_id from profile will be used
string crypt_type = "1";
string descriptor = "my descriptor";
bool status_check = false;
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("168451306048014");
ResPurchaseCC resPurchaseCC = new ResPurchaseCC();
resPurchaseCC.SetDataKey(data_key);
resPurchaseCC.SetOrderId(order_id);
resPurchaseCC.SetCustId(cust_id);
resPurchaseCC.SetAmount(amount);
resPurchaseCC.SetCryptType(crypt_type);
resPurchaseCC.SetDynamicDescriptor(descriptor);
resPurchaseCC.SetCofInfo(cof);
//resPurchaseCC.SetExpDate("1511"); //optional - use for temp token only
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(resPurchaseCC);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("Masked Pan = " + receipt.GetResDataMaskedPan());
Console.WriteLine("Exp Date = " + receipt.GetResDataExpdate());
Console.WriteLine("Crypt Type = " + receipt.GetResDataCryptType());
Console.WriteLine("Avs Street Number = " + receipt.GetResDataAvsStreetNumber());
Console.WriteLine("Avs Street Name = " + receipt.GetResDataAvsStreetName());
Console.WriteLine("Avs Zipcode = " + receipt.GetResDataAvsZipcode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Purchase with Vault - Transaction Values
ResPurchaseCC resPurchaseCC = new ResPurchaseCC();
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.setTransaction(resPurchaseCC);
Purchase with Vault mandatory values
Purchase with Vault optional values
Vault Response Fields
Use the full featured online HTML editor toolkit to compose web articles.
Purchase with Vault optional values
Vault Response Fields
Purchase with Vault and Customer Information
The Vault feature allows merchants to create customer profiles, edit those profiles, and use them to process
transactions without having to enter financial information each time.
The Vault is a complement to the recurring payment module. It securely stores customer account information
on Moneris secure servers. This allows merchants to bill customers for routine products or services
when an invoice is due.
An optional add-on to a number of transactions the Customer Information object. 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.
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResPurchaseCCcustinfo
{
public static void Main(string[] args)
{
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string store_id = "store1";
string api_token = "yesguy";
string data_key = "eLqsADfwqHDxIpJG9vLnELx01";
string amount = "1.00";
string cust_id = "customer1"; //if sent will be submitted, otherwise cust_id from profile will be used
string crypt_type = "1";
string processing_country_code = "CA";
bool status_check = false;
ResPurchaseCC resPurchaseCC = new ResPurchaseCC();
resPurchaseCC.SetDataKey(data_key);
resPurchaseCC.SetOrderId(order_id);
resPurchaseCC.SetCustId(cust_id);
resPurchaseCC.SetAmount(amount);
resPurchaseCC.SetCryptType(crypt_type);
//CustInfo Variables
CustInfo custInfo = new CustInfo();
custInfo.SetEmail("nick@widget.com");
custInfo.SetInstructions("Make it fast!");
Hashtable b = new Hashtable();
b.Add("first_name", "Bob");
b.Add("last_name", "Smith");
b.Add("company_name", "Widget Company Inc.");
b.Add("address", "111 Bolts Ave.");
b.Add("city", "Toronto");
b.Add("province", "Ontario");
b.Add("postal_code", "M8T 1T8");
b.Add("country", "Canada");
b.Add("phone", "416-555-5555");
b.Add("fax", "416-555-5555");
b.Add("tax1", "123.45"); //federal tax
b.Add("tax2", "12.34"); //prov tax
b.Add("tax3", "15.45"); //luxury tax
b.Add("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 s = new Hashtable();
s.Add("first_name", "Bob");
s.Add("last_name", "Smith");
s.Add("company_name", "Widget Company Inc.");
s.Add("address", "111 Bolts Ave.");
s.Add("city", "Toronto");
s.Add("province", "Ontario");
s.Add("postal_code", "M8T 1T8");
s.Add("country", "Canada");
s.Add("phone", "416-555-5555");
s.Add("fax", "416-555-5555");
s.Add("tax1", "123.45"); //federal tax
s.Add("tax2", "12.34"); //prov tax
s.Add("tax3", "15.45"); //luxury tax
s.Add("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 i1 = new Hashtable();
i1.Add("name", "item1's name");
i1.Add("quantity", "5");
i1.Add("product_code", "item1's product code");
i1.Add("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 i2 = new Hashtable();
i2.Add("name", "item2's name");
i2.Add("quantity", "7");
i2.Add("product_code", "item2's product code");
i2.Add("extended_amount", "5.01");
custInfo.SetItem(i2);
resPurchaseCC.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(resPurchaseCC);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("Masked Pan = " + receipt.GetResDataMaskedPan());
Console.WriteLine("Exp Date = " + receipt.GetResDataExpdate());
Console.WriteLine("Crypt Type = " + receipt.GetResDataCryptType());
Console.WriteLine("Avs Street Number = " + receipt.GetResDataAvsStreetNumber());
Console.WriteLine("Avs Street Name = " + receipt.GetResDataAvsStreetName());
Console.WriteLine("Avs Zipcode = " + receipt.GetResDataAvsZipcode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Purchase with Vault - Transaction Values
ResPurchaseCC resPurchaseCC = new ResPurchaseCC();
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resPurchaseCC);
Purchase with Vault mandatory values
Purchase with Vault optional values
CustInfo object mandatory properties
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:
- Instantiate a CustInfo object.
- 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.)
- Build the hashtable using put methods with the hash table keys in the table below.
- Call the CustInfo object's setBilling()/setShipping() method to pass the hashtable information to the CustInfo object
- 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
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:
- Instantiate a CustInfo object.
- 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.)
- Build the hashtable using put methods with the hash table keys in the table below.
- Call the CustInfo object's setItem() method to pass the hashtable information to the CustInfo object
- Call the transaction object's setCustInfo() method to write the CustInfo object (with the item information to the transaction object.
Item mandatory values
Vault Response Fields
Purchase with Vault and Recurring Billing
This transaction uses the data key to identify a previously registered credit card profile. The details saved within the profile are then submitted to perform a Purchase transaction.
The data key may be a temporary one generated using Hosted Tokenization or it may be a permanent one from the Vault.
The Vault feature allows merchants to create customer profiles, edit those profiles, and use them to process transactions without having to enter financial information each time.
The Vault is a complement to the recurring payment module. It securely stores customer account information on Moneris secure servers. This allows merchants to bill customers for routine products or services when an invoice is due.
This transaction allows the merchant to process a Purchase transaction using a data key to reference the card number already on file. In addition, it also registers a new recurring billing profile where going forward Moneris will automatically process the recurring transaction and will bill 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.
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResPurchaseCCrecur
{
public static void Main(string[] args)
{
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string store_id = "store1";
string api_token = "yesguy";
string data_key = "eLqsADfwqHDxIpJG9vLnELx01";
string amount = "1.00";
string cust_id = "customer1"; //if sent will be submitted, otherwise cust_id from profile will be used
string crypt_type = "2";
bool status_check = false;
ResPurchaseCC resPurchaseCC = new ResPurchaseCC();
resPurchaseCC.SetDataKey(data_key);
resPurchaseCC.SetOrderId(order_id);
resPurchaseCC.SetCustId(cust_id);
resPurchaseCC.SetAmount(amount);
resPurchaseCC.SetCryptType(crypt_type);
/************************* Recur Variables **********************************/
string recur_unit = "month";
string start_now = "true";
string start_date = "2019/12/01";
string num_recurs = "12";
string period = "1";
string recur_amount = "30.00";
/************************* Recur Object Option1 ******************************/
Recur recurring_cycle = new Recur(recur_unit, start_now, start_date,
num_recurs, period, recur_amount);
resPurchaseCC.SetRecur(recurring_cycle);
/********************* Credential on File *****************************************/
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("R");
cof.SetPaymentInformation("2");
cof.SetIssuerId("168451306048014");
resPurchaseCC.SetCofInfo(cof);
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(resPurchaseCC);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("AVSResponse = " + receipt.GetAvsResultCode());
Console.WriteLine("CVDResponse = " + receipt.GetCvdResultCode());
Console.WriteLine("RecurSuccess = " + receipt.GetRecurSuccess());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("Masked Pan = " + receipt.GetResDataMaskedPan());
Console.WriteLine("Exp Date = " + receipt.GetResDataExpdate());
Console.WriteLine("Crypt Type = " + receipt.GetResDataCryptType());
Console.WriteLine("Avs Street Number = " + receipt.GetResDataAvsStreetNumber());
Console.WriteLine("Avs Street Name = " + receipt.GetResDataAvsStreetName());
Console.WriteLine("Avs Zipcode = " + receipt.GetResDataAvsZipcode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Transaction Values
ResPurchaseCC resPurchaseCC = new ResPurchaseCC();
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resPurchaseCC);
Purchase object mandatory values
Purchase optional values
Recurring object mandatory values
Recurring Billing Response Fields
Vault Response Fields
Purchase with Vault and CVD & AVS
This transaction uses the data key to identify a previously registered credit card profile. The details saved within the profile are then submitted to perform a Purchase transaction.
The data key may be a temporary one generated using Hosted Tokenization or it may be a permanent one from the Vault.
The Card Validation Digits (CVD) value refers to the numbers appearing on the back of the credit card rather than the numbers imprinted on the front. It is an optional fraud prevention tool that enables merchants to verify data provided by the cardholder at transaction time. This data is submitted along with the transaction to the issuing bank, which provides a response indicating whether the data is a match.
The response that is received from CVD verification is intended to provide added security and fraud prevention, but the response itself does not affect the completion of a transaction. Upon receiving a response, the choice whether to proceed with a transaction is left entirely to the merchant. The response is not a strict guideline of which transaction will approve or decline.
Address Verification Service (AVS) is an optional fraud-prevention tool offered by issuing banks whereby a cardholder's address is submitted as part of the transaction authorization. The AVS address is then compared to the address kept on file at the issuing bank. AVS checks whether the street number, street name and zip/postal code match. The issuing bank returns an AVS result code indicating whether the data was matched successfully. Regardless of the AVS result code returned, the credit card is authorized or declined by the issuing bank.
The response that is received from AVS verification is intended to provide added security and fraud prevention, but the response itself does not affect the completion of a transaction. Upon receiving a response, the choice to proceed with a transaction is left entirely to the merchant. The responses is not a strict guideline of whether a transaction will be approved or declined.
Things to consider:
- CVD is only supported by Visa, MasterCard, Discover, JCB, American Express and UnionPay.
- AVS is only supported by Visa, MasterCard, Discover and American Express.
- When testing CVD or AVS, you must only use the Visa test card numbers 4242424242424242 or 4005554444444403, and the amounts described in the Simulator eFraud Response Codes Table.
- For a full list of possible AVS & CVD result codes refer to the CVD AVS Result Code table.
Security:The CVD value must only be passed to the payment gateway. Under no circumstances may it be stored for subsequent uses or displayed as part of the receipt information.
Note:Please be advised that CVD results will
NOT be returned in the response for UnionPay.
namespace Moneris
{
using Moneris;
public class TestCanadaResPreauthCCefraud
{
public static void Main(string[] args)
{
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string store_id = "store1";
string api_token = "yesguy1";
string data_key = "eLqsADfwqHDxIpJG9vLnELx01";
string amount = "1.00";
string cust_id = "customer1"; //if sent will be submitted, otherwise cust_id from profile will be used
string crypt_type = "1";
string processing_country_code = "CA";
bool status_check = false;
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("168451306048014");
AvsInfo avsCheck = new AvsInfo();
avsCheck.SetAvsStreetNumber("212");
avsCheck.SetAvsStreetName("Payton Street");
avsCheck.SetAvsZipCode("M1M1M1");
avsCheck.SetAvsEmail("test@host.com");
avsCheck.SetAvsHostname("hostname");
avsCheck.SetAvsBrowser("Mozilla");
avsCheck.SetAvsShipToCountry("CAN");
avsCheck.SetAvsShipMethod("G");
avsCheck.SetAvsMerchProdSku("123456");
avsCheck.SetAvsCustIp("192.168.0.1");
avsCheck.SetAvsCustPhone("5556667777");
CvdInfo cvdCheck = new CvdInfo();
cvdCheck.SetCvdIndicator("1");
cvdCheck.SetCvdValue("099");
ResPreauthCC resPreauthCC = new ResPreauthCC();
resPreauthCC.SetDataKey(data_key);
resPreauthCC.SetOrderId(order_id);
resPreauthCC.SetCustId(cust_id);
resPreauthCC.SetAmount(amount);
resPreauthCC.SetCryptType(crypt_type);
resPreauthCC.SetAvsInfo(avsCheck);
resPreauthCC.SetCvdInfo(cvdCheck);
resPreauthCC.SetCofInfo(cof);
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(resPreauthCC);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("AVSResponse = " + receipt.GetAvsResultCode());
Console.WriteLine("CVDResponse = " + receipt.GetCvdResultCode());
Console.WriteLine("ITDResponse = " + receipt.GetITDResponse());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("Masked Pan = " + receipt.GetResDataMaskedPan());
Console.WriteLine("Exp Date = " + receipt.GetResDataExpdate());
Console.WriteLine("Crypt Type = " + receipt.GetResDataCryptType());
Console.WriteLine("Avs Street Number = " + receipt.GetResDataAvsStreetNumber());
Console.WriteLine("Avs Street Name = " + receipt.GetResDataAvsStreetName());
Console.WriteLine("Avs Zipcode = " + receipt.GetResDataAvsZipcode());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Transaction Values
Purchase object mandatory values
Purchase optional values
CvdInfo object mandatory values
AvsInfo object mandatory values
CVD & AVS Response Fields
Vault Response Fields
Purchase with Vault and 3-D Secure
This transaction uses the data key to identify a previously registered credit card profile. The details saved within the profile are then submitted to perform a Purchase transaction
The Purchase with 3-D Secure transaction follows a 3-D Secure MPI authentication. After receiving confirmation from the MPI ACS transaction, this Purchase verifies funds on the customer’s card, removes the funds and prepares them for deposit into the merchant’s account.
To perform the 3-D Secure authentication, the Moneris MPI or any 3rd party MPI may be used.
In addition to 3-D Secure transactions, this transaction can also be used to process Apple Pay and Google Pay™ transactions. This transaction is applicable only if choosing to integrate directly to Apple Wallet or Google Wallet (if not using the Moneris Apple Pay or Google Pay™ SDKs).
Refer to Apple or Google developer portals for details on integrating directly to their wallets to retrieve the payload data.
NOTE: Moneris strongly discourages the use of frames as part of a 3-D Secure implementation, and cannot guarantee their reliability when processing transactions in the production environment.
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResCavvPurchaseCC
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
string data_key = "4INQR1A8ocxD0oafSz50LADXy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string amount = "1.00";
string cust_id = "customer1"; //if sent will be submitted, otherwise cust_id from profile will be used
string cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA";
string expdate = "1911";
string processing_country_code = "CA";
bool status_check = false;
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("168451306048014");
ResCavvPurchaseCC resCavvPurchaseCC = new ResCavvPurchaseCC();
resCavvPurchaseCC.SetOrderId(order_id);
resCavvPurchaseCC.SetDataKey(data_key);
resCavvPurchaseCC.SetCustId(cust_id);
resCavvPurchaseCC.SetAmount(amount);
resCavvPurchaseCC.SetCavv(cavv);
//resCavvPurchaseCC.SetExpDate(expdate); //mandatory for temp token only
resCavvPurchaseCC.SetCofInfo(cof);
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(resCavvPurchaseCC);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
//ResolveData
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("Masked Pan = " + receipt.GetResDataMaskedPan());
Console.WriteLine("Exp Date = " + receipt.GetResDataExpdate());
Console.WriteLine("Crypt Type = " + receipt.GetResDataCryptType());
Console.WriteLine("Avs Street Number = " + receipt.GetResDataAvsStreetNumber());
Console.WriteLine("Avs Street Name = " + receipt.GetResDataAvsStreetName());
Console.WriteLine("Avs Zipcode = " + receipt.GetResDataAvsZipcode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Purchase with Vault and 3-D Secure - Transaction Values
ResCavvPurchaseCC resCavvPurchaseCC = new ResCavvPurchaseCC();
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resCavvPurchaseCC);
Mandatory Values
Optional Values
3-D Secure Response Fields
Vault Response Fields