My Profile_


MPI Overview

The MonerisMPI accepts requests for Verified by Visa (VbV), MasterCard Secure Code (MCSC) and SafeKey (Safekey). VBV, MCSC and SafeKey are programs based on the 3-D Secure Protocol to improve the security of online transactions.

These programs involve authentication of the cardholder during an online e-commerce transaction.
Authentication is based on the issuer’s selected method of authentication.
The following are examples of authentication methods:

  • Risk-based authentication
  • Dynamic passwords
  • Static passwords.

Some of the benefits of these programs are reduced risk of fraudulent transactions and protection against chargebacks for certain fraudulent transactions. Enrollment is required to participate in the VbV, Secure Code and SafeKey programs. Merchants must contact the Moneris Sales/Support Helpdesk to enroll into these programs.

Any of the transaction objects that are defined in this section can be passed to the HttpsPostRequest connection object defined below.

Additional eFraud features

To further decrease fraudulent activity, Moneris also recommends implementing the following features:

  • AVS: Address Verification Service
  • CVD: Card Validation Digits
  • TRMT: Transaction Risk Management Tool

MPI Flow

To further decrease fraudulent activity, Moneris also recommends implementing the following features:

  1. Cardholder enters the credit card number and submits the transaction information to the merchant.
  2. Upon receiving the transaction request, the merchant calls the MonerisMPI API and passes a TXN type request.
  3. The Moneris MPI receives the request, authenticates the merchant and sends the transaction information to Visa, MasterCard or AMEX.
  4. Visa/MasterCard/AMEX verifies that the card is enrolled and returns the issuer URL.
  5. Moneris MPI receives the response from Visa or MasterCard and forwards the information to the merchant.
  6. The MonerisMPI API installed at the merchant receives the response from the Moneris MPI. If the response is "Y" for enrolled, the merchant makes a call to the API, which opens a popup/inline window in the cardholder browser.

    If the response is “N” for not enrolled, a transaction could be sent to the processor identifying it as VBV/MCSC attempted with an ECI value of 6.

    If the response is “U” for unable to authenticate or the response times out, the transaction can be sent to the processor with an ECI value of 7. The merchant can then choose to continue with the transaction and be liable for a chargeback, or the merchant can choose to end the transaction.
  7. The cardholder browser uses the URL that was returned from Visa/MasterCard/AMEX via the merchant to communicate directly to the bank. The contents of the popup are loaded and the cardholder enters the PIN.
  8. The information is submitted to the bank and authenticated. A response is then returned to the client browser.
  9. The client browser receives the response from the bank, and forwards it to the merchant.
  10. The merchant receives the response information from the cardholder browser, and passes an ACS request type to the Moneris MPI API.
  11. Moneris MPI receives the ACS request and authenticates the information. The Moneris MPI then provides a CAVV value (getCavv() and an ECI value (GetMpiEci()) ) to the merchant.

    If the getSuccess() of the response is “true”, the merchant may proceed with the cavv purchase or cavv preauth.

    If the getSuccess() of the response is “false” and the getMessage() is “N”, the transaction must be cancelled because the cardholder failed to authenticate.

    If the getSuccess() of the response is “false” and the getMessage is “U”, the transaction can be processed as a normal purchase or PreAuth; however in this case the merchant assumes liability of a chargeback.

    If the response times out, the transaction can be processed as a normal purchase or PreAuth; however in this case the merchant assumes liability of a chargeback.
  12. The merchant retrieves the CAVV value and the ECI value, and formats a cavv purchase or a cavv preauth request using the method that is normally used. As part of this transaction method, the merchant must pass the CAVV value and the ECI value.

MPI Transaction

Sends the initial transaction data to the Moneris MPI to verify whether the card is enrolled. The browser returns a PARes as well as a success field.

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaMpiTxn
{
	public static void main(String[] args)
	{
		String store_id = "moneris";
		String api_token = "hurgle";
		String amount = "1.00";
		String xid = "12345678910111214037";
		String MD = xid + "mycardinfo" + amount;
		String merchantUrl = "www.mystoreurl.com";
		String accept = "true";
		String userAgent = "Mozilla";
		String processing_country_code = "CA";
		String pan = "4242424242424242";
		String expdate = "1905";
		boolean status_check = false;

		MpiTxn mpiTxn = new MpiTxn();
		mpiTxn.setXid(xid);
		mpiTxn.setPan(pan);
		mpiTxn.setExpDate(expdate);
		mpiTxn.setAmount(amount);
		mpiTxn.setMD(MD);
		mpiTxn.setMerchantUrl(merchantUrl);
		mpiTxn.setHttpAccept(accept);
		mpiTxn.setHttpUserAgent(userAgent);

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

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

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

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("MpiMessage = " + receipt.getMpiMessage());
			System.out.println("MpiSuccess = " + receipt.getMpiSuccess());

			if (receipt.getMpiSuccess().equals("true"))
			{
				System.out.println(receipt.getMpiInLineForm());
			}
			else 
			{
				System.out.println(receipt.getMessage());
			}

		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
} // end TestResMpiTxn

                
USA Code Sample

package USA;

import JavaAPI.*;

public class TestUSAMpiTxn
{
	public static void main(String[] args)
	{
		String store_id = "monusqa002";
		String api_token = "qatoken";
		String amount = "1.00";
		String xid = "12345678910111216007";
		String MD = xid + "mycardinfo" + amount;
		String merchantUrl = "www.mystoreurl.com";
		String accept = "true";
		String userAgent = "Mozilla";
		String processing_country_code = "US";
		String pan = "4242424242424242";
		String expdate = "1905";
		boolean status_check = false;

		MpiTxn mpiTxn = new MpiTxn();
		mpiTxn.setXid(xid);
		mpiTxn.setPan(pan);
		mpiTxn.setExpDate(expdate);
		mpiTxn.setAmount(amount);
		mpiTxn.setMD(MD);
		mpiTxn.setMerchantUrl(merchantUrl);
		mpiTxn.setHttpAccept(accept);
		mpiTxn.setHttpUserAgent(userAgent);

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

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

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

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("MpiMessage = " + receipt.getMpiMessage());
			System.out.println("MpiSuccess = " + receipt.getMpiSuccess());

			if (receipt.getMpiSuccess().equals("true"))
			{
				System.out.println(receipt.getMpiInLineForm());
			}

		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
} // end TestResMpiTxn

                

Sends the initial transaction data to the Moneris MPI to verify whether the card is enrolled.
The browser returns a PARes as well as a success field.

MpiTxn transaction object definition

MpiTxn mpiTxn = new MpiTxn();

HttpsPostRequest object for MpiTxn transaction

HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.setTransaction(mpiTxn);

MPI Transaction Object Mandatory Values

Value Type Limits Set Method
XID String 20-character alphanumeric mpiTxn.setXid(xid);
Credit Card number String 20-character numeric mpiTxn.setPan(pan);
Expiry date String 4-character alphanumeric (YYMM format) mpiTxn.setExpDate(expdate);
Amount String 9-character decimal Must contain at least 3 digits including two penny values. mpiTxn.setAmount(amount);
MD String 1024-character alphanumeric mpiTxn.setMD(MD);
Merchant URL String TBD mpiTxn.setMerchantUrl (merchantUrl);
Accept String TBD mpiTxn.setHttpAccept(accept);
User Agent String TBD mpiTxn.setHttpUserAgent (userAgent);

MPI ACS Request Transaction

Passes the PARes (received in the response to the TXN transaction) to the Moneris MPI API.

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaMpiAcs
{
	public static void main(String[] args)
	{
		String store_id = "moneris";
		String api_token = "hurgle";
		String amount = "1.00";
		String xid = "12345678910111214011";
		String MD = xid + "mycardinfo" + amount;
		String PaRes = "eJzFV9mSoloW/ZWMvI9EXQZBpIL0xmEGZR4E3xAREBCUUb++USuzsupWd1R3R0fnS8KKPa2z1z5u6L/Gsnjp40uTVae3V/RP5PUlPkXVPj"+
				"slb6+uI3xZvP61pJ30EsecHUfdJV7Satw0YRK/ZPu3VwSZIRiCEHOcwhcogRAohZLYHSVIDEOw2euSNoAVNw9rdDGnJssFPqHfki6nnH9iNPz+OkW/RGl"+
				"4apd0GJ0ZWVviBDqloOFvr3QZX2Ru+UNiGn6CNPzd2+juT81U75jtl6rjDprDE6oTXVUO3FTOnalHeVCP6hsN3y3ofdjGSwx5knhBya8Y8hWZ0fADp+t7"+
				"OFBW3RQbR9Ap5WeEnk7m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jow5WbamdPWzwPzNMa2c+5iev4"+
				"+pcRLsWxxkULH7f46penNHVfhxTL9h/yNZmEOyffzqKqtqK6d9pIEHZzBRQ8AkdWX6kWbASiT3WXjhzAQl3WPZK2EjCfZxkxr7HQVTtb/tN2DVRdRwPh+"+
				"52al35wPUKW0gC2cN730WOuZknOOeQB77nBNmFoIcTlIxH3SvO9zMQgAkZPr1xlHFZje/XofUVwdvF+mLDsUj0YNHiPDiIXeSi2ftzttC9+UyLgqt36CH"+
				"RiGkzPYO0iK+FiBRGQDEYxLKD27SfaOwEJ1hAl7Q8tkspUyUEQ/TntWNKy3GimCPSp2iSuAx0vJg1aoYg39lW7l2bh6nbv43247FD9zwvgWkj20nKql+L"+
				"/+sx+FRFz+YgjpNLTj8rV/Cs188kOPttvXNc8GsEDzEkqwU8woO11iwmZadFMGvzgo6DqSeK7C72QM0IReukhPwxVEojCCprCIuTbmWfA/qNtF8c5nLgo"+
				"6Dw5iZPSRuYGPa0eoOp6pF3FNXpw/Cqln4Bn7buzpuNT4zUJfA6mwD13us1Vcroyp1ZR3ubGJSX8FWXU6SODw693X0b6MKf99D4Y/d9PvW+viifXxt3z/"+
				"CPn+F/wPBKRo1";
		String processing_country_code = "CA";
		boolean status_check = false;

		MpiAcs mpiAcs = new MpiAcs();
		mpiAcs.setPaRes(PaRes);
		mpiAcs.setMD(MD);

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

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

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

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("MpiMessage = " + receipt.getMpiMessage());
			System.out.println("MpiSuccess = " + receipt.getMpiSuccess());

			if (receipt.getMpiSuccess().equals("true"))
			{
				System.out.println("CAVV = " + receipt.getMpiCavv());
                                System.out.println("Crypt Type = " + receipt.getMpiEci());
			}

		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
} // end TestResMpiTxn

                
USA Code Sample

package USA;

import JavaAPI.*;

public class TestUSAMpiAcs
{
	public static void main(String[] args)
	{
		String store_id = "monusqa006";
		String api_token = "qatoken";
		String amount = "1.00";
		String xid = "12345678910111214005";
		String MD = xid + "mycardinfo" + amount;
		String PaRes = "eJzFV2mTokoW/SsVNR+JbhZB5AXli2QHZd/9hoKAgKis+usHtau6Xk/NRM9MTAwRhsnxrnnPTW/Sf45V+dInlyavj2+v6Hfk9SU57uo4P6Zvr64jfFu8/rmkney"
					+ "SJJyd7LpLsqTVpGmiNHnJ47dXjCIwEpmT6ILCqZ8PiS0QnCIQ8nVJG8BKmocwupiTGDafzSb0h8/l5PI7RsPvr5Pxyy6Lju2SjnZnRtaWOIoiM4qGf7zSVXKRueVnvzT8xGj"
					+ "4p7LR3VfNFO2Yx0vdKYhPn5l6SAeNK1CV273R8F2CjqM2WWIISiAEMn9B8T8w8g98CuyB06e7OVDV3WQbnVEUgtDwZ4yeduYybdx1ucCnnz7e6GQ81cdkkphMfaxp+Gd4p+i"
					+ "4RD49BE5MCd1R2gmWdJtXn8NavIf1wOmmjdquWQIa/rGid1HfL1kAWCZ32ZJISwvPhdRcBeD5TOk+ROhkly+R+RTU9P3QAmVaX/I2q+6h/hWg4Xso8KOQS9rO0+Pk7JK8TNw"
					+ "5Nm+vWdue/oDhYRi+D7Pv9SWFsSkRGKHgSSBu8vRvr0+tJJaP+/rfUmOjY33Md1GZ36J2IoiatFkdv3zE9pUZx7pbQmGLZ79Npr7tUPz47Y4gM5SYbMJfG/2U2e94+TXYSxN"
					+ "9a7IIvTv4xdCStpJ9cmdE8uJa8tvr3z53ApenSdP+Jy7f3X228G7Pi8ouWbJcxHDIcZM0M7NrESU8pkRQYUJX4m/vek9JGv6I8UcCz2p92pWnoG5TSAjjJ7QqBH0O6Ysz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nRV0GEi9UGDXjwGakgtXKQj44igURpBUXhOXplpLgQd1/m7"
					+ "uX+ayoONgP+ZmD4k+bEwz2qnDqXqR9NTV6cOobhaBgd9iV8etJmAG6hJanW3geo+1+mpl1JWurKOtTUzsK9m6K0gSh0eHf/uiVeGfcyj8MZv+nFofd9rHbft+Cft8C/876Vc"
					+ "YIw==";
		String processing_country_code = "US";
		boolean status_check = false;

		MpiAcs mpiAcs = new MpiAcs();
		mpiAcs.setPaRes(PaRes);
		mpiAcs.setMD(MD);

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

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

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

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("MpiMessage = " + receipt.getMpiMessage());
			System.out.println("MpiSuccess = " + receipt.getMpiSuccess());
			System.out.println("Message = " + receipt.getMessage());

			if (receipt.getMpiSuccess().equals("true"))
			{
				System.out.println("Cavv = " + receipt.getMpiCavv());
                                System.out.println("Crypt Type = " + receipt.getMpiEci());
			}

		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
} // end TestResMpiTxn

                

MpiAcs transaction object definition

MpiAcs mpiAcs = new MpiAcs();

HttpsPostRequest object for MpiAcs transaction

HttpsPostRequest mpgReq = new HttpsPostRequest(); mpgReq.setTransaction(mpiAcs);

MpiACS transaction object mandatory values

Value Type Limits Set Method
XID String 20-character alphanumeric No set method
Amount String 9-character decimal
Must contain at least 3 digits including two penny values.
No set method
MD String 1024-character alphanumeric mpiAcs.setMD(MD);
  String TBD mpiAcs.setPaRes(PaRes);
 

Response Fields

VbV, MCSC and Safekey Responses

For each transaction, a crypt type is sent to identify whether it is a VbV, MCSC, Safekey-authenticated transaction.
Below are the tables defining the possible crypt types as well as the possible VARes and PARes responses.

Crypt type Visa definition MasterCard definition Safekey definition
5
  • Fully authenticated
  • There is a liability shift, and the merchant is protected from chargebacks
    • Fully authenticated
    • There is a liability shift, and the merchant is protected from chargebacks
      • Fully authenticated
      • There is a liability shift, and the merchant is protected from chargebacks
        6
        • VbV has been attempted
        • There is a liability shift, and the merchant is protected from certain chargebacks on fraudulent transactions
          • MCSC has been attempted
          • There is a liability shift, and the merchant is protected from certain chargebacks on fraudulent transactions
            • Safekey has been attempted
            • There is a liability shift, and the merchant is protected from certain chargebacks on fraudulent transactions
              7
              • Non-VbV transaction
              • No liability shift
              • Merchant is not protected from chargebacks
                • Non-MCSC transaction
                • No liability shift
                • Merchant is not protected from chargebacks
                  • Non-Safekey transaction
                  • No liability shift
                  • Merchant is not protected from chargebacks

                    VERes response definitions

                    VERes Response Response Definitions
                    N The card/issuer is not enrolled. Sent as a normal Purchase/PreAuth transaction with a crypt type of 6.
                    U The card type is not participating in VbV, MCSC and Safekey. It could be corporate card or another card plan that Visa or MasterCard excludes. Proceed with a regular transaction with a crypt type of 7 or cancel the transaction.
                    Y The card is enrolled. Proceed to create the VbV/MCSC/Safekey inline window for cardholder authentication. Proceed to PARes for crypt type.

                    PARes response definitions

                    PARes response Response definition
                    A Attempted to verify PIN, and will receive a CAVV. Send as a cavv_purchase/cavv_preAuth, which returns a crypt type of 6.
                    Y Fully authenticated, and will receive a CAVV. Send as a cavv_purchase/cavv_preAuth which will return a crypt type of 5.
                    N Failed to authenticate. No CAVV is returned. Cancel transaction. Merchant may proceed with a crypt type of 7 although this is strongly discouraged.

                    CAVV transaction handling

                    Step 1:  VERes Cardholder/issuer enrolled? Step 2: PARes VbV/MCSC InLine window response Step 3: Transaction Are you protected?
                    Y Y Send a CAVV transaction
                    Y N Cancel transaction. Authentication failed or high-risk transaction.
                    Y A Send a CAVV transaction
                    U n/a Send a regular transaction with a crypt type of 7
                    N n/a Send a regular transaction with a crypt type of 6

                    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.

                    The Moneris MPI accepts requests for Verified by Visa (VbV), MasterCard Secure Code (MCSC) and American Express SafeKey. VBV, MCSC and SafeKey are programs based on the 3-D Secure Protocol to improve the security of online transactions. These programs involve authentication of the cardholder during an online e-commerce transaction. Authentication is based on the issuer’s selected method of authentication.

                    The following are examples of authentication methods:

                    • Risk-based authentication
                    • Dynamic passwords
                    • Static passwords

                    Some of the benefits of these programs are reduced risk of fraudulent transactions and protection against chargebacks for certain fraudulent transactions. Enrollment is required to participate in the VbV, Secure Code and SafeKey programs. Merchants must contact the Moneris Sales/Support Helpdesk to enroll into these programs.

                    Canada Code Sample
                    
                    package Canada;
                    
                    import JavaAPI.*;
                    
                    public class TestCanadaCavvPurchase
                    {
                    	public static void main(String[] args)
                    	{
                    		String store_id = "store5";
                    		String api_token = "yesguy";
                    		java.util.Date createDate = new java.util.Date();
                    		String order_id = "Test"+createDate.getTime();
                    		String cust_id = "CUS887H67";
                    		String amount = "10.42";
                    		String pan = "4242424242424242";
                    		String expdate = "1901"; //YYMM
                    		String cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA=";
                    		String dynamic_descriptor = "123456";
                    		String processing_country_code = "CA";
                    		String crypt_type = "5";
                    		boolean status_check = false;
                    
                    		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 only
                    		cavvPurchase.setDynamicDescriptor(dynamic_descriptor);
                    		//cavvPurchase.setWalletIndicator("APP"); //set only for wallet transactions. e.g APPLE PAY
                    
                    		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();
                    
                    			System.out.println("CardType = " + receipt.getCardType());
                    			System.out.println("TransAmount = " + receipt.getTransAmount());
                    			System.out.println("TxnNumber = " + receipt.getTxnNumber());
                    			System.out.println("ReceiptId = " + receipt.getReceiptId());
                    			System.out.println("TransType = " + receipt.getTransType());
                    			System.out.println("ReferenceNum = " + receipt.getReferenceNum());
                    			System.out.println("ResponseCode = " + receipt.getResponseCode());
                    			System.out.println("ISO = " + receipt.getISO());
                    			System.out.println("BankTotals = " + receipt.getBankTotals());
                    			System.out.println("Message = " + receipt.getMessage());
                    			System.out.println("AuthCode = " + receipt.getAuthCode());
                    			System.out.println("Complete = " + receipt.getComplete());
                    			System.out.println("TransDate = " + receipt.getTransDate());
                    			System.out.println("TransTime = " + receipt.getTransTime());
                    			System.out.println("Ticket = " + receipt.getTicket());
                    			System.out.println("TimedOut = " + receipt.getTimedOut());
                    			System.out.println("CavvResultCode = " + receipt.getCavvResultCode());
                    		}
                    		catch (Exception e)
                    		{
                    			e.printStackTrace();
                    		}
                    	}
                    }
                    
                    
                                    
                    USA Code Sample
                    
                    package USA;
                    
                    import JavaAPI.*;
                    
                    public class TestUSACavvPurchase
                    {
                    	public static void main(String[] args)
                    	{
                    		String store_id = "monusqa002";
                    		String api_token = "qatoken";
                    		java.util.Date createDate = new java.util.Date();
                    		String order_id = "Test"+createDate.getTime();
                    		String cust_id = "B_Urlac_54";
                    		String amount = "10.42";
                    		String pan = "4005554444444403";
                    		String expdate = "1901";        //YYMM format
                    		String cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA";
                    		String crypt_type = "5";
                    		String commcard_invoice = "COINV982";
                    		String commcard_tax_amount = "1.00";
                    		String dynamic_descriptor = "my descriptor";
                    		String processing_country_code = "US";
                    		boolean status_check = false;
                    
                    		AvsInfo avsCheck = new AvsInfo();
                    		avsCheck.setAvsStreetNumber("212");
                    		avsCheck.setAvsStreetName("Payton Street");
                    		avsCheck.setAvsZipCode("M1M1M1");
                    
                    		CvdInfo cvdCheck = new CvdInfo();
                    		cvdCheck.setCvdIndicator("1");
                    		cvdCheck.setCvdValue("099");
                    
                    		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 only
                    		cavvPurchase.setDynamicDescriptor(dynamic_descriptor);
                    		cavvPurchase.setCommcardInvoice(commcard_invoice);
                    		cavvPurchase.setCommcardTaxAmount(commcard_tax_amount);
                    		cavvPurchase.setAvsInfo(avsCheck);
                    		cavvPurchase.setCvdInfo(cvdCheck);
                    
                    		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();
                    
                    			System.out.println("CardType = " + receipt.getCardType());
                    			System.out.println("TransAmount = " + receipt.getTransAmount());
                    			System.out.println("TxnNumber = " + receipt.getTxnNumber());
                    			System.out.println("ReceiptId = " + receipt.getReceiptId());
                    			System.out.println("TransType = " + receipt.getTransType());
                    			System.out.println("ReferenceNum = " + receipt.getReferenceNum());
                    			System.out.println("ResponseCode = " + receipt.getResponseCode());
                    			System.out.println("ISO = " + receipt.getISO());
                    			System.out.println("BankTotals = " + receipt.getBankTotals());
                    			System.out.println("Message = " + receipt.getMessage());
                    			System.out.println("AuthCode = " + receipt.getAuthCode());
                    			System.out.println("Complete = " + receipt.getComplete());
                    			System.out.println("TransDate = " + receipt.getTransDate());
                    			System.out.println("TransTime = " + receipt.getTransTime());
                    			System.out.println("Ticket = " + receipt.getTicket());
                    			System.out.println("TimedOut = " + receipt.getTimedOut());
                    			System.out.println("Avs Response = " + receipt.getAvsResultCode());
                    			System.out.println("Cvd Response = " + receipt.getCvdResultCode());
                    			//System.out.println("CardLevelResult = " + receipt.getCardLevelResult());
                    			System.out.println("CavvResultCode = " + receipt.getCavvResultCode());
                    			//System.out.println("StatusCode = " + receipt.getStatusCode());
                    			//System.out.println("StatusMessage = " + receipt.getStatusMessage());
                    		}
                    		catch (Exception e)
                    		{
                    			e.printStackTrace();
                    		}
                    	}
                    }
                    
                    
                                    

                    Purchase with 3-D Secure - Transaction

                    CavvPurchase cavvPurchase = new CavvPurchase();

                    HttpsPostRequest mpgReq = new HttpsPostRequest();

                    mpgReq.setTransaction(cavvPurchase);

                    Purchase object mandatory values

                    Value Type Limits Set method Description
                    Order ID String 50-character alphanumeric cavvPurchase.setOrderId(order_id); Merchant-defined transaction identifier that must be unique for every Purchase, PreAuth and Independent Refund transaction. No two transactions of these may have the same order ID.
                    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 cavvPurchase.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.
                    Credit card number String 20-character numeric cavvPurchase.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.
                    cavvPurchase.setExpdate(expdate); Submit in YYMM format.
                    Note: This is the reverse of the date displayed on the physical card, which is MMYY.
                    Cardholder Authentication Verification Value(CAVV) String 50-character alphanumeric cavvPurchase.setCavv(cavv); Value provided by the Moneris MPI or by a third-party MPI. It is part of a Verified by Visa (VbV), MasterCard SecureCode (MCSC) or American Express SafeKey transaction.

                    Purchase optional values

                    Value Type Limits Set method Description
                    Status Check Boolean true/false mpgReq.setStatusCheck (status_check); Status Check is a connection object value that allows merchants to verify whether a previously sent transaction was processed successfully. To submit a Status Check request, resend the original transaction with all the same parameter values, but set the status check value to either true or false. Once set to “true”, the gateway will check the status of a transaction that has an order_id that matches the one passed.
                    • If the transaction is found, the gateway will respond with the specifics of that transaction.
                    • If the transaction is not found, the gateway will respond with a not found message.
                    • Once it is set to “false”, the transaction will process as a new transaction.
                    Things to consider:
                    • The Status Check request should only be used once and immediately (within 2 minutes) after the last transaction that had failed.
                    • Do not resend the Status Check request if it has timed out. Additional investigation is required.
                    Customer ID String 50-character alphanumeric cavvPurchase.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.
                    Dynamic descriptor String 20-character alphanumeric cavvPurchase.setDynamicDescriptor ("2134565"); Merchant defined description sent on a per-transaction basis that will appear on the credit card statement appended to the merchant’s business name.
                    The combined length of the merchant’s business name and dynamic_descriptor may not exceed 25 characters.
                    Commercial card invoice String 17-character alphanumeric cavvPurchase.setCommcardInvoice (commcard_invoice); Available to US integrations only. Level 2 Invoice Number for the transaction used for Corporate Credit Card transactions (Commercial Purchasing Cards). Characters allowed for commcard_invoice: a-z A-Z 0-9 spaces
                    Commercial card tax amount String 9-character decimal cavvPurchase.setCommcardTaxAmount (commcard_tax_amount); Available to US integrations only. Level 2 Tax Amount of the transaction used for Corporate Credit Card transactions (Commercial Purchasing Cards). This must contain 3 digits with two penny values. The minimum value passed can be 0.00 and the maximum is 9999999.99
                    Customer Information Object CustInfo customer = new CustInfo();
                    cavvPurchase.setCustInfo(customer);
                    Refer below for further breakdown and definition.
                    AVS Information Object AvsInfo avsCheck = new AvsInfo();
                    cavvPurchase.setAvsInfo(avsCheck);
                    Refer below for further breakdown and definition.
                    CVD Information Object CvdInfo cvdCheck = new CvdInfo();
                    cavvPurchase.setCvdInfo(cvdCheck);
                    Refer below for further breakdown and definition.
                    Convenience Fee Object ConvFeeInfo convFeeInfo = new ConvFeeInfo();
                    cavvPurchase.setConvFeeInfo(convFeeInfo);
                    Refer below for further breakdown and definition.
                    Please note, if the Convenience Fee is set, then Recurring Billing is not supported.

                    3-D Secure Response Fields

                    Value Limits Get Method Description
                    CAVV result code 1-character alphanumeric receipt.getCavvResultCode(); Indicates the Verified by Visa CAVV result. Possible response codes are shown in the CAVV Result Code table.

                    ECI

                    1- character numeric

                    receipt.GetMpiEci();

                    Supported values are:

                    • 5 - Authenticated e-commerce transaction (VBV,MCSC,Amex SafeKey)
                    • 6 - Non-authenticated e-commerce transaction (VBV,MCSC,Amex SafeKey)
                    • 7 - SSL-enabled merchant

                      ECI must be sent in crypt type field for cavv_purchase and cavv_preauth requests.


                    Predecessors
                    • None
                    Successors

                    Pre-Authorization with 3-D Secure

                    The Pre-Authorization with 3-D Secure transaction follows a 3-D Secure MPI authentication. After receiving confirmation from the MPI ACS transaction, this Pre-Authorization 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.

                    The Moneris MPI accepts requests for Verified by Visa (VbV), MasterCard Secure Code (MCSC) and American Express SafeKey. VBV, MCSC and SafeKey are programs based on the 3-D Secure Protocol to improve the security of online transactions. These programs involve authentication of the cardholder during an online e-commerce transaction. Authentication is based on the issuer’s selected method of authentication.

                    The following are examples of authentication methods:

                    • Risk-based authentication
                    • Dynamic passwords
                    • Static passwords.

                    Some of the benefits of these programs are reduced risk of fraudulent transactions and protection against chargebacks for certain fraudulent transactions. Enrollment is required to participate in the VbV, Secure Code and SafeKey programs. Merchants must contact the Moneris Sales/Support Helpdesk to enroll into these programs.

                    Canada Code Sample
                    
                    package Canada;
                    
                    import JavaAPI.*;
                    
                    public class TestCanadaCavvPreauth
                    {
                    	public static void main(String[] args)
                    	{
                    		String store_id = "store5";
                    		String api_token = "yesguy";
                    		java.util.Date createDate = new java.util.Date(); 
                    		String order_id = "Test"+createDate.getTime();
                    		String cust_id = "CUS887H67";
                    		String amount = "10.42";
                    		String pan = "4242424242424242";
                    		String expdate = "1911"; //YYMM format
                    		String cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA=";
                    		String dynamic_descriptor = "123456";
                    		String processing_country_code = "CA";
                    		boolean status_check = false;
                    
                    		CavvPreAuth cavvPreauth = new CavvPreAuth();
                    		cavvPreauth.setOrderId(order_id);
                    		cavvPreauth.setCustId(cust_id);
                    		cavvPreauth.setAmount(amount);
                    		cavvPreauth.setPan(pan);
                    		cavvPreauth.setExpdate(expdate);
                    		cavvPreauth.setCavv(cavv);
                    		cavvPreauth.setDynamicDescriptor(dynamic_descriptor);
                    
                    		HttpsPostRequest mpgReq = new HttpsPostRequest();
                    		mpgReq.setProcCountryCode(processing_country_code);
                    		mpgReq.setTestMode(true); //false or comment out this line for production transactions
                    		mpgReq.setStoreId(store_id);
                    		mpgReq.setApiToken(api_token);
                    		mpgReq.setTransaction(cavvPreauth);
                    		mpgReq.setStatusCheck(status_check);
                    		mpgReq.send();
                    
                    		try
                    		{
                    			Receipt receipt = mpgReq.getReceipt();
                    
                    			System.out.println("CardType = " + receipt.getCardType());
                    			System.out.println("TransAmount = " + receipt.getTransAmount());
                    			System.out.println("TxnNumber = " + receipt.getTxnNumber());
                    			System.out.println("ReceiptId = " + receipt.getReceiptId());
                    			System.out.println("TransType = " + receipt.getTransType());
                    			System.out.println("ReferenceNum = " + receipt.getReferenceNum());
                    			System.out.println("ResponseCode = " + receipt.getResponseCode());
                    			System.out.println("ISO = " + receipt.getISO());
                    			System.out.println("BankTotals = " + receipt.getBankTotals());
                    			System.out.println("Message = " + receipt.getMessage());
                    			System.out.println("AuthCode = " + receipt.getAuthCode());
                    			System.out.println("Complete = " + receipt.getComplete());
                    			System.out.println("TransDate = " + receipt.getTransDate());
                    			System.out.println("TransTime = " + receipt.getTransTime());
                    			System.out.println("Ticket = " + receipt.getTicket());
                    			System.out.println("TimedOut = " + receipt.getTimedOut());
                    			System.out.println("CavvResultCode = " + receipt.getCavvResultCode());
                    		}
                    		catch (Exception e)
                    		{
                    			e.printStackTrace();
                    		}
                    	}
                    }
                    
                                    
                    USA Code Sample
                    
                    package USA;
                    
                    import JavaAPI.*;
                    
                    public class TestUSACavvPreAuth
                    {
                    	public static void main(String[] args)
                    	{
                    		String store_id = "monusqa002";
                    		String api_token = "qatoken";
                    		java.util.Date createDate = new java.util.Date();
                    		String order_id = "Test"+createDate.getTime();
                    		String cust_id = "B_Urlac_54";
                    		String amount = "1.00";
                    		String pan = "4242424242424242";
                    		String expdate = "1902";        //YYMM format
                    		String cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA";
                    		String dynamic_descriptor = "123456";
                    		String processing_country_code = "US";
                    		boolean status_check = false;
                    
                    		AvsInfo avsCheck = new AvsInfo();
                    		avsCheck.setAvsStreetNumber("212");
                    		avsCheck.setAvsStreetName("Payton Street");
                    		avsCheck.setAvsZipCode("M1M1M1");
                    
                    		CvdInfo cvdCheck = new CvdInfo();
                    		cvdCheck.setCvdIndicator("1");
                    		cvdCheck.setCvdValue("099");
                    
                    		CavvPreAuth cavvPreauth = new CavvPreAuth();
                    		cavvPreauth.setOrderId(order_id);
                    		cavvPreauth.setCustId(cust_id);
                    		cavvPreauth.setAmount(amount);
                    		cavvPreauth.setPan(pan);
                    		cavvPreauth.setExpdate(expdate);
                    		cavvPreauth.setCavv(cavv);
                    		cavvPreauth.setDynamicDescriptor(dynamic_descriptor);
                    		cavvPreauth.setAvsInfo(avsCheck);
                    		cavvPreauth.setCvdInfo(cvdCheck);
                    
                    		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(cavvPreauth);
                    		mpgReq.setStatusCheck(status_check);
                    		mpgReq.send();
                    
                    		try
                    		{
                    			Receipt receipt = mpgReq.getReceipt();
                    
                    			System.out.println("CardType = " + receipt.getCardType());
                    			System.out.println("TransAmount = " + receipt.getTransAmount());
                    			System.out.println("TxnNumber = " + receipt.getTxnNumber());
                    			System.out.println("ReceiptId = " + receipt.getReceiptId());
                    			System.out.println("TransType = " + receipt.getTransType());
                    			System.out.println("ReferenceNum = " + receipt.getReferenceNum());
                    			System.out.println("ResponseCode = " + receipt.getResponseCode());
                    			System.out.println("ISO = " + receipt.getISO());
                    			System.out.println("BankTotals = " + receipt.getBankTotals());
                    			System.out.println("Message = " + receipt.getMessage());
                    			System.out.println("AuthCode = " + receipt.getAuthCode());
                    			System.out.println("Complete = " + receipt.getComplete());
                    			System.out.println("TransDate = " + receipt.getTransDate());
                    			System.out.println("TransTime = " + receipt.getTransTime());
                    			System.out.println("Ticket = " + receipt.getTicket());
                    			System.out.println("TimedOut = " + receipt.getTimedOut());
                    			System.out.println("Avs Response = " + receipt.getAvsResultCode());
                    			System.out.println("Cvd Response = " + receipt.getCvdResultCode());
                    			//System.out.println("CardLevelResult = " + receipt.getCardLevelResult());
                    			System.out.println("CavvResultCode = " + receipt.getCavvResultCode());
                    		}
                    		catch (Exception e)
                    		{
                    			e.printStackTrace();
                    		}
                    	}
                    }
                    
                                    

                    Pre-Authorization with 3-D Secure - Transaction

                    CavvPreAuth cavvPreauth = new CavvPreAuth();

                    HttpsPostRequest mpgReq = new HttpsPostRequest();

                    mpgReq.setTransaction(cavvPreauth);

                    Pre-Authorization with 3-D Secure object mandatory values

                    Value Type Limits Set method Description
                    Order ID String 50-character alphanumeric cavvPreauth.setOrderId(order_id); Merchant-defined transaction identifier that must be unique for every Purchase, PreAuth and Independent Refund transaction. No two transactions of these may have the same order ID.
                    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 cavvPreauth.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.
                    Credit card number String 20-character numeric cavvPreauth.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.
                    cavvPreauth.setExpdate(expdate); Submit in YYMM format.
                    Note: This is the reverse of the date displayed on the physical card, which is MMYY.
                    Cardholder Authentication Verification Value(CAVV) String 50-character alphanumeric cavvPreauth.setCavv(cavv); Value provided by the Moneris MPI or by a third-party MPI. It is part of a Verified by Visa (VbV), MasterCard SecureCode (MCSC) or American Express SafeKey transaction.

                    Pre-Authorization with 3-D Secure optional values

                    Value Type Limits Set method Description
                    Status Check Boolean true/false mpgReq.setStatusCheck (status_check); Status Check is a connection object value that allows merchants to verify whether a previously sent transaction was processed successfully. To submit a Status Check request, resend the original transaction with all the same parameter values, but set the status check value to either true or false. Once set to “true”, the gateway will check the status of a transaction that has an order_id that matches the one passed.
                    • If the transaction is found, the gateway will respond with the specifics of that transaction.
                    • If the transaction is not found, the gateway will respond with a not found message.
                    • Once it is set to “false”, the transaction will process as a new transaction.
                    Things to consider:
                    • The Status Check request should only be used once and immediately (within 2 minutes) after the last transaction that had failed.
                    • Do not resend the Status Check request if it has timed out. Additional investigation is required.
                    Customer ID String 50-character alphanumeric cavvPreauth.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.
                    Dynamic descriptor String 20-character alphanumeric cavvPreauth.setDynamicDescriptor ("2134565"); Merchant defined description sent on a per-transaction basis that will appear on the credit card statement appended to the merchant’s business name.
                    The combined length of the merchant’s business name and dynamic_descriptor may not exceed 25 characters.
                    AVS Information Object AvsInfo avsCheck = new AvsInfo();
                    cavvPreauth.setAvsInfo(avsCheck);
                    Refer below for further breakdown and definition.
                    CVD Information Object CvdInfo cvdCheck = new CvdInfo();
                    cavvPreauth.setCvdInfo(cvdCheck);
                    Refer below for further breakdown and definition.

                    3-D Secure Response Fields

                    Value Limits Get Method Description
                    CAVV result code 1-character alphanumeric receipt.getCavvResultCode(); Indicates the Verified by Visa CAVV result. Possible response codes are shown in the CAVV Result Code table.

                    ECI

                    1- character numeric

                    receipt.GetMpiEci();

                    Supported values are:

                    • 5 - Authenticated e-commerce transaction (VBV,MCSC,Amex SafeKey)
                    • 6 - Non-authenticated e-commerce transaction (VBV,MCSC,Amex SafeKey)
                    • 7 - SSL-enabled merchant

                      ECI must be sent in crypt type field for cavv_purchase and cavv_preauth requests.


                    Predecessors
                    • NA
                    Successors
                    • Pre-Authorization Completion ( API | Batch File)
                    • Vault Tokenize Credit Card ( API )