My Profile_


Vault Add Credit Card

NEW!   We now have our Interactive tool for this section.

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

 
require "../../mpgClasses.php";
 
/**************************** Request Variables *******************************/
 
$store_id='store5';
$api_token='yesguy';
 
/************************* Transactional Variables ****************************/
 
$type='res_add_cc';
$cust_id='customer1';
$phone = '5555551234';
$email = 'bob@smith.com';
$note = 'this is my note';
$pan='5454545454545454';
$expiry_date='1412';
$crypt_type='1';
$data_key_format = "0";
$avs_street_number = '123';
$avs_street_name = 'lakeshore blvd';
$avs_zipcode = '90210';
 
/*********************** Transactional Associative Array **********************/
 
$txnArray=array('type'=>$type,
                                                            'cust_id'=>$cust_id,
                                                            'phone'=>$phone,
                                                            'email'=>$email,
                                                            'note'=>$note,
                                        'pan'=>$pan,
                                                            'expdate'=>$expiry_date,
                                                            //'data_key_format'=>$data_key_format, //optional
                                                            'crypt_type'=>$crypt_type
                                        );
 
/********************** AVS Associative Array *********************************/
 
$avsTemplate = array(
                                                            'avs_street_number' => $avs_street_number,
                                                            'avs_street_name' => $avs_street_name,
                                                            'avs_zipcode' => $avs_zipcode
                                        );
 
/************************** AVS Object ***************************************/
 
$mpgAvsInfo = new mpgAvsInfo ($avsTemplate);
 
/******************* Credential on File **********************************/
 
$cof = new CofInfo();
$cof->setIssuerId("139X3130ASCXAS9");
 
/**************************** Transaction Object *****************************/
 
$mpgTxn = new mpgTransaction($txnArray);
$mpgTxn->setAvsInfo($mpgAvsInfo);
$mpgTxn->setCofInfo($cof);
 
/****************************** Request Object *******************************/
 
$mpgRequest = new mpgRequest($mpgTxn);
$mpgRequest->setTestMode(true); //false or comment out this line for production transactions
 
/***************************** HTTPS Post Object *****************************/
 
$mpgHttpPost  =new mpgHttpsPost($store_id,$api_token,$mpgRequest);
 
/******************************* Response ************************************/
 
$mpgResponse=$mpgHttpPost->getMpgResponse();
 
print("\nDataKey = " . $mpgResponse->getDataKey());
print("\nResponseCode = " . $mpgResponse->getResponseCode());
print("\nMessage = " . $mpgResponse->getMessage());
print("\nTransDate = " . $mpgResponse->getTransDate());
print("\nTransTime = " . $mpgResponse->getTransTime());
print("\nComplete = " . $mpgResponse->getComplete());
print("\nTimedOut = " . $mpgResponse->getTimedOut());
print("\nResSuccess = " . $mpgResponse->getResSuccess());
print("\nPaymentType = " . $mpgResponse->getPaymentType());
print("\nIssuerId = " . $mpgResponse->getIssuerId());
 
//----------------- ResolveData ------------------------------
 
print("\n\nCust ID = " . $mpgResponse->getResDataCustId());
print("\nPhone = " . $mpgResponse->getResDataPhone());
print("\nEmail = " . $mpgResponse->getResDataEmail());
print("\nNote = " . $mpgResponse->getResDataNote());
print("\nMasked Pan = " . $mpgResponse->getResDataMaskedPan());
print("\nExp Date = " . $mpgResponse->getResDataExpDate());
print("\nCrypt Type = " . $mpgResponse->getResDataCryptType());
print("\nAvs Street Number = " . $mpgResponse->getResDataAvsStreetNumber());
print("\nAvs Street Name = " . $mpgResponse->getResDataAvsStreetName());
print("\nAvs Zipcode = " . $mpgResponse->getResDataAvsZipcode());
 
?>
 

                

Transaction Values

$txnArray=array('type'=>'res_add_cc',... );

$mpgTxn = new mpgTransaction($txnArray);

$mpgRequest = new mpgRequest($mpgTxn);

Vault Add Credit Card transaction object mandatory values

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

Describes the category of e-commerce transaction being processed. Allowable values are:


  • 1 - Mail Order / Telephone Order—Single
  • 2 - Mail Order / Telephone Order—Recurring
  • 3 - Mail Order / Telephone Order—Instalment
  • 4 - Mail Order / Telephone Order—Unknown classification
  • 5 - Authenticated e-commerce transaction (VBV)
  • 6 - Non-authenticated e-commerce transaction (VBV)
  • 7 - SSL-enabled merchant

In Credential on File transactions where the request field e-commerce indicator is also being sent: the allowable values for e-commerce indicator are dependent on the value sent for payment indicator, as follows:


if payment indicator = R, then allowable values for e-commerce indicator: 2, 5 or 6
if payment indicator = C, then allowable values for e-commerce indicator: 1, 5, 6 or 7
if payment indicator = U, then allowable values for e-commerce indicator: 1 or 7
if payment indicator = Z, then allowable values for e-commerce indicator: 1, 5, 6 or 7

Vault Add Credit Card transaction object optional values

Value Type Limits Set method Description
Customer ID String 50-character alphanumeric '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.
Data Key Format String 2-character alphanumeric 'data_key_format'=>$data_key_format Specifies the data key format being returned
If left blank, data key format will default to 25-character alphanumeric
Possible values:
0 – 25 character alphanumeric data key
0U – unique 25-character alphanumeric data key
AVS Information Object $mpgAvsInfo = new mpgAvsInfo ($avsTemplate);
$mpgTxn->setAvsInfo($mpgAvsInfo);
Refer below for further breakdown and definition.
Email address String 30-character alphanumeric 'email' Email address of the customer. Can be sent in when creating or updating a Vault profile.
Phone Number String 30-character alphanumeric 'phone' Phone number of the customer. Can be sent in when creating or updating a Vault profile.
Note String 30-character alphanumeric '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 $mpgTxn->setCofInfo($cof); 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 $mpgResponse->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 $mpgResponse->getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc $mpgResponse->getPaymentType(); Indicates the payment type associated with a Vault profile.
Customer ID 30-character alphanumeric $mpgResponse->getResDataCustId(); Returns the customer ID saved in the profile.
Phone Number 30-character alphanumeric $mpgResponse->getResDataPhone(); Returns the phone number saved in the profile.
Email Address 30-character alphanumeric $mpgResponse->getResDataEmail(); Returns the email address saved in the profile.
Note 30-character alphanumeric $mpgResponse->getResDataNote(); Returns the note saved in the profile.
Credit Card Fields
Masked PAN 20-character numeric $mpgResponse->getResDataMaskedPan(); Returns the first 4 last 4 of the card number saved in the profile.
Expiry Date 4-character numeric $mpgResponse->getResDataExpDate(); Returns the expiry date of the card number saved in the profile. YYMM format.
E-Commerce Indicator 1-character numeric $mpgResponse->getResDataCryptType(); Returns the e-commerce indicator saved in the profile.
AVS Street Number 19-character alphanumeric $mpgResponse->getResDataAvsStreetNumber(); 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 $mpgResponse->getResDataAvsStreetName(); 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 $mpgResponse->getResDataAvsZipcode(); 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.
Definitions of Request Fields – Credential on File

Please refer back to Purchase / Preauth with Credential on File section.


Vault Update Credit Card

NEW!   We now have our Interactive tool for this section.

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

 
require "../../mpgClasses.php";
 
/**************************** Request Variables *******************************/
 
$store_id='store5';
$api_token='yesguy';
 
/************************* Transactional Variables ****************************/
 
$type='res_update_cc';
$data_key='D8cpd4r7REXoN8NIJPi512xPh';
$cust_id='customer1';
$phone = '5555555555';
$email = 'bob@smith.com';
$note = 'stuff';
$pan='5454545454545454';
$expiry_date='0909';
$crypt_type='7';
 
$avs_street_number = '123';
$avs_street_name = 'stuff dr';
$avs_zipcode = '90215';
 
/*********************** Transactional Associative Array **********************/
 
$txnArray=array('type'=>$type,
                                                                                'data_key'=>$data_key,
                                            'cust_id'=>$cust_id,
                                            'phone'=>$phone,
                                                                                'email'=>$email,
                                                                                'note'=>$note,
                                            'pan'=>$pan,
                                                               'expdate'=>$expiry_date,
                                                                'crypt_type'=>$crypt_type
                                               );
 
/********************** AVS Associative Array *********************************/
 
$avsTemplate = array(
                                                                                                    'avs_street_number' => $avs_street_number,
                                                                                                    'avs_street_name' => $avs_street_name,
                                                                                                    'avs_zipcode' => $avs_zipcode
                                                                                                    );
 
/************************** AVS Object ***************************************/
 
$mpgAvsInfo = new mpgAvsInfo ($avsTemplate);
 
/******************* Credential on File **********************************/
 
$cof = new CofInfo();
$cof->setIssuerId("168451306048014");
 
/**************************** Transaction Object *****************************/
 
$mpgTxn = new mpgTransaction($txnArray);
$mpgTxn->setAvsInfo($mpgAvsInfo);
$mpgTxn->setCofInfo($cof);
 
/****************************** Request Object *******************************/
 
$mpgRequest = new mpgRequest($mpgTxn);
$mpgRequest->setTestMode(true); //false or comment out this line for production transactions
 
/***************************** HTTPS Post Object *****************************/
 
$mpgHttpPost  =new mpgHttpsPost($store_id,$api_token,$mpgRequest);
 
/******************************* Response ************************************/
 
$mpgResponse=$mpgHttpPost->getMpgResponse();
 
print("\nDataKey = " . $mpgResponse->getDataKey());
print("\nResponseCode = " . $mpgResponse->getResponseCode());
print("\nMessage = " . $mpgResponse->getMessage());
print("\nTransDate = " . $mpgResponse->getTransDate());
print("\nTransTime = " . $mpgResponse->getTransTime());
print("\nComplete = " . $mpgResponse->getComplete());
print("\nTimedOut = " . $mpgResponse->getTimedOut());
print("\nResSuccess = " . $mpgResponse->getResSuccess());
print("\nPaymentType = " . $mpgResponse->getPaymentType());
 
//----------------- ResolveData ------------------------------
 
print("\n\nCust ID = " . $mpgResponse->getResDataCustId());
print("\nPhone = " . $mpgResponse->getResDataPhone());
print("\nEmail = " . $mpgResponse->getResDataEmail());
print("\nNote = " . $mpgResponse->getResDataNote());
print("\nMasked Pan = " . $mpgResponse->getResDataMaskedPan());
print("\nExp Date = " . $mpgResponse->getResDataExpDate());
print("\nCrypt Type = " . $mpgResponse->getResDataCryptType());
print("\nAvs Street Number = " . $mpgResponse->getResDataAvsStreetNumber());
print("\nAvs Street Name = " . $mpgResponse->getResDataAvsStreetName());
print("\nAvs Zipcode = " . $mpgResponse->getResDataAvsZipcode());
 
?>
 

                

Transaction Values

$txnArray=array('type'=>'res_update_cc',... );

$mpgTxn = new mpgTransaction($txnArray);

$mpgRequest = new mpgRequest($mpgTxn);

Vault Update Credit Card transaction object mandatory values

Value Type Limits Set method Description
Data key String 25-character alphanumeric '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 '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) 'expdate' Note: This is the reverse of the date displayed on the physical card, which is MMYY.
Customer ID String 50-character alphanumeric '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 $mpgAvsInfo = new mpgAvsInfo ($avsTemplate);
$mpgTxn->setAvsInfo($mpgAvsInfo);
Refer below for further breakdown and definition.
Email address String 30-character alphanumeric 'email' Email address of the customer. Can be sent in when creating or updating a Vault profile.
Phone number String 30-character alphanumeric 'phone' Phone number of the customer. Can be sent in when creating or updating a Vault profile.
Note String 30-character alphanumeric '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.
Credit card number String 20-character alphanumeric '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) 'expdate' Note: This is the reverse of the date displayed on the physical card, which is MMYY.
E-commerce indicator String 1-character alphanumeric 'crypt_type'

Describes the category of e-commerce transaction being processed. Allowable values are:


  • 1 - Mail Order / Telephone Order—Single
  • 2 - Mail Order / Telephone Order—Recurring
  • 3 - Mail Order / Telephone Order—Instalment
  • 4 - Mail Order / Telephone Order—Unknown classification
  • 5 - Authenticated e-commerce transaction (VBV)
  • 6 - Non-authenticated e-commerce transaction (VBV)
  • 7 - SSL-enabled merchant

In Credential on File transactions where the request field e-commerce indicator is also being sent: the allowable values for e-commerce indicator are dependent on the value sent for payment indicator, as follows:


if payment indicator = R, then allowable values for e-commerce indicator: 2, 5 or 6
if payment indicator = C, then allowable values for e-commerce indicator: 1, 5, 6 or 7
if payment indicator = U, then allowable values for e-commerce indicator: 1 or 7
if payment indicator = Z, then allowable values for e-commerce indicator: 1, 5, 6 or 7

COF Info Object $mpgTxn->setCofInfo($cof); 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 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 $mpgResponse->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 $mpgResponse->getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc $mpgResponse->getPaymentType(); Indicates the payment type associated with a Vault profile.
Customer ID 30-character alphanumeric $mpgResponse->getResDataCustId(); Returns the customer ID saved in the profile.
Phone Number 30-character alphanumeric $mpgResponse->getResDataPhone(); Returns the phone number saved in the profile.
Email Address 30-character alphanumeric $mpgResponse->getResDataEmail(); Returns the email address saved in the profile.
Note 30-character alphanumeric $mpgResponse->getResDataNote(); Returns the note saved in the profile.
Credit Card Fields
Masked PAN 20-character numeric $mpgResponse->getResDataMaskedPan(); Returns the first 4 last 4 of the card number saved in the profile.
Expiry Date 4-character numeric $mpgResponse->getResDataExpDate(); Returns the expiry date of the card number saved in the profile. YYMM format.
E-Commerce Indicator 1-character numeric $mpgResponse->getResDataCryptType(); Returns the e-commerce indicator saved in the profile.
AVS Street Number 19-character alphanumeric $mpgResponse->getResDataAvsStreetNumber(); 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 $mpgResponse->getResDataAvsStreetName(); 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 $mpgResponse->getResDataAvsZipcode(); 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.
Definitions of Request Fields – Credential on File

Please refer back to Purchase / Preauth with Credential on File section.


Vault Delete Credit Card

NEW!   We now have our Interactive tool for this section.

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

require "../../mpgClasses.php";

/**************************** Request Variables *******************************/

$store_id='store5';
$api_token='yesguy';

/************************* Transactional Variables ****************************/

$type='res_delete';
$data_key='YjNEwYw6U2pPwquXOkOme3G7g';

/*********************** Transactional Associative Array **********************/

$txnArray=array('type'=>$type,
				'data_key'=>$data_key
   			    );


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

$mpgTxn = new mpgTransaction($txnArray);

/****************************** Request Object *******************************/

$mpgRequest = new mpgRequest($mpgTxn);
$mpgRequest->setTestMode(true); //false or comment out this line for production transactions

/***************************** HTTPS Post Object *****************************/

$mpgHttpPost  =new mpgHttpsPost($store_id,$api_token,$mpgRequest);

/******************************* Response ************************************/

$mpgResponse=$mpgHttpPost->getMpgResponse();

print("\nDataKey = " . $mpgResponse->getDataKey());
print("\nResponseCode = " . $mpgResponse->getResponseCode());
print("\nMessage = " . $mpgResponse->getMessage());
print("\nTransDate = " . $mpgResponse->getTransDate());
print("\nTransTime = " . $mpgResponse->getTransTime());
print("\nComplete = " . $mpgResponse->getComplete());
print("\nTimedOut = " . $mpgResponse->getTimedOut());
print("\nResSuccess = " . $mpgResponse->getResSuccess());
print("\nPaymentType = " . $mpgResponse->getPaymentType());

//----------------- ResolveData ------------------------------

print("\n\nCust ID = " . $mpgResponse->getResDataCustId());
print("\nPhone = " . $mpgResponse->getResDataPhone());
print("\nEmail = " . $mpgResponse->getResDataEmail());
print("\nNote = " . $mpgResponse->getResDataNote());
print("\nMasked Pan = " . $mpgResponse->getResDataMaskedPan());
print("\nExp Date = " . $mpgResponse->getResDataExpDate());
print("\nCrypt Type = " . $mpgResponse->getResDataCryptType());
print("\nAvs Street Number = " . $mpgResponse->getResDataAvsStreetNumber());
print("\nAvs Street Name = " . $mpgResponse->getResDataAvsStreetName());
print("\nAvs Zipcode = " . $mpgResponse->getResDataAvsZipcode());

?>


                

Transaction Values

$txnArray=array('type'=>'res_delete',... );

$mpgTxn = new mpgTransaction($txnArray);

$mpgRequest = new mpgRequest($mpgTxn);

Vault Delete transaction object mandatory values

Value Type Limits Set method Description
Data key String 25-character alphanumeric '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 $mpgResponse->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 $mpgResponse->getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc $mpgResponse->getPaymentType(); Indicates the payment type associated with a Vault profile.
Customer ID 30-character alphanumeric $mpgResponse->getResDataCustId(); Returns the customer ID saved in the profile.
Phone Number 30-character alphanumeric $mpgResponse->getResDataPhone(); Returns the phone number saved in the profile.
Email Address 30-character alphanumeric $mpgResponse->getResDataEmail(); Returns the email address saved in the profile.
Note 30-character alphanumeric $mpgResponse->getResDataNote(); Returns the note saved in the profile.
Credit Card Fields
Masked PAN 20-character numeric $mpgResponse->getResDataMaskedPan(); Returns the first 4 last 4 of the card number saved in the profile.
Expiry Date 4-character numeric $mpgResponse->getResDataExpDate(); Returns the expiry date of the card number saved in the profile. YYMM format.
E-Commerce Indicator 1-character numeric $mpgResponse->getResDataCryptType(); Returns the e-commerce indicator saved in the profile.
AVS Street Number 19-character alphanumeric $mpgResponse->getResDataAvsStreetNumber(); 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 $mpgResponse->getResDataAvsStreetName(); 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 $mpgResponse->getResDataAvsZipcode(); 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

NEW!   We now have our Interactive tool for this section.

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

 
require "../../mpgClasses.php";
 
/**************************** Request Variables *******************************/
 
$store_id='store5';
$api_token='yesguy';
 
/************************* Transactional Variables ****************************/
 
$type = 'res_update_cc';
$data_key = 'D8cpd4r7REXoN8NIJPi512xPh';
$cust_id = 'customer1';
$return_issuer_id = 'true';
$phone = '5555555555';
$email = 'bob@smith.com';
$note = 'stuff';
$pan = '5454545454545454';
$expiry_date = '0909';
$crypt_type = '7';
 
$avs_street_number = '123';
$avs_street_name = 'stuff dr';
$avs_zipcode = '90215';
 
/*********************** Transactional Associative Array **********************/
 
$txnArray=array('type'=>$type,
               'data_key'=>$data_key,
               'cust_id'=>$cust_id,
               'return_issuer_id'=>$return_issuer_id,
               'phone'=>$phone,
               'email'=>$email,
               'note'=>$note,
               'pan'=>$pan,
               'expdate'=>$expiry_date,
               'crypt_type'=>$crypt_type
               );
 
/********************** AVS Associative Array *********************************/
 
$avsTemplate=array('avs_street_number' => $avs_street_number,
                  'avs_street_name' => $avs_street_name,
                  'avs_zipcode' => $avs_zipcode
                  );
 
/************************** AVS Object ***************************************/
 
$mpgAvsInfo = new mpgAvsInfo ($avsTemplate);
 
/******************* Credential on File **********************************/
 
$cof = new CofInfo();
$cof->setIssuerId("168451306048014");
 
/**************************** Transaction Object *****************************/
 
$mpgTxn = new mpgTransaction($txnArray);
$mpgTxn->setAvsInfo($mpgAvsInfo);
$mpgTxn->setCofInfo($cof);
 
/****************************** Request Object *******************************/
 
$mpgRequest = new mpgRequest($mpgTxn);
$mpgRequest->setTestMode(true); //false or comment out this line for production transactions
 
/***************************** HTTPS Post Object *****************************/
 
$mpgHttpPost  =new mpgHttpsPost($store_id,$api_token,$mpgRequest);
 
/******************************* Response ************************************/
 
$mpgResponse=$mpgHttpPost->getMpgResponse();
 
print("\nDataKey = " . $mpgResponse->getDataKey());
print("\nResponseCode = " . $mpgResponse->getResponseCode());
print("\nMessage = " . $mpgResponse->getMessage());
print("\nTransDate = " . $mpgResponse->getTransDate());
print("\nTransTime = " . $mpgResponse->getTransTime());
print("\nComplete = " . $mpgResponse->getComplete());
print("\nTimedOut = " . $mpgResponse->getTimedOut());
print("\nResSuccess = " . $mpgResponse->getResSuccess());
print("\nPaymentType = " . $mpgResponse->getPaymentType());
 
//----------------- ResolveData ------------------------------
 
print("\n\nCust ID = " . $mpgResponse->getResDataCustId());
print("\nPhone = " . $mpgResponse->getResDataPhone());
print("\nEmail = " . $mpgResponse->getResDataEmail());
print("\nNote = " . $mpgResponse->getResDataNote());
print("\nMasked Pan = " . $mpgResponse->getResDataMaskedPan());
print("\nExp Date = " . $mpgResponse->getResDataExpDate());
print("\nCrypt Type = " . $mpgResponse->getResDataCryptType());
print("\nAvs Street Number = " . $mpgResponse->getResDataAvsStreetNumber());
print("\nAvs Street Name = " . $mpgResponse->getResDataAvsStreetName());
print("\nAvs Zipcode = " . $mpgResponse->getResDataAvsZipcode());
print("\nIssuer ID = " . $mpgResponse->getIssuerId());
 
?>
 

                

Transaction Values

$txnArray=array('type'=>'res_tokenize_cc',... );

$mpgTxn = new mpgTransaction($txnArray);

$mpgRequest = new mpgRequest($mpgTxn);


Vault Tokenize Credit Card transaction object mandatory values

Value Type Limits Set method Description
Order ID String 50-character alphanumeric '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 '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 '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.
Return Issuer ID Boolean true/false 'return_issuer_id'=>$return_issuer_id When true, Gateway returns the bank Issuer ID. Defaults to false.
Data Key Format String 2-character alphanumeric 'data_key_format'=>$data_key_format Specifies the data key format being returned
If left blank, data key format will default to 25-character alphanumeric
Possible values:
0 – 25 character alphanumeric data key
0U – unique 25-character alphanumeric data key
Email address String 30-character alphanumeric 'email' Email address of the customer. Can be sent in when creating or updating a Vault profile.
Phone number String 30-character alphanumeric 'phone' Phone number of the customer. Can be sent in when creating or updating a Vault profile.
Note String 30-character alphanumeric '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 $mpgAvsInfo = new mpgAvsInfo ($avsTemplate);
$mpgTxn->setAvsInfo($mpgAvsInfo);
Refer below for further breakdown and definition.
COF Info Object $mpgTxn->setCofInfo($cof); 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 $mpgResponse->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 $mpgResponse->getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc $mpgResponse->getPaymentType(); Indicates the payment type associated with a Vault profile.
Customer ID 30-character alphanumeric $mpgResponse->getResDataCustId(); Returns the customer ID saved in the profile.
Issuer ID

NOTE: This variable is required for all merchant-initiated transactions following the first one; upon sending the first transaction, the issuer ID value is received in the transaction response and then used in subsequent transaction requests.
String

15-character alphanumeric

variable length
$cof->setIssuerId("VALUE_FOR_ISSUER_ID");

NOTE: For a list and explanation of the possible values to send for this variable, see Definition of Request Fields – Credential on File
Unique identifier for the cardholder's stored credentials Sent back in the response from the card brand when processing a Credential on File transaction

If the cardholder's credentials are being stored for the first time, and the issuer ID was returned in the response, you must save the issuer ID on your system to use in subsequent Credential on File transactions (applies to merchant-initiated transactions only)

The issuer ID must be saved to your systems when returned from Moneris Gateway in the response data, regardless if the value was received or not As a best practice, if the issuer ID is not returned and you received a value of NULL instead, store that value and send it in the subsequent transaction
Phone Number 30-character alphanumeric $mpgResponse->getResDataPhone(); Returns the phone number saved in the profile.
Email Address 30-character alphanumeric $mpgResponse->getResDataEmail(); Returns the email address saved in the profile.
Note 30-character alphanumeric $mpgResponse->getResDataNote(); Returns the note saved in the profile.
Credit Card Fields
Masked PAN 20-character numeric $mpgResponse->getResDataMaskedPan(); Returns the first 4 last 4 of the card number saved in the profile.
Expiry Date 4-character numeric $mpgResponse->getResDataExpDate(); Returns the expiry date of the card number saved in the profile. YYMM format.
E-Commerce Indicator 1-character numeric $mpgResponse->getResDataCryptType(); Returns the e-commerce indicator saved in the profile.
AVS Street Number 19-character alphanumeric $mpgResponse->getResDataAvsStreetNumber(); 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 $mpgResponse->getResDataAvsStreetName(); 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 $mpgResponse->getResDataAvsZipcode(); 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.
Definitions of Request Fields – Credential on File

Please refer back to Purchase / Preauth with Credential on File section.


Vault Look Up Masked

NEW!   We now have our Interactive tool for this section.

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

require "../../mpgClasses.php";

/**************************** Request Variables *******************************/

$store_id='store5';
$api_token='yesguy';

/************************* Transactional Variables ****************************/

$type='res_lookup_masked';	//will only return the masked card number
$data_key='t8RCndWBNFNt4Dx32CCnl2tlz';

/*********************** Transactional Associative Array **********************/

$txnArray=array('type'=>$type,
				'data_key'=>$data_key
   			    );


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

$mpgTxn = new mpgTransaction($txnArray);

/****************************** Request Object *******************************/

$mpgRequest = new mpgRequest($mpgTxn);
$mpgRequest->setTestMode(true); //false or comment out this line for production transactions

/***************************** HTTPS Post Object *****************************/

$mpgHttpPost  =new mpgHttpsPost($store_id,$api_token,$mpgRequest);

/******************************* Response ************************************/

$mpgResponse=$mpgHttpPost->getMpgResponse();

print("\nDataKey = " . $mpgResponse->getDataKey());
print("\nResponseCode = " . $mpgResponse->getResponseCode());
print("\nMessage = " . $mpgResponse->getMessage());
print("\nTransDate = " . $mpgResponse->getTransDate());
print("\nTransTime = " . $mpgResponse->getTransTime());
print("\nComplete = " . $mpgResponse->getComplete());
print("\nTimedOut = " . $mpgResponse->getTimedOut());
print("\nResSuccess = " . $mpgResponse->getResSuccess());
print("\nPaymentType = " . $mpgResponse->getPaymentType());

//----------------- ResolveData ------------------------------

print("\n\nCust ID = " . $mpgResponse->getResDataCustId());
print("\nPhone = " . $mpgResponse->getResDataPhone());
print("\nEmail = " . $mpgResponse->getResDataEmail());
print("\nNote = " . $mpgResponse->getResDataNote());
print("\nMasked Pan = " . $mpgResponse->getResDataMaskedPan());
print("\nExp Date = " . $mpgResponse->getResDataExpDate());
print("\nCrypt Type = " . $mpgResponse->getResDataCryptType());
print("\nAvs Street Number = " . $mpgResponse->getResDataAvsStreetNumber());
print("\nAvs Street Name = " . $mpgResponse->getResDataAvsStreetName());
print("\nAvs Zipcode = " . $mpgResponse->getResDataAvsZipcode());

?>


                

Transaction Values

$txnArray=array('type'=>'res_lookup_masked',... );

$mpgTxn = new mpgTransaction($txnArray);

$mpgRequest = new mpgRequest($mpgTxn);


Vault Look Up Masked transaction object mandatory values

Value Type Limits Set method Description
Data key String 25-character alphanumeric '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 $mpgResponse->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 $mpgResponse->getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc $mpgResponse->getPaymentType(); Indicates the payment type associated with a Vault profile.
Customer ID 30-character alphanumeric $mpgResponse->getResDataCustId(); Returns the customer ID saved in the profile.
Phone Number 30-character alphanumeric $mpgResponse->getResDataPhone(); Returns the phone number saved in the profile.
Email Address 30-character alphanumeric $mpgResponse->getResDataEmail(); Returns the email address saved in the profile.
Note 30-character alphanumeric $mpgResponse->getResDataNote(); Returns the note saved in the profile.
Credit Card Fields
Masked PAN 20-character numeric $mpgResponse->getResDataMaskedPan(); Returns the first 4 last 4 of the card number saved in the profile.
Expiry Date 4-character numeric $mpgResponse->getResDataExpDate(); Returns the expiry date of the card number saved in the profile. YYMM format.
E-Commerce Indicator 1-character numeric $mpgResponse->getResDataCryptType(); Returns the e-commerce indicator saved in the profile.
AVS Street Number 19-character alphanumeric $mpgResponse->getResDataAvsStreetNumber(); 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 $mpgResponse->getResDataAvsStreetName(); 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 $mpgResponse->getResDataAvsZipcode(); 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

NEW!   We now have our Interactive tool for this section.

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

require "../../mpgClasses.php";

/**************************** Request Variables *******************************/

$store_id='store5';
$api_token='yesguy';

/************************* Transactional Variables ****************************/

$type='res_lookup_full'; 	//will return both the full & masked card number
$data_key='t8RCndWBNFNt4Dx32CCnl2tlz';

/*********************** Transactional Associative Array **********************/

$txnArray=array('type'=>$type,
				'data_key'=>$data_key
   			    );


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

$mpgTxn = new mpgTransaction($txnArray);

/****************************** Request Object *******************************/

$mpgRequest = new mpgRequest($mpgTxn);
$mpgRequest->setTestMode(true); //false or comment out this line for production transactions

/***************************** HTTPS Post Object *****************************/

$mpgHttpPost  =new mpgHttpsPost($store_id,$api_token,$mpgRequest);

/******************************* Response ************************************/

$mpgResponse=$mpgHttpPost->getMpgResponse();

print("\nDataKey = " . $mpgResponse->getDataKey());
print("\nResponseCode = " . $mpgResponse->getResponseCode());
print("\nMessage = " . $mpgResponse->getMessage());
print("\nTransDate = " . $mpgResponse->getTransDate());
print("\nTransTime = " . $mpgResponse->getTransTime());
print("\nComplete = " . $mpgResponse->getComplete());
print("\nTimedOut = " . $mpgResponse->getTimedOut());
print("\nResSuccess = " . $mpgResponse->getResSuccess());
print("\nPaymentType = " . $mpgResponse->getPaymentType());

//----------------- ResolveData ------------------------------

print("\n\nCust ID = " . $mpgResponse->getResDataCustId());
print("\nPhone = " . $mpgResponse->getResDataPhone());
print("\nEmail = " . $mpgResponse->getResDataEmail());
print("\nNote = " . $mpgResponse->getResDataNote());
print("\nPan = " . $mpgResponse->getResDataPan());
print("\nMasked Pan = " . $mpgResponse->getResDataMaskedPan());
print("\nExp Date = " . $mpgResponse->getResDataExpDate());
print("\nCrypt Type = " . $mpgResponse->getResDataCryptType());
print("\nAvs Street Number = " . $mpgResponse->getResDataAvsStreetNumber());
print("\nAvs Street Name = " . $mpgResponse->getResDataAvsStreetName());
print("\nAvs Zipcode = " . $mpgResponse->getResDataAvsZipcode());

?>


                

Transaction Values

$txnArray=array('type'=>'res_lookup_full',... );

$mpgTxn = new mpgTransaction($txnArray);

$mpgRequest = new mpgRequest($mpgTxn);


Vault Look Up Full transaction object mandatory values

Value Type Limits Set method Description
Data key String 25-character alphanumeric '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 $mpgResponse->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 $mpgResponse->getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc $mpgResponse->getPaymentType(); Indicates the payment type associated with a Vault profile.
Customer ID 30-character alphanumeric $mpgResponse->getResDataCustId(); Returns the customer ID saved in the profile.
Phone Number 30-character alphanumeric $mpgResponse->getResDataPhone(); Returns the phone number saved in the profile.
Email Address 30-character alphanumeric $mpgResponse->getResDataEmail(); Returns the email address saved in the profile.
Note 30-character alphanumeric $mpgResponse->getResDataNote(); Returns the note saved in the profile.
Credit Card Fields
Masked PAN 20-character numeric $mpgResponse->getResDataMaskedPan(); Returns the first 4 last 4 of the card number saved in the profile.
PAN 20-character numeric $mpgResponse->getResDataPan(); Returns the full card number saved in the profile.
Expiry Date 4-character numeric $mpgResponse->getResDataExpDate(); Returns the expiry date of the card number saved in the profile. YYMM format.
E-Commerce Indicator 1-character numeric $mpgResponse->getResDataCryptType(); Returns the e-commerce indicator saved in the profile.
AVS Street Number 19-character alphanumeric $mpgResponse->getResDataAvsStreetNumber(); 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 $mpgResponse->getResDataAvsStreetName(); 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 $mpgResponse->getResDataAvsZipcode(); 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

NEW!   We now have our Interactive tool for this section.

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

require "../../mpgClasses.php";

/**************************** Request Variables *******************************/

$store_id='store5';
$api_token='yesguy';

/************************* Transactional Variables ****************************/

$type='res_iscorporatecard';
$data_key='t8RCndWBNFNt4Dx32CCnl2tlz';

/*********************** Transactional Associative Array **********************/

$txnArray=array('type'=>$type,
				'data_key'=>$data_key
   			    );


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

$mpgTxn = new mpgTransaction($txnArray);

/****************************** Request Object *******************************/

$mpgRequest = new mpgRequest($mpgTxn);
$mpgRequest->setTestMode(true); //false or comment out this line for production transactions

/***************************** HTTPS Post Object *****************************/

$mpgHttpPost  =new mpgHttpsPost($store_id,$api_token,$mpgRequest);

/******************************* Response ************************************/

$mpgResponse=$mpgHttpPost->getMpgResponse();

print("\nDataKey = " . $mpgResponse->getDataKey());
print("\nCorporateCard = " . $mpgResponse->getCorporateCard());
print("\nReceiptId = " . $mpgResponse->getReceiptId());
print("\nResponseCode = " . $mpgResponse->getResponseCode());
print("\nISO = " . $mpgResponse->getISO());
print("\nMessage = " . $mpgResponse->getMessage());
print("\nTransDate = " . $mpgResponse->getTransDate());
print("\nTransTime = " . $mpgResponse->getTransTime());
print("\nComplete = " . $mpgResponse->getComplete());
print("\nCardType = " . $mpgResponse->getCardType());
print("\nTxnNumber = " . $mpgResponse->getTxnNumber());
print("\nTimedOut = " . $mpgResponse->getTimedOut());
print("\nResSuccess = " . $mpgResponse->getResSuccess());
print("\nPaymentType = " . $mpgResponse->getPaymentType());
?>


                

Transaction Values

$txnArray=array('type'=>'res_iscorporatecard',... );

$mpgTxn = new mpgTransaction($txnArray);

$mpgRequest = new mpgRequest($mpgTxn);


Vault is Corporate Card transaction object mandatory values

Value Type Limits Set method Description
Data key String 25-character alphanumeric '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 $mpgResponse->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 $mpgResponse->getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc $mpgResponse->getPaymentType(); Indicates the payment type associated with a Vault profile.
Customer ID 30-character alphanumeric $mpgResponse->getResDataCustId(); Returns the customer ID saved in the profile.
Phone Number 30-character alphanumeric $mpgResponse->getResDataPhone(); Returns the phone number saved in the profile.
Email Address 30-character alphanumeric $mpgResponse->getResDataEmail(); Returns the email address saved in the profile.
Note 30-character alphanumeric $mpgResponse->getResDataNote(); Returns the note saved in the profile.
Credit Card Fields
Masked PAN 20-character numeric $mpgResponse->getResDataMaskedPan(); Returns the first 4 last 4 of the card number saved in the profile.
Expiry Date 4-character numeric $mpgResponse->getResDataExpDate(); Returns the expiry date of the card number saved in the profile. YYMM format.
E-Commerce Indicator 1-character numeric $mpgResponse->getResDataCryptType(); Returns the e-commerce indicator saved in the profile.
AVS Street Number 19-character alphanumeric $mpgResponse->getResDataAvsStreetNumber(); 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 $mpgResponse->getResDataAvsStreetName(); 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 $mpgResponse->getResDataAvsZipcode(); 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

NEW!   We now have our Interactive tool for this section.

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

require "../../mpgClasses.php";

/**************************** Request Variables *******************************/

$store_id='store5';
$api_token='yesguy';

/************************* Transactional Variables ****************************/

$type='res_get_expiring';

/*********************** Transactional Associative Array **********************/

$txnArray = array( 'type'=>$type );


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

$mpgTxn = new mpgTransaction($txnArray);

/****************************** Request Object *******************************/

$mpgRequest = new mpgRequest($mpgTxn);
$mpgRequest->setTestMode(true); //false or comment out this line for production transactions

/***************************** HTTPS Post Object *****************************/

$mpgHttpPost  =new mpgHttpsPost($store_id,$api_token,$mpgRequest);

/******************************* Response ************************************/

$mpgResponse=$mpgHttpPost->getMpgResponse();

print("\nDataKey = " . $mpgResponse->getDataKey());
print("\nResponseCode = " . $mpgResponse->getResponseCode());
print("\nMessage = " . $mpgResponse->getMessage());
print("\nTransDate = " . $mpgResponse->getTransDate());
print("\nTransTime = " . $mpgResponse->getTransTime());
print("\nComplete = " . $mpgResponse->getComplete());
print("\nTimedOut = " . $mpgResponse->getTimedOut());
print("\nResSuccess = " . $mpgResponse->getResSuccess());
print("\nPaymentType = " . $mpgResponse->getPaymentType());

//----------------- ResolveData ------------------------------

$DataKeys = $mpgResponse->getDataKeys();

for($i=0; $i < count($DataKeys); $i++)
{
	$mpgResponse->setResolveData($DataKeys[$i]);

	print("\n\nData Key = " . $DataKeys[$i]);
	print("\nCust ID = " . $mpgResponse->getResDataCustId());
	print("\nPhone = " . $mpgResponse->getResDataPhone());
	print("\nEmail = " . $mpgResponse->getResDataEmail());
	print("\nNote = " . $mpgResponse->getResDataNote());
	print("\nMasked Pan = " . $mpgResponse->getResDataMaskedPan());
	print("\nExp Date = " . $mpgResponse->getResDataExpDate());
	print("\nCrypt Type = " . $mpgResponse->getResDataCryptType());
	print("\nAvs Street Number = " . $mpgResponse->getResDataAvsStreetNumber());
	print("\nAvs Street Name = " . $mpgResponse->getResDataAvsStreetName());
	print("\nAvs Zipcode = " . $mpgResponse->getResDataAvsZipcode());

}


?>


                

Transaction Values

$txnArray=array('type'=>'res_get_expiring',... );

$mpgTxn = new mpgTransaction($txnArray);

$mpgRequest = new mpgRequest($mpgTxn);


Vault Response Fields

Value Limits Get Method Description
Data Key 25-character alphanumeric $mpgResponse->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 $mpgResponse->getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc $mpgResponse->getPaymentType(); Indicates the payment type associated with a Vault profile.
Customer ID 30-character alphanumeric $mpgResponse->getResDataCustId(); Returns the customer ID saved in the profile.
Phone Number 30-character alphanumeric $mpgResponse->getResDataPhone(); Returns the phone number saved in the profile.
Email Address 30-character alphanumeric $mpgResponse->getResDataEmail(); Returns the email address saved in the profile.
Note 30-character alphanumeric $mpgResponse->getResDataNote(); Returns the note saved in the profile.
Credit Card Fields
Masked PAN 20-character numeric $mpgResponse->getResDataMaskedPan(); Returns the first 4 last 4 of the card number saved in the profile.
Expiry Date 4-character numeric $mpgResponse->getResDataExpDate(); Returns the expiry date of the card number saved in the profile. YYMM format.
E-Commerce Indicator 1-character numeric $mpgResponse->getResDataCryptType(); Returns the e-commerce indicator saved in the profile.
AVS Street Number 19-character alphanumeric $mpgResponse->getResDataAvsStreetNumber(); 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 $mpgResponse->getResDataAvsStreetName(); 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 $mpgResponse->getResDataAvsZipcode(); 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

NEW!   We now have our Interactive tool for this section.

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

 
require "../../mpgClasses.php";
 
/**************************** Request Variables *******************************/
 
$store_id='store5';
$api_token='yesguy';
 
/************************* Transactional Variables ****************************/
 
$type='res_add_token';
$temp_data_key='ot-mtNKdu8NcxDoChqOJKZJZ1BOB';
$cust_id='customer1';
$phone = '5555551234';
$email = 'bob@smith.com';
$note = 'this is my note';
$expiry_date='1811';
$data_key_format = "0";
$crypt_type='1';
$avs_street_number = '123';
$avs_street_name = 'lakeshore blvd';
$avs_zipcode = '90210';
 
/*********************** Transactional Associative Array **********************/
 
$txnArray=array('type'=>$type,
                                                            'data_key'=>$temp_data_key,
                                                            'cust_id'=>$cust_id,
                                                            'phone'=>$phone,
                                                            'email'=>$email,
                                                            'note'=>$note,
                                                            'expdate'=>$expiry_date,
                                                            //'data_key_format'=>$data_key_format, //optional
                                                            'crypt_type'=>$crypt_type
                                        );
 
/********************** AVS Associative Array *********************************/
 
$avsTemplate = array(
                                                                                'avs_street_number' => $avs_street_number,
                                                                                'avs_street_name' => $avs_street_name,
                                                                                'avs_zipcode' => $avs_zipcode
                                                            );
 
/************************** AVS Object ***************************************/
 
$mpgAvsInfo = new mpgAvsInfo ($avsTemplate);
 
/******************* Credential on File **********************************/
 
$cof = new CofInfo();
$cof->setIssuerId("168451306048014");
 
/**************************** Transaction Object *****************************/
 
$mpgTxn = new mpgTransaction($txnArray);
$mpgTxn->setAvsInfo($mpgAvsInfo);
$mpgTxn->setCofInfo($cof);
 
/****************************** Request Object *******************************/
 
$mpgRequest = new mpgRequest($mpgTxn);
$mpgRequest->setTestMode(true); //false or comment out this line for production transactions
 
/***************************** HTTPS Post Object *****************************/
 
$mpgHttpPost  =new mpgHttpsPost($store_id,$api_token,$mpgRequest);
 
/******************************* Response ************************************/
 
$mpgResponse=$mpgHttpPost->getMpgResponse();
 
print("\nDataKey = " . $mpgResponse->getDataKey());
print("\nResponseCode = " . $mpgResponse->getResponseCode());
print("\nMessage = " . $mpgResponse->getMessage());
print("\nTransDate = " . $mpgResponse->getTransDate());
print("\nTransTime = " . $mpgResponse->getTransTime());
print("\nComplete = " . $mpgResponse->getComplete());
print("\nTimedOut = " . $mpgResponse->getTimedOut());
print("\nResSuccess = " . $mpgResponse->getResSuccess());
print("\nPaymentType = " . $mpgResponse->getPaymentType());
print("\nIssuerId = " . $mpgResponse->getIssuerId());
 
//----------------- ResolveData ------------------------------
 
print("\n\nCust ID = " . $mpgResponse->getResDataCustId());
print("\nPhone = " . $mpgResponse->getResDataPhone());
print("\nEmail = " . $mpgResponse->getResDataEmail());
print("\nNote = " . $mpgResponse->getResDataNote());
print("\nMasked Pan = " . $mpgResponse->getResDataMaskedPan());
print("\nExp Date = " . $mpgResponse->getResDataExpDate());
print("\nCrypt Type = " . $mpgResponse->getResDataCryptType());
print("\nAvs Street Number = " . $mpgResponse->getResDataAvsStreetNumber());
print("\nAvs Street Name = " . $mpgResponse->getResDataAvsStreetName());
print("\nAvs Zipcode = " . $mpgResponse->getResDataAvsZipcode());
 
?>
 

                

Transaction Values

$txnArray=array('type'=>'res_add_token',... );

$mpgTxn = new mpgTransaction($txnArray);

$mpgRequest = new mpgRequest($mpgTxn);


Vault Add Token transaction object mandatory values

Value Type Limits Set method Description
Data key String 25-character alphanumeric '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 'crypt_type'

Describes the category of e-commerce transaction being processed. Allowable values are:


  • 1 - Mail Order / Telephone Order—Single
  • 2 - Mail Order / Telephone Order—Recurring
  • 3 - Mail Order / Telephone Order—Instalment
  • 4 - Mail Order / Telephone Order—Unknown classification
  • 5 - Authenticated e-commerce transaction (VBV)
  • 6 - Non-authenticated e-commerce transaction (VBV)
  • 7 - SSL-enabled merchant

In Credential on File transactions where the request field e-commerce indicator is also being sent: the allowable values for e-commerce indicator are dependent on the value sent for payment indicator, as follows:


if payment indicator = R, then allowable values for e-commerce indicator: 2, 5 or 6
if payment indicator = C, then allowable values for e-commerce indicator: 1, 5, 6 or 7
if payment indicator = U, then allowable values for e-commerce indicator: 1 or 7
if payment indicator = Z, then allowable values for e-commerce indicator: 1, 5, 6 or 7

Vault Add Token transaction object conditional values

VALUE TYPE LIMITS SET METHOD DESCRIPTION
Expiry date String 4-character alphanumeric (YYMM format) '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 '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 $mpgAvsInfo = new mpgAvsInfo ($avsTemplate);
$mpgTxn->setAvsInfo($mpgAvsInfo);
Refer below for further breakdown and definition.
Email address String 30-character alphanumeric 'email' Email address of the customer. Can be sent in when creating or updating a Vault profile.
Phone number String 30-character alphanumeric 'phone' Phone number of the customer. Can be sent in when creating or updating a Vault profile.
Note String 30-character alphanumeric '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 $mpgTxn->setCofInfo($cof); 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 $mpgResponse->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 $mpgResponse->getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc $mpgResponse->getPaymentType(); Indicates the payment type associated with a Vault profile.
Customer ID 30-character alphanumeric $mpgResponse->getResDataCustId(); Returns the customer ID saved in the profile.
Phone Number 30-character alphanumeric $mpgResponse->getResDataPhone(); Returns the phone number saved in the profile.
Email Address 30-character alphanumeric $mpgResponse->getResDataEmail(); Returns the email address saved in the profile.
Note 30-character alphanumeric $mpgResponse->getResDataNote(); Returns the note saved in the profile.
Credit Card Fields
Masked PAN 20-character numeric $mpgResponse->getResDataMaskedPan(); Returns the first 4 last 4 of the card number saved in the profile.
Expiry Date 4-character numeric $mpgResponse->getResDataExpDate(); Returns the expiry date of the card number saved in the profile. YYMM format.
E-Commerce Indicator 1-character numeric $mpgResponse->getResDataCryptType(); Returns the e-commerce indicator saved in the profile.
AVS Street Number 19-character alphanumeric $mpgResponse->getResDataAvsStreetNumber(); 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 $mpgResponse->getResDataAvsStreetName(); 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 $mpgResponse->getResDataAvsZipcode(); 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.
Definitions of Request Fields – Credential on File

Please refer back to Purchase / Preauth with Credential on File section.


Vault Temporary Token Add

NEW!   We now have our Interactive tool for this section.

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

<?php

require "../../mpgClasses.php";

/**************************** Request Variables *******************************/

$store_id='store5';
$api_token='yesguy';

/************************* Transactional Variables ****************************/

$type='res_temp_add';
$pan='5454545454545454';
$expiry_date='1509';
$duration='900';
$crypt_type='7';

/*********************** Transactional Associative Array **********************/

$txnArray=array('type'=>$type,
    		    'pan'=>$pan,
   				'expdate'=>$expiry_date,
   				'duration'=>$duration,
   				'crypt_type'=>$crypt_type
   		);


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

$mpgTxn = new mpgTransaction($txnArray);


/****************************** Request Object *******************************/

$mpgRequest = new mpgRequest($mpgTxn);
$mpgRequest->setTestMode(true); //false or comment out this line for production transactions

/***************************** HTTPS Post Object *****************************/

$mpgHttpPost  =new mpgHttpsPost($store_id,$api_token,$mpgRequest);

/******************************* Response ************************************/

$mpgResponse=$mpgHttpPost->getMpgResponse();

print("\nDataKey = " . $mpgResponse->getDataKey());
print("\nResponseCode = " . $mpgResponse->getResponseCode());
print("\nMessage = " . $mpgResponse->getMessage());
print("\nTransDate = " . $mpgResponse->getTransDate());
print("\nTransTime = " . $mpgResponse->getTransTime());
print("\nComplete = " . $mpgResponse->getComplete());
print("\nTimedOut = " . $mpgResponse->getTimedOut());
print("\nResSuccess = " . $mpgResponse->getResSuccess());
print("\nPaymentType = " . $mpgResponse->getPaymentType());

//----------------- ResolveData ------------------------------

print("\n\Masked Pan = " . $mpgResponse->getResDataMaskedPan());
print("\nExp Date = " . $mpgResponse->getResDataExpDate());

?>


                

Transaction Values

$txnArray=array('type'=>'res_temp_add',... );

$mpgTxn = new mpgTransaction($txnArray);

$mpgRequest = new mpgRequest($mpgTxn);


Vault Temporary Token Add transaction object mandatory values

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

Describes the category of e-commerce transaction being processed. Allowable values are:


  • 1 - Mail Order / Telephone Order—Single
  • 2 - Mail Order / Telephone Order—Recurring
  • 3 - Mail Order / Telephone Order—Instalment
  • 4 - Mail Order / Telephone Order—Unknown classification
  • 5 - Authenticated e-commerce transaction (VBV)
  • 6 - Non-authenticated e-commerce transaction (VBV)
  • 7 - SSL-enabled merchant

In Credential on File transactions where the request field e-commerce indicator is also being sent: the allowable values for e-commerce indicator are dependent on the value sent for payment indicator, as follows:


if payment indicator = R, then allowable values for e-commerce indicator: 2, 5 or 6
if payment indicator = C, then allowable values for e-commerce indicator: 1, 5, 6 or 7
if payment indicator = U, then allowable values for e-commerce indicator: 1 or 7
if payment indicator = Z, then allowable values for e-commerce indicator: 1, 5, 6 or 7

Vault Response Fields

Value Limits Get Method Description
Data Key 25-character alphanumeric $mpgResponse->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 $mpgResponse->getResSuccess(); Indicates whether Vault transaction was successful.
Payment Type cc $mpgResponse->getPaymentType(); Indicates the payment type associated with a Vault profile.
Credit Card Fields
Masked PAN 20-character numeric $mpgResponse->getResDataMaskedPan(); Returns the first 4 last 4 of the card number saved in the profile.
Expiry Date 4-character numeric $mpgResponse->getResDataExpDate(); Returns the expiry date of the card number saved in the profile. YYMM format.