My Profile_


Vault Add Credit Card

Creates a new credit card profile, and generates a unique data key which can be obtained from the Receipt object.

This data key is the profile identifier that all future financial Vault transactions will use to associate with the saved information

You need to send Purchase or Preauthorization or Card verification with Credential on File fields as the first transaction before you do Vault add Credit Card.

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaResAddCC
{
	public static void main(String[] args)
	{
		String store_id = "store5";
		String api_token = "yesguy";
		String pan = "4242424242424242";
		String expdate = "1912";
		String phone = "0000000000";
		String email = "bob@smith.com";
		String note = "my note";
		String cust_id = "customer1";
		String crypt_type = "7";
		String data_key_format = "0";
		String processing_country_code = "CA";
		boolean status_check = false;

		AvsInfo avsCheck = new AvsInfo();
		avsCheck.setAvsStreetNumber("212");
		avsCheck.setAvsStreetName("Payton Street");
		avsCheck.setAvsZipCode("M1M1M1");

		ResAddCC resaddcc = new ResAddCC();
		resaddcc.setPan(pan);
		resaddcc.setExpdate(expdate);
		resaddcc.setCryptType(crypt_type);
		resaddcc.setCustId(cust_id);
		resaddcc.setPhone(phone);
		resaddcc.setEmail(email);
		resaddcc.setNote(note);
		resaddcc.setAvsInfo(avsCheck);
		//resaddcc.setDataKeyFormat(data_key_format); //optional

		//Mandatory - Credential on File details
		CofInfo cof = new CofInfo();
		cof.setIssuerId("139X3130ASCXAS9"); //can be obtained by performing card verification
		
		resaddcc.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(resaddcc);
		mpgReq.setStatusCheck(status_check);
		mpgReq.send();

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("DataKey = " + receipt.getDataKey());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("ResSuccess = " + receipt.getResSuccess());
			System.out.println("PaymentType = " + receipt.getPaymentType());
			System.out.println("Cust ID = " + receipt.getResCustId());
			System.out.println("Phone = " + receipt.getResPhone());
			System.out.println("Email = " + receipt.getResEmail());
			System.out.println("Note = " + receipt.getResNote());
			System.out.println("MaskedPan = " + receipt.getResMaskedPan());
			System.out.println("Exp Date = " + receipt.getResExpdate());
			System.out.println("Crypt Type = " + receipt.getResCryptType());
			System.out.println("Avs Street Number = " + receipt.getResAvsStreetNumber());
			System.out.println("Avs Street Name = " + receipt.getResAvsStreetName());
			System.out.println("Avs Zipcode = " + receipt.getResAvsZipcode());
			System.out.println("IssuerId = " + receipt.getIssuerId());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

                

Vault Add Credit Card transaction object definition

ResAddCC resaddcc = new ResAddCC();

HttpsPostRequest object for Vault Add Credit Card transaction

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(resaddcc);

Vault Add Credit Card transaction object mandatory values

Value Type Limits Set method Description
Credit card number String 20-character alphanumeric resaddcc.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) resaddcc.setExpdate(expdate); Note: This is the reverse of the date displayed on the physical card, which is MMYY.
E-Commerce indicator String 1-character numeric resaddcc.setCryptType(crypt_type); 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

Vault Add Credit Card transaction object optional values

Value Type Limits Set method Description
Customer ID String 50-character alphanumeric resaddcc.setCustId(cust_id); This can be used for policy number, membership number, student ID, invoice number and so on.

This field is searchable from the Moneris Merchant Resource Centre.
AVS Information Object AvsInfo avsCheck = new AvsInfo();
resaddcc.setAvsInfo(avsCheck);
Refer below for further breakdown and definition.
Email address String 30-character alphanumeric resaddcc.setEmail(email); Email address of the customer. Can be sent in when creating or updating a Vault profile.
Phone Number String 30-character alphanumeric resaddcc.setPhone(phone); Phone number of the customer. Can be sent in when creating or updating a Vault profile.
Note String 30-character alphanumeric resaddcc.setNote(note); This optional field can be used for supplementary information to be sent in with the transaction. This field can be sent in when creating or updating a Vault profile.
COF Info Object cof.setPaymentIndicator(PaymentIndicator);
cof.setPaymentInformation(PaymentInformation);
cof.setIssuerId(IssuerID);
If you are doing a vault transaction (using a permanent token) the COF Info object is mandatory.
For Definitions of Request Fields of Credential on File please refer back to Purchase / Preauth with Credential on File section.

AvsInfo mandatory values

VALUE TYPE LIMITS VARIABLE DESCRIPTION
AVS street number String 19-character alphanumeric1 avs_street_number Cardholder street number.
AVS street name String See AVS street number avs_street_name Cardholder street name.
AVS zip/postal code String 9-character alphanumeric avs_zipcode 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 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.

Vault Update Credit Card

Updates an existing Vault profile (referencing the profile's unique data key) with cardholder information.

Information contained within a credit card profile is updated as indicated by the submitted fields; if any field representing an item of cardholder information is not sent in this request, that item will remain unchanged in the profile.

If the Vault profile is being updated with a new credit card number, then you first need to send a Purchase, Pre-Authorization or Card Verification transaction, with the Credential on File Info object included, before performing Vault Update Credit Card. If the credit card number is not one of the profile items being updated, this step is not required.

Things to Consider:

  • To update a specific element in the profile, set that element using the corresponding set method
  • When updating a credit card number, first send a Purchase, Pre-Authorization, or Card Verification with the Credential on File Info object before sending this transaction; send the issuer ID received in the response in the subsequent Vault Update Credit Card request
  • If the credit card number is not one of the profile items being updated, the Credential on File info object is not required

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaResUpdateCC
{
	public static void main(String[] args)
	{
		String store_id = "moneris";
		String api_token = "hurgle";
		String data_key = "vthBJyN1BicbRkdWFZ9flyDP2";
		String pan = "4242424242424242";
		String expdate = "1901";
		String phone = "0000000000";
		String email = "bob@smith.com";
		String note = "my note";
		String cust_id = "customer1";
		String crypt_type = "7";
		String processing_country_code = "CA";
		boolean status_check = false;

		AvsInfo avsCheck = new AvsInfo();
		avsCheck.setAvsStreetNumber("212");
		avsCheck.setAvsStreetName("Payton Street");
		avsCheck.setAvsZipCode("M1M1M1");

		//Credential on File details
		CofInfo cof = new CofInfo();
		cof.setIssuerId("139X3130ASCXAS9");
		
		ResUpdateCC resUpdateCC = new ResUpdateCC();
		resUpdateCC.setData(data_key);
		resUpdateCC.setAvsInfo(avsCheck);
		resUpdateCC.setCustId(cust_id);
		resUpdateCC.setPan(pan);
		resUpdateCC.setExpdate(expdate);
		resUpdateCC.setPhone(phone);
		resUpdateCC.setEmail(email);
		resUpdateCC.setNote(note);
		resUpdateCC.setCryptType(crypt_type);
		resUpdateCC.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(resUpdateCC);
		mpgReq.setStatusCheck(status_check);
		mpgReq.send();

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("DataKey = " + receipt.getDataKey());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("ResSuccess = " + receipt.getResSuccess());
			System.out.println("PaymentType = " + receipt.getPaymentType());
			System.out.println("Cust ID = " + receipt.getResCustId());
			System.out.println("Phone = " + receipt.getResPhone());
			System.out.println("Email = " + receipt.getResEmail());
			System.out.println("Note = " + receipt.getResNote());
			System.out.println("MaskedPan = " + receipt.getResMaskedPan());
			System.out.println("Exp Date = " + receipt.getResExpdate());
			System.out.println("Crypt Type = " + receipt.getResCryptType());
			System.out.println("Avs Street Number = " + receipt.getResAvsStreetNumber());
			System.out.println("Avs Street Name = " + receipt.getResAvsStreetName());
			System.out.println("Avs Zipcode = " + receipt.getResAvsZipcode());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

                

Vault Update Credit Card transaction object definition

ResUpdateCC resUpdateCC = new ResUpdateCC();

HttpsPostRequest object for Vault Update Credit Card transaction

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(resUpdateCC);

Vault Update Credit Card transaction object mandatory values

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

The data key is generated by Moneris, and is returned to the merchant (via the Receipt object) when the profile is first registered.

Vault Update Credit Card transaction object optional values

Value Type Limits Set method Description
Credit card number String 20-character alphanumeric resUpdateCC.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) resUpdateCC.setExpdate(expdate); Note: This is the reverse of the date displayed on the physical card, which is MMYY.
E-commerce indicator String 1-character alphanumeric resUpdateCC.setCryptType(crypt_type); 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
Customer ID String 50-character alphanumeric resUpdateCC.setCustId(cust_id); This can be used for policy number, membership number, student ID, invoice number and so on.

This field is searchable from the Moneris Merchant Resource Centre.
AVS information Object AvsInfo avsCheck = new AvsInfo();
resUpdateCC.setAvsInfo(avsCheck);
Refer below for further breakdown and definition.
Email address String 30-character alphanumeric resUpdateCC.setEmail(email); Email address of the customer. Can be sent in when creating or updating a Vault profile.
Phone number String 30-character alphanumeric resUpdateCC.setPhone(phone); Phone number of the customer. Can be sent in when creating or updating a Vault profile.
Note String 30-character alphanumeric resUpdateCC.setNote(note); This optional field can be used for supplementary information to be sent in with the transaction. This field can be sent in when creating or updating a Vault profile.
COF Info Object cof.setPaymentIndicator(PaymentIndicator);
cof.setPaymentInformation(PaymentInformation);
cof.setIssuerId(IssuerID);
If you are doing a vault transaction (using a permanent token) the COF Info object is mandatory.
For Definitions of Request Fields of Credential on File please refer back to Purchase / Preauth with Credential on File section.
Credit card number String 20-character alphanumeric resUpdateCC.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) resUpdateCC.setExpdate(expdate); Note: This is the reverse of the date displayed on the physical card, which is MMYY.
E-commerce indicator String 1-character alphanumeric resUpdateCC.setCryptType(crypt_type); E-commerce indicatory, possible values: 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

AvsInfo optional values

VALUE TYPE LIMITS VARIABLE DESCRIPTION
AVS street number String 19-character alphanumeric1 avs_street_number Cardholder street number.  Value may be set to blank which will remove any AVS street number currently on file. If no need to update this field then do not set.
AVS street name String See AVS street number avs_street_name Cardholder street name. Value may be set to blank which will remove any AVS street name currently on file. If no need to update this field then do not set.
AVS zip/postal code String 9-character alphanumeric avs_zipcode Cardholder zip/postal code. Value may be set to blank which will remove any AVS zip/postal code currently on file. If no need to update this field then do not set.
 

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

Vault Delete

Deletes an existing Vault profile of any type using the unique data key that was assigned when the profile was added.

It is important to note that after a profile is deleted, the information which was saved within can no longer be retrieved.

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaResDelete
{
	public static void main(String[] args)
	{
		String store_id = "moneris";
		String api_token = "hurgle";
		String data_key = "DxwdemrvfnoXO1HhmRikfw3gA";
		String processing_country_code = "CA";
		boolean status_check = false;

		ResDelete resDelete = new ResDelete(data_key);

		HttpsPostRequest mpgReq = new HttpsPostRequest();
		mpgReq.setProcCountryCode(processing_country_code);
		mpgReq.setTestMode(true); //false or comment out this line for production transactions
		mpgReq.setStoreId(store_id);
		mpgReq.setApiToken(api_token);
		mpgReq.setTransaction(resDelete);
		mpgReq.setStatusCheck(status_check);
		mpgReq.send();

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("DataKey = " + receipt.getDataKey());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("ResSuccess = " + receipt.getResSuccess());
			System.out.println("PaymentType = " + receipt.getPaymentType());

			//ResolveData
			System.out.println("Cust ID = " + receipt.getResCustId());
			System.out.println("Phone = " + receipt.getResPhone());
			System.out.println("Email = " + receipt.getResEmail());
			System.out.println("Note = " + receipt.getResNote());
			System.out.println("MaskedPan = " + receipt.getResMaskedPan());
			System.out.println("Exp Date = " + receipt.getResExpdate());
			System.out.println("Crypt Type = " + receipt.getResCryptType());
			System.out.println("Avs Street Number = " + receipt.getResAvsStreetNumber());
			System.out.println("Avs Street Name = " + receipt.getResAvsStreetName());
			System.out.println("Avs Zipcode = " + receipt.getResAvsZipcode());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}
                

Vault Delete transaction object definition

ResDelete resDelete = new ResDelete(data_key);

HttpsPostRequest object for Vault Delete transaction

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(resDelete);

Vault Delete transaction object mandatory values

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

The data key is generated by Moneris, and is returned to the merchant (via the Receipt object) when the profile is first registered.

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

Vault Tokenize Credit Card

Creates a new credit card profile using the credit card number, expiry date and e-commerce indicator that were submitted in a previous financial transaction. Previous transactions to be tokenized must have included the Credential on File info object.

The issuer ID received in the previous transaction response is sent in the Vault Tokenize Credit Card request to reference that this is a stored credential.

As with Vault Add Credit Card, a unique data key is generated and returned to the merchant via the Receipt object. This is the profile identifier that all future financial Vault transactions will use to associate with the saved information.

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaResTokenizeCC
{
	public static void main(String[] args)
	{
		String store_id = "moneris";
		String api_token = "hurgle";
		String order_id = "mvt3212954335";
		String txn_number = "199999-0_10";
		String phone = "0000000000";
		String email = "bob@smith.com";
		String note = "my note";
		String cust_id = "customer1";
		String data_key_format = "0";
		String processing_country_code = "CA";
		boolean status_check = false;

		AvsInfo avsCheck = new AvsInfo();
		avsCheck.setAvsStreetNumber("212");
		avsCheck.setAvsStreetName("Payton Street");
		avsCheck.setAvsZipCode("M1M1M1");
		
		//Credential on File details
		CofInfo cof = new CofInfo();
		cof.setIssuerId("139X3130ASCXAS9");

		ResTokenizeCC resTokenizeCC = new ResTokenizeCC();
		resTokenizeCC.setOrderId(order_id);
		resTokenizeCC.setTxnNumber(txn_number);
		resTokenizeCC.setCustId(cust_id);
		resTokenizeCC.setPhone(phone);
		resTokenizeCC.setEmail(email);
		resTokenizeCC.setNote(note);
		resTokenizeCC.setAvsInfo(avsCheck);
		resTokenizeCC.setCofInfo(cof);
		//resTokenizeCC.setDataKeyFormat(data_key_format); //optional
		

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

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("DataKey = " + receipt.getDataKey());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("ResSuccess = " + receipt.getResSuccess());
			System.out.println("PaymentType = " + receipt.getPaymentType());

			//ResolveData
			System.out.println("Cust ID = " + receipt.getResCustId());
			System.out.println("Phone = " + receipt.getResPhone());
			System.out.println("Email = " + receipt.getResEmail());
			System.out.println("Note = " + receipt.getResNote());
			System.out.println("MaskedPan = " + receipt.getResMaskedPan());
			System.out.println("Exp Date = " + receipt.getResExpdate());
			System.out.println("Crypt Type = " + receipt.getResCryptType());
			System.out.println("Avs Street Number = " + receipt.getResAvsStreetNumber());
			System.out.println("Avs Street Name = " + receipt.getResAvsStreetName());
			System.out.println("Avs Zipcode = " + receipt.getResAvsZipcode());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

                

Vault Tokenize Credit Card transaction object definition

ResTokenizeCC resTokenizeCC = new ResTokenizeCC();

HttpsPostRequest object for Vault Tokenize Credit Card transaction

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(resTokenizeCC);

Vault Tokenize Credit Card transaction object mandatory values

Value Type Limits Set method Description
Order ID String 50-character alphanumeric resTokenizeCC.setOrderId(order_id); The order ID must reference the original transaction that is to be referenced and the card data associated with that order ID will be tokenized.
Transaction number String 255-character alphanumeric resTokenizeCC.setTxnNumber(txn_number); Used when performing follow-on transactions. (That is, Completion, Purchase Correction or Refund.) This must be the value that was returned as the transaction number in the response of the original transaction.

When performing a Completion, this value must reference the Pre-Authorization. When performing a Refund or a Purchase Correction, this value must reference the Completion or the Purchase.

Vault Tokenize Credit Card transaction object optional values

Value Type Limits Set method Description
Customer ID String 50-character alphanumeric resTokenizeCC.setCustId(cust_id); This can be used for policy number, membership number, student ID, invoice number and so on.

This field is searchable from the Moneris Merchant Resource Centre.
Email address String 30-character alphanumeric resTokenizeCC.setEmail(email); Email address of the customer. Can be sent in when creating or updating a Vault profile.
Phone number String 30-character alphanumeric resTokenizeCC.setPhone(phone); Phone number of the customer. Can be sent in when creating or updating a Vault profile.
Note String 30-character alphanumeric resTokenizeCC.setNote(note); This optional field can be used for supplementary information to be sent in with the transaction. This field can be sent in when creating or updating a Vault profile.
AVS information Object AvsInfo avsCheck = new AvsInfo(); resTokenizeCC.setAvsInfo(avsCheck); Refer below for further breakdown and definition.
COF Info Object cof.setPaymentIndicator(PaymentIndicator);
cof.setPaymentInformation(PaymentInformation);
cof.setIssuerId(IssuerID);
If you are doing a vault transaction (using a permanent token) the COF Info object is mandatory.
For Definitions of Request Fields of Credential on File please refer back to Purchase / Preauth with Credential on File section.

AvsInfo mandatory values

VALUE TYPE LIMITS VARIABLE DESCRIPTION
AVS street number String 19-character alphanumeric1 avs_street_number Cardholder street number.
AVS street name String See AVS street number avs_street_name Cardholder street name.
AVS zip/postal code String 9-character alphanumeric avs_zipcode 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 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.

Vault Look Up Masked

Verifies what is currently saved under the Vault profile associated with the given data key. The response to this transaction returns the latest active data for that profile.

Unlike Vault Lookup Full (which returns both the masked and the unmasked credit card numbers), this transaction only returns the masked credit card number.

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaResLookupMasked
{
	public static void main(String[] args)
	{
		String store_id = "store1";
		String api_token = "yesguy";
		String data_key = "pi3ZMZoTTM8pLM9wuwws2KBxw";
		String processing_country_code = "CA";
		boolean status_check = false;

		ResLookupMasked resLookupMasked = new ResLookupMasked();
		resLookupMasked.setData(data_key);

		HttpsPostRequest mpgReq = new HttpsPostRequest();
		mpgReq.setProcCountryCode(processing_country_code);
		mpgReq.setTestMode(true); //false or comment out this line for production transactions
		mpgReq.setStoreId(store_id);
		mpgReq.setApiToken(api_token);
		mpgReq.setTransaction(resLookupMasked);
		mpgReq.setStatusCheck(status_check);
		mpgReq.send();

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("DataKey = " + receipt.getDataKey());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("ResSuccess = " + receipt.getResSuccess());
			System.out.println("PaymentType = " + receipt.getPaymentType());
			System.out.println("Cust ID = " + receipt.getResCustId());
			System.out.println("Phone = " + receipt.getResPhone());
			System.out.println("Email = " + receipt.getResEmail());
			System.out.println("Note = " + receipt.getResNote());
			System.out.println("MaskedPan = " + receipt.getResMaskedPan());
			System.out.println("Exp Date = " + receipt.getResExpdate());
			System.out.println("Crypt Type = " + receipt.getResCryptType());
			System.out.println("Avs Street Number = " + receipt.getResAvsStreetNumber());
			System.out.println("Avs Street Name = " + receipt.getResAvsStreetName());
			System.out.println("Avs Zipcode = " + receipt.getResAvsZipcode());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}
                

Vault Look Up Masked transaction object definition

ResLookupMasked resLookupMasked = new ResLookupMasked();

HttpsPostRequest object for Vault Look Up Masked transaction

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(resLookupMasked);

Vault Look Up Masked transaction object mandatory values

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

The data key is generated by Moneris, and is returned to the merchant (via the Receipt object) when the profile is first registered.

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

Vault Look Up Full

Verifies what is currently saved under the Vault profile associated with the given data key. The response to this transaction returns the latest active data for that profile.

Unlike Vault Lookup Masked (which returns the masked credit card numbers ), this transaction returns both the masked and unmasked credit card number .

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

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaResLookupFull
{
	public static void main(String[] args)
	{
		String store_id = "store1";
		String api_token = "yesguy";
		String data_key = "pi3ZMZoTTM8pLM9wuwws2KBxw";
		String processing_country_code = "CA";
		boolean status_check = false;

		ResLookupFull resLookupFull = new ResLookupFull(data_key);

		HttpsPostRequest mpgReq = new HttpsPostRequest();
		mpgReq.setProcCountryCode(processing_country_code);
		mpgReq.setTestMode(true); //false or comment out this line for production transactions
		mpgReq.setStoreId(store_id);
		mpgReq.setApiToken(api_token);
		mpgReq.setTransaction(resLookupFull);
		mpgReq.setStatusCheck(status_check);
		mpgReq.send();

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("DataKey = " + receipt.getDataKey());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("ResSuccess = " + receipt.getResSuccess());
			System.out.println("PaymentType = " + receipt.getPaymentType());
			System.out.println("Cust ID = " + receipt.getResCustId());
			System.out.println("Phone = " + receipt.getResPhone());
			System.out.println("Email = " + receipt.getResEmail());
			System.out.println("Note = " + receipt.getResNote());
			System.out.println("Pan = " + receipt.getResPan());
			System.out.println("MaskedPan = " + receipt.getResMaskedPan());
			System.out.println("Exp Date = " + receipt.getResExpdate());
			System.out.println("Crypt Type = " + receipt.getResCryptType());
			System.out.println("Avs Street Number = " + receipt.getResAvsStreetNumber());
			System.out.println("Avs Street Name = " + receipt.getResAvsStreetName());
			System.out.println("Avs Zipcode = " + receipt.getResAvsZipcode());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}
                

Vault Look Up Full transaction object definition

ResLookupFull resLookupFull = new ResLookupFull(data_key);

HttpsPostRequest object for Vault Look Up Full transaction

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(resLookupFull);

Vault Look Up Full transaction object mandatory values

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

The data key is generated by Moneris, and is returned to the merchant (via the Receipt object) when the profile is first registered.

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 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.
PAN 20-character numeric receipt.getResPan(); Returns the full 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.

Vault is Corporate Card

Determines whether a profile has a corporate card registered within it.

After sending the transaction, the response field to the Receipt object's getCorporateCard method is either true or false depending on whether the associated card is a corporate card.

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaResIscorporatecard
{
	public static void main(String[] args)
	{
		String store_id = "store1";
		String api_token = "yesguy";
		String data_key = "eLqsADfwqHDxIpJG9vLnELx01";
		String processing_country_code = "CA";
		boolean status_check = false;

		ResIscorporatecard resIscorporatecard = new ResIscorporatecard();
		resIscorporatecard.setData(data_key);

		HttpsPostRequest mpgReq = new HttpsPostRequest();
		mpgReq.setProcCountryCode(processing_country_code);
		mpgReq.setTestMode(true); //false or comment out this line for production transactions
		mpgReq.setStoreId(store_id);
		mpgReq.setApiToken(api_token);
		mpgReq.setTransaction(resIscorporatecard);
		mpgReq.setStatusCheck(status_check);
		mpgReq.send();

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("DataKey = " + receipt.getDataKey());
			System.out.println("CorporateCard = " + receipt.getCorporateCard());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("ResSuccess = " + receipt.getResSuccess());
			System.out.println("PaymentType = " + receipt.getPaymentType());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}
                

Vault is Corporate Card transaction object definition

ResIscorporatecard resIscorporatecard = new ResIscorporatecard();

HttpsPostRequest object for Vault is Corporate Card transaction

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(ResIscorporateCard);

Vault is Corporate Card transaction object mandatory values

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

The data key is generated by Moneris, and is returned to the merchant (via the Receipt object) when the profile is first registered.

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

Vault Get Expiring

Verifies which profiles have credit cards that are expiring during the current and next calendar month. For example, if you are processing this transaction on September 30, then it will return all cards that expire(d) in September and October of this year.

When generating a list of profiles with expiring credit cards, only the masked credit card numbers are returned.

This transaction can be performed no more than 2 times on any given calendar day, and it only applies to credit card profiles.

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaResGetExpiring
{
	public static void main(String[] args)
	{
		String store_id = "store1";
		String api_token = "yesguy";
		String processing_country_code = "CA";
		boolean status_check = false;

		ResGetExpiring resGetExpiring = new ResGetExpiring();

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

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("DataKey = " + receipt.getDataKey());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("ResSuccess = " + receipt.getResSuccess());
			System.out.println("PaymentType = " + receipt.getPaymentType());

			//ResolveData
			for (int index =0; index < receipt.getExpiredCardCount(); index++)
			{
				System.out.println("\nDataKey = " + index);
				System.out.println("Payment Type = " + receipt.getExpPaymentType(index));
				System.out.println("Cust ID = " + receipt.getExpCustId(index));
				System.out.println("Phone = " + receipt.getExpPhone(index));
				System.out.println("Email = " + receipt.getExpEmail(index));
				System.out.println("Note = " + receipt.getExpNote(index));
				System.out.println("Masked Pan = " + receipt.getExpMaskedPan(index));
				System.out.println("Exp Date = " + receipt.getExpExpdate(index));
				System.out.println("Crypt Type = " + receipt.getExpCryptType(index));
				System.out.println("Avs Street Number = " + receipt.getExpAvsStreetNumber(index));
				System.out.println("Avs Street Name = " + receipt.getExpAvsStreetName(index));
				System.out.println("Avs Zipcode = " + receipt.getExpAvsZipCode(index));
			}
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}
                

Vault Get Expiring transaction object definition

ResGetExpiring resGetExpiring = new ResGetExpiring();

HttpsPostRequest object for Vault Get Expiring transaction

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(resGetExpiring);

Vault Response Fields

Value Limits Get Method Description
Data Key Array
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.
Expiring card's payment type cc receipt.getExpPaymentType(); Indicates the payment type associated with a Vault profile.
Expiring card's Customer ID 30-character alphanumeric receipt.getExpCustId(); Returns the customer ID saved in the profile.
Expiring card's Phone Number 30-character alphanumeric receipt.getExpPhone(); Returns the phone number saved in the profile.
Expiring card's Email Address 30-character alphanumeric receipt.getExpEmail(); Returns the email address saved in the profile.
Expiring card's Note 30-character alphanumeric receipt.getExpNote(); Returns the note saved in the profile.
Credit Card Fields
Expiring card's Masked PAN 20-character numeric receipt.getExpMaskedPan(); Returns the first 4 last 4 of the card number saved in the profile.
Expiring card's Expiry Date 4-character numeric receipt.getExpExpdate(); Returns the expiry date of the card number saved in the profile. YYMM format.
Expiring card's E-Commerce Indicator 1-character numeric receipt.getExpCryptType(); Returns the e-commerce indicator saved in the profile.
Expiring card's AVS Street Number 19-character alphanumeric receipt.getExpAvsStreetNumber(); 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.
Expiring card's AVS Street Name 19-character alphanumeric receipt.getExpAvsStreetName(); 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.
Expiring card's AVS Zip/Postal Code 9-character alphanumeric receipt.getExpAvsZipcode(); 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.

Vault Add Token

Converts a Hosted Tokenization temporary token to a permanent Vault token.

A temporary token is valid for 15 minutes after it is created. This transaction must be performed within that timeframe if the token is to be changed to a permanent one for future use.

Using the temporary token, send either Purchase, Preauthorization or Card verification with vault transaction request including the Credential on File object to get the issuer ID.

Send the vault Add Token request including the Credential on File Object (with issuer ID only, other fields are not required).

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaResAddToken
{
	public static void main(String[] args)
	{
		String store_id = "store1";
		String api_token = "yesguy";
		String data_key = "ot-545454ucx87A5454";
		String expdate = "2001";
		String phone = "0000000000";
		String email = "bob@smith.com";
		String note = "my note";
		String cust_id = "customer1";
		String crypt_type = "7";
		String data_key_format = "0";
		String processing_country_code = "CA";
		boolean status_check = false;


		AvsInfo avsCheck = new AvsInfo();
		avsCheck.setAvsStreetNumber("212");
		avsCheck.setAvsStreetName("Payton Street");
		avsCheck.setAvsZipCode("M1M1M1");
		
		//Credential on File details
		CofInfo cof = new CofInfo();
		cof.setIssuerId("139X3130ASCXAS9");

		ResAddToken resAddToken = new ResAddToken();
		resAddToken.setDataKey(data_key);
		resAddToken.setCryptType(crypt_type);
		resAddToken.setExpdate(expdate);
		resAddToken.setCustId(cust_id);
		resAddToken.setPhone(phone);
		resAddToken.setEmail(email);
		resAddToken.setNote(note);
		resAddToken.setAvsInfo(avsCheck);
		resAddToken.setCofInfo(cof);
		//resAddToken.setDataKeyFormat(data_key_format); //optional

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

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("DataKey = " + receipt.getDataKey());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("ResSuccess = " + receipt.getResSuccess());
			System.out.println("PaymentType = " + receipt.getPaymentType());
			System.out.println("Cust ID = " + receipt.getResCustId());
			System.out.println("Phone = " + receipt.getResPhone());
			System.out.println("Email = " + receipt.getResEmail());
			System.out.println("Note = " + receipt.getResNote());
			System.out.println("MaskedPan = " + receipt.getResMaskedPan());
			System.out.println("Exp Date = " + receipt.getResExpdate());
			System.out.println("Crypt Type = " + receipt.getResCryptType());
			System.out.println("Avs Street Number = " + receipt.getResAvsStreetNumber());
			System.out.println("Avs Street Name = " + receipt.getResAvsStreetName());
			System.out.println("Avs Zipcode = " + receipt.getResAvsZipcode());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

                

Vault Add Token object

ResAddToken resAddToken = new ResAddToken();

HttpsPostRequest object for Vault Add Token transaction

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(resAddToken);

Vault Add Token transaction object mandatory values

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

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

Vault Add Token transaction object conditional values

VALUE TYPE LIMITS SET METHOD DESCRIPTION
Expiry date String 4-character alphanumeric (YYMM format) resAddToken.setExpdate(expdate); Note: This is the reverse of the date displayed on the physical card, which is MMYY. If Hosted Tokenization solution already collected the expiry date, then this is optional.  If it did not, then this is mandatory.
 

Vault Add Token transaction object optional values

Value Type Limits Set method Description
Customer ID String 50-character alphanumeric resAddToken.setCustId(cust_id); This can be used for policy number, membership number, student ID, invoice number and so on.

This field is searchable from the Moneris Merchant Resource Centre.
AVS information Object AvsInfo avsCheck = new AvsInfo();
resAddToken.setAvsInfo(avsCheck);
Refer below for further breakdown and definition.
Email address String 30-character alphanumeric resAddToken.setEmail(email); Email address of the customer. Can be sent in when creating or updating a Vault profile.
Phone number String 30-character alphanumeric resAddToken.setPhone(phone); Phone number of the customer. Can be sent in when creating or updating a Vault profile.
Note String 30-character alphanumeric resAddToken.setNote(note); This optional field can be used for supplementary information to be sent in with the transaction. This field can be sent in when creating or updating a Vault profile.
COF Info Object cof.setPaymentIndicator(PaymentIndicator);
cof.setPaymentInformation(PaymentInformation);
cof.setIssuerId(IssuerID);
If you are doing a vault transaction (using a permanent token) the COF Info object is mandatory.
For Definitions of Request Fields of Credential on File please refer back to Purchase / Preauth with Credential on File section.

AvsInfo mandatory values

VALUE TYPE LIMITS VARIABLE DESCRIPTION
AVS street number String 19-character alphanumeric1 avs_street_number Cardholder street number.
AVS street name String See AVS street number avs_street_name Cardholder street name.
AVS zip/postal code String 9-character alphanumeric avs_zipcode 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 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.

Vault Temporary Token Add

Creates a new temporary token credit card profile. This transaction requires a duration to be set to indicate how long the temporary token is to be stored for. This is the API version of Hosted Tokenization.

During the lifetime of this temporary token, it may be used for any other vault transaction before it is permanently deleted from the system.

Things to consider:

  • The duration, or lifetime, of the temporary token can be set to be a maximum of 15 minutes.

Canada Code Sample

package Canada;

import JavaAPI.*;

public class TestCanadaResTempAdd
{
	public static void main(String[] args)
	{
		String store_id = "store1";
		String api_token = "yesguy";
		String pan = "5454545454545454";
		String expdate = "1901"; //YYMM format
		String crypt_type = "7";
		String duration = "900";
		String processing_country_code = "CA";
		boolean status_check = false;

		ResTempAdd resTempAdd = new ResTempAdd();
		resTempAdd.setPan(pan);
		resTempAdd.setExpdate(expdate);
		resTempAdd.setDuration(duration);
		resTempAdd.setCryptType(crypt_type);

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

		try
		{
			Receipt receipt = mpgReq.getReceipt();

			System.out.println("DataKey = " + receipt.getDataKey());
			System.out.println("ResponseCode = " + receipt.getResponseCode());
			System.out.println("Message = " + receipt.getMessage());
			System.out.println("TransDate = " + receipt.getTransDate());
			System.out.println("TransTime = " + receipt.getTransTime());
			System.out.println("Complete = " + receipt.getComplete());
			System.out.println("TimedOut = " + receipt.getTimedOut());
			System.out.println("ResSuccess = " + receipt.getResSuccess());
			System.out.println("PaymentType = " + receipt.getPaymentType());
			System.out.println("MaskedPan = " + receipt.getResMaskedPan());
			System.out.println("Exp Date = " + receipt.getResExpdate());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}
                

Vault Temporary Token Add object

ResTempAdd resTempAdd = new ResTempAdd();

HttpsPostRequest object for Vault Temporary Token Add transaction

HttpsPostRequest mpgReq = new HttpsPostRequest();

mpgReq.setTransaction(resTempAdd);

Vault Temporary Token Add transaction object mandatory values

Value Type Limits Set method Description
Credit card number String 20-character alphanumeric resTempAdd.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 resTempAdd.setExpdate(expdate); Submit in YYMM format.
Note: This is the reverse of the date displayed on the physical card, which is MMYY.
Duration String TBD resTempAdd.setDuration(duration); TBD
E-commerce indicator String 1-character alphanumeric resTempAdd.setCryptType(crypt_type); 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

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 receipt.getPaymentType(); Indicates the payment type associated with a Vault 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.