My Profile_


Card Verification with CVD & AVS

Verifies the validity of the credit card, expiry date and any additional details (such as the Card Verification Digits or Address Verification details). It does not verify the available amount or lock any funds on the credit card.

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 and American Express.
  • 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 and AVS Result Code tables.

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.

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaCardVerification
{
	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 pan = "4242424242424242";
		String expdate = "1901"; //YYMM format
		String crypt = "7";
		String processing_country_code = "CA";
		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");

		CardVerification cardVerification = new CardVerification();
		cardVerification.setOrderId(order_id);
		cardVerification.setPan(pan);
		cardVerification.setExpdate(expdate);
		cardVerification.setCryptType(crypt);
		cardVerification.setAvsInfo(avsCheck);
		cardVerification.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(cardVerification);
		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("IsVisaDebit = " + receipt.getIsVisaDebit());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

                
USA Code Sample

package USA;

import JavaAPI.*;

public class TestUSACardVerification
{
	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 = "customer1";
		String pan = "4242424242424242";
		String expiry_date = "1901"; //YYMM format
		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");

		CardVerification cardVerification = new CardVerification();
		cardVerification.setOrderId(order_id);
		cardVerification.setCustId(cust_id);
		cardVerification.setPan(pan);
		cardVerification.setExpdate(expiry_date);
		cardVerification.setAvsInfo(avsCheck);
		cardVerification.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(cardVerification);
		mpgReq.setStatusCheck(status_check);
		mpgReq.send();

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("CardType = " + receipt.getCardType());
			System.out.println("TransAmount = " + receipt.getTransAmount());
			System.out.println("TxnNumber = " + receipt.getTxnNumber());
			System.out.println("ReceiptId = " + receipt.getReceiptId());
			System.out.println("TransType = " + receipt.getTransType());
			System.out.println("ReferenceNum = " + receipt.getReferenceNum());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("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("CardLevelResult = " + receipt.getCardLevelResult());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

                

Card Verification transaction object definition

CardVerification cardVerification = new CardVerification();

HttpsPostRequest object for Card Verification transaction

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(cardVerification);

Card Verification transaction object mandatory values

Value Type Limits Set method Description
Order ID String 50-character alphanumeric cardVerification.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.
Credit card number String 20-character alphanumeric cardVerification.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 alphanumeric
(YYMM format)
cardVerification.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 cardVerification.setCryptType(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

Card Verification transaction object conditional values

Value Type Limits Set method Description
AVS Object Not applicable. cardVerification.setAvsInfo(avsCheck); Note:AVS & CVD are mandatory for US. It is optional for Canada. Refer below for further breakdown and definition.
CVD Object Not applicable. cardVerification.setCvdInfo(cvdCheck); Note:AVS & CVD are mandatory for US. It is optional for Canada. Refer below for further breakdown and definition.
CvdInfo object mandatory values
Value Type Limits Set method Description
CVD indicator String 1-character numeric cvdCheck.setCvdIndicator("1"); CVD presence indicator:
0: CVD value is deliberately bypassed or is not provided by the merchant.
1: CVD value is present.
2: CVD value is on the card, but is illegible.
9: Cardholder states that the card has no CVD imprint.
CVD Value String 4-character numeric cvdCheck.setCvdValue("099"); CVD value located on credit card. The CVD value (supplied by the cardholder) must only be passed to the payment gateway. Under no circumstances may it be stored for subsequent use or displayed as part of the receipt information.

AvsInfo object mandatory values
Value Type Limits Set method Description
AVS street number String 19-character alphanumeric1 avsCheck.setAvsStreetNumber("212"); Cardholder street number.
AVS street name String See AVS street number avsCheck.setAvsStreetName("Payton Street"); Cardholder street name.
AVS zip/postal code String 9-character alphanumeric avsCheck.setAvsZipCode("M1M1M1"); . Cardholder zip/postal code

CVD & AVS Response Fields

Value Limits Get Method Description
CVD result code 2-character alphanumeric receipt.getCvdResultCode(); Indicates the CVD validation result. The first byte is the numeric CVD indicator sent in the request; the second byte is the response code. Possible response codes are shown in the CVD Result Code table.
AVS result code 1-character alphanumeric receipt.getAvsResultCode(); Indicates the address verification result. For a full list of possible response codes refer to the AVS Result Code table.

Predecessors
  • NA
Successors


Card Verification 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 Card Verification 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 processing a Card Verification using a temporary token versus 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 submit the Card Verification.

Canada Code Sample

package Canada;
import java.io.*;

import JavaAPI.*;

public class TestCanadaResCardVerificationCC
{
  public static void main(String args[]) throws IOException
  {

        String store_id = "store5";
        String api_token = "yesguy";
        String data_key = "AoG4zAFzlFFfxcVmzWAZVQuhj";
        java.util.Date createDate = new java.util.Date(); 
		String order_id = "Test"+createDate.getTime();
        String crypt_type = "7";
        String processing_country_code = "CA";
        boolean status_check = false;

/********************** Efraud Variables ************************/
		AvsInfo avs = new AvsInfo ();
		avs.setAvsStreetName("test ave");
		avs.setAvsStreetNumber("123");
		avs.setAvsZipcode("123456");

        CvdInfo cvd = new CvdInfo ("1", "099");

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

        ResCardVerificationCC resCardVerificationCC = new ResCardVerificationCC();
        resCardVerificationCC.setDataKey(data_key);
        resCardVerificationCC.setOrderId(order_id);
        resCardVerificationCC.setCryptType(crypt_type);
        resCardVerificationCC.setAvsInfo(avs);
        resCardVerificationCC.setCvdInfo(cvd);

        //resCardVerificationCC.setExpdate("1412"); //For Temp Tokens 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(resCardVerificationCC);
		mpgReq.setStatusCheck(status_check);
		mpgReq.send();

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

	    try
        {
	    	Receipt resreceipt = mpgReq.getReceipt();

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

    		//Contents of ResolveData
    		System.out.println("Cust ID = " + resreceipt.getResCustId());
			System.out.println("Phone = " + resreceipt.getResPhone());
			System.out.println("Email = " + resreceipt.getResEmail());
			System.out.println("Note = " + resreceipt.getResNote());
			System.out.println("Masked Pan = " + resreceipt.getResMaskedPan());
			System.out.println("Exp Date = " + resreceipt.getResExpdate());
			System.out.println("Crypt Type = " + resreceipt.getResCryptType());
			System.out.println("Avs Street Number = " + resreceipt.getResAvsStreetNumber());
			System.out.println("Avs Street Name = " + resreceipt.getResAvsStreetName());
			System.out.println("Avs Zipcode = " + resreceipt.getResAvsZipcode());

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


                

Card Verification with Vault transaction object definition

ResCardVerificationCC resCardVerificationCC = new ResCardVerificationCC();

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(resCardVerificationCC);

Card Verification with Vault transaction object mandatory values

Value Type Limits Set method Description
Order ID String 50-character alphanumeric resCardVerification.setOrderId(order_id); Merchant-defined transaction identifier that must be unique for every transaction. No two transactions may have the same order ID
Data Key String 25-character alphanumeric resCardVerificationCC.setDataKey(data_key);

The data key is the token that points to a previously stored profile. Profile identifier that all future financial Vault transactions (that is, they occur after the profile was registered by a Vault Add Credit Card or Vault Tokenize Credit Card transaction, for example) will use to associate with the saved information.


The data key is generated by Moneris, and is returned to the merchant (via the Receipt object) when the profile is first registered.
E-commerce indicator
String 1-character alphanumeric
resCardVerificationCC.setCryptType(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

Card Verification with Vault transaction object conditional values

Value Type Limits Set method Description
 Expiry Date Sring 4-character alphanumeric (YYMM format) resCardVerificationCC.setExpdate(expdate); The optional Expiry Date applies to Hosted Tokenization transactions. If the expiry date was not collected by the Hosted Tokenization solution, then it must be set in the Vault transaction request – it is then a mandatory field.
AVS Object Not applicable. resCardVerification.setAvsInfo(avsCheck);

Note: AVS & CVD are mandatory for US. It is optional for Canada.

If the Vault profile already has AVS details stored on file, then AVS is optional and the AVS data stored in the profile will be used for the validation.
CVD Object Not applicable. resCardVerification.setCvdInfo(cvdCheck);

Note: AVS & CVD are mandatory for US. It is optional for Canada.

If the temporary token generated using Hosted Tokenization already has the CVD details, then CVD is optional and the CVD value collected in by Hosted Tokenization will be used for the validation.

CvdInfo object mandatory values
Value Type Limits Set method Description
CVD indicator String 1-character numeric cvdCheck.setCvdIndicator("1"); CVD presence indicator:
0: CVD value is deliberately bypassed or is not provided by the merchant.
1: CVD value is present.
2: CVD value is on the card, but is illegible.
9: Cardholder states that the card has no CVD imprint.
CVD Value String 4-character numeric cvdCheck.setCvdValue("099"); CVD value located on credit card. The CVD value (supplied by the cardholder) must only be passed to the payment gateway. Under no circumstances may it be stored for subsequent use or displayed as part of the receipt information.

AvsInfo object mandatory values
Value Type Limits Set method Description
AVS street number String 19-character alphanumeric1 avsCheck.setAvsStreetNumber("212"); Cardholder street number.
AVS street name String See AVS street number avsCheck.setAvsStreetName("Payton Street"); Cardholder street name.
AVS zip/postal code String 9-character alphanumeric avsCheck.setAvsZipCode("M1M1M1"); . Cardholder zip/postal code

Vault Response Fields

Value Limits Get Method Description
Data Key 25-character alphanumeric receipt.getDataKey(); This field is created when a profile is created and a token is returned.
It is a unique profile identifier, and is a required value for all future Vault transactions.
Vault Success true/false receipt.getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc/ach receipt.getPaymentType(); Indicates the payment type associated with a Vault profile.
Customer ID 30-character alphanumeric receipt.getResCustId(); Returns the customer ID saved in the profile.
Phone Number 30-character alphanumeric receipt.getResPhone(); Returns the phone number saved in the profile.
Email Address 30-character alphanumeric receipt.getResEmail(); Returns the email address saved in the profile.
Note 30-character alphanumeric receipt.getResNote(); Returns the note saved in the profile.
Credit Card Fields
Masked PAN 20-character numeric receipt.getResMaskedPan(); Returns the first 4 last 4 of the card number saved in the profile.
Expiry Date 4-character numeric receipt.getResExpdate(); Returns the expiry date of the card number saved in the profile. YYMM format.
E-Commerce Indicator 1-character numeric receipt.getResCryptType(); Returns the e-commerce indicator saved in the profile.
AVS Street Number 19-character alphanumeric receipt.getResAvsStreetNumber(); Returns the AVS street number saved in the profile. If no other AVS street number is passed in the transaction request, this value will be submitted along with the financial transaction to the issuer.
AVS Street Name 19-character alphanumeric receipt.getResAvsStreetName(); Returns the AVS street name saved in the profile. If no other AVS street number is passed in the transaction request, this value will be submitted along with the financial transaction to the issuer.
AVS Zip/Postal Code 9-character alphanumeric receipt.getResAvsZipcode(); Returns the AVS zip/postal code saved in the profile. If no other AVS street number is passed in the transaction request, this value will be submitted along with the financial transaction to the issuer.

Predecessors
Successors