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.
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
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";
bool status_check = false;
AvsInfo avsCheck = new AvsInfo();
avsCheck.SetAvsStreetNumber("212");
avsCheck.SetAvsStreetName("Payton Street");
avsCheck.SetAvsZipCode("M1M1M1");
CofInfo cof = new CofInfo();
cof.SetIssuerId("168451306048014");
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.SetGetCardType("true");
//resaddcc.SetDataKeyFormat(data_key_format); //optional
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();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("MaskedPan = " + receipt.GetResDataMaskedPan());
Console.WriteLine("Exp Date = " + receipt.GetResDataExpdate());
Console.WriteLine("Crypt Type = " + receipt.GetResDataCryptType());
Console.WriteLine("Avs Street Number = " + receipt.GetResDataAvsStreetNumber());
Console.WriteLine("Avs Street Name = " + receipt.GetResDataAvsStreetName());
Console.WriteLine("Avs Zipcode = " + receipt.GetResDataAvsZipcode());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
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); |
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 |
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. |
Data Key Format
|
String
|
2-character alphanumeric
|
resaddcc.SetDataKeyFormat(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 |
|
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
|
|
resaddcc.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 |
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. |
Definitions of Request Fields – Credential on File
Please refer back to Purchase / Preauth with Credential on File section.
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
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResUpdateCC
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
string data_key = "cIjurYyhGCAiGuCKdp94AspE7";
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";
bool status_check = false;
AvsInfo avsCheck = new AvsInfo();
avsCheck.SetAvsStreetNumber("212");
avsCheck.SetAvsStreetName("Payton Street");
avsCheck.SetAvsZipCode("M1M1M1");
CofInfo cof = new CofInfo();
cof.SetIssuerId("168451306048014");
ResUpdateCC resUpdateCC = new ResUpdateCC();
resUpdateCC.SetDataKey(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.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();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("MaskedPan = " + receipt.GetResDataMaskedPan());
Console.WriteLine("Exp Date = " + receipt.GetResDataExpdate());
Console.WriteLine("Crypt Type = " + receipt.GetResDataCryptType());
Console.WriteLine("Avs Street Number = " + receipt.GetResDataAvsStreetNumber());
Console.WriteLine("Avs Street Name = " + receipt.GetResDataAvsStreetName());
Console.WriteLine("Avs Zipcode = " + receipt.GetResDataAvsZipcode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
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. |
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
|
|
resUpdateCC.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.
|
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); |
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
|
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. |
Definitions of Request Fields – Credential on File
Please refer back to Purchase / Preauth with Credential on File section.
Vault Delete Credit Card
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.
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResDelete
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string data_key = "PjVKjtEmc1FvFyjxHE4EwBMxi";
bool status_check = false;
ResDelete resDelete = new ResDelete(data_key);
HttpsPostRequest mpgReq = new HttpsPostRequest();
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();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
//ResolveData
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("MaskedPan = " + receipt.GetResDataMaskedPan());
Console.WriteLine("Exp Date = " + receipt.GetResDataExpdate());
Console.WriteLine("Crypt Type = " + receipt.GetResDataCryptType());
Console.WriteLine("Avs Street Number = " + receipt.GetResDataAvsStreetNumber());
Console.WriteLine("Avs Street Name = " + receipt.GetResDataAvsStreetName());
Console.WriteLine("Avs Zipcode = " + receipt.GetResDataAvsZipcode());
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
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.
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResTokenizeCC
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
string order_id = "1000189096";
string txn_number = "880416-0_10";
string phone = "0000000000";
string email = "bob@smith.com";
string note = "my note";
string cust_id = "customer1";
string data_key_format = "0";
bool status_check = false;
AvsInfo avsCheck = new AvsInfo();
avsCheck.SetAvsStreetNumber("212");
avsCheck.SetAvsStreetName("Payton Street");
avsCheck.SetAvsZipCode("M1M1M1");
CofInfo cof = new CofInfo();
cof.SetIssuerId("168451306048014");
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
resTokenizeCC.SetReturnIssuerId(true);
HttpsPostRequest mpgReq = new HttpsPostRequest();
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();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
//ResolveData
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("MaskedPan = " + receipt.GetResDataMaskedPan());
Console.WriteLine("Exp Date = " + receipt.GetResDataExpdate());
Console.WriteLine("Crypt Type = " + receipt.GetResDataCryptType());
Console.WriteLine("Avs Street Number = " + receipt.GetResDataAvsStreetNumber());
Console.WriteLine("Avs Street Name = " + receipt.GetResDataAvsStreetName());
Console.WriteLine("Avs Zipcode = " + receipt.GetResDataAvsZipcode());
Console.WriteLine("Issuer ID = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
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. |
Return Issuer ID |
Boolean |
true/false |
resTokenizeCC.SetReturnIssuerId(false); |
When true, Gateway returns the bank Issuer ID. Defaults to false. |
Data Key Format
|
String
|
2-character alphanumeric
|
resaddcc.SetDataKeyFormat(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 |
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
|
|
resTokenizeCC.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 |
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. |
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 |
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. |
Definitions of Request Fields – Credential on File
Please refer back to Purchase / Preauth with Credential on File section.
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.
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResLookupMasked
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
string data_key = "pi3ZMZoTTM8pLM9wuwws2KBxw";
bool status_check = false;
ResLookupMasked resLookupMasked = new ResLookupMasked();
resLookupMasked.SetData(data_key);
HttpsPostRequest mpgReq = new HttpsPostRequest();
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();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("MaskedPan = " + receipt.GetResDataMaskedPan());
Console.WriteLine("Exp Date = " + receipt.GetResDataExpdate());
Console.WriteLine("Crypt Type = " + receipt.GetResDataCryptType());
Console.WriteLine("Avs Street Number = " + receipt.GetResDataAvsStreetNumber());
Console.WriteLine("Avs Street Name = " + receipt.GetResDataAvsStreetName());
Console.WriteLine("Avs Zipcode = " + receipt.GetResDataAvsZipcode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
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. |
ACH Fields |
SEC Code |
3-character alphanumeric |
receipt.GetResSec(); |
Returns the ACH SEC code saved in the profile. |
Customer First Name |
50-character alphanumeric |
receipt.GetResCustFirstName(); |
Returns the customer first name saved in the profile. |
Customer Last Name |
50-character alphanumeric |
receipt.GetResCustLastName(); |
Returns the customer last name saved in the profile. |
Customer Address 1 |
50-character alphanumeric |
receipt.GetResCustAddress1(); |
Returns the customer address line 1 saved in the profile. |
Customer Address 2 |
50-character alphanumeric |
receipt.GetResCustAddress2(); |
Returns the customer address line 2 saved in the profile. |
Customer City |
50-character alphanumeric |
receipt.GetResCustCity(); |
Returns the customer city saved in the profile. |
Customer State |
2-character alphanumeric |
receipt.GetResCustState(); |
Returns the customer state code saved in the profile. |
Customer Zip Code |
10-character numeric |
receipt.GetResCustZip(); |
Returns the customer zip code saved in the profile. |
Check Routing Number |
9-character numeric |
receipt.GetResRoutingNum(); |
Returns the customer check routing number saved in the profile. |
Masked Account Number |
15-character alphanumeric |
receipt.GetResMaskedAccountNum(); |
Returns the masked first 4 last 4 of the account number saved in the profile. |
Check Number |
16-character numeric |
receipt.GetResCheckNum(); |
Returns the check number saved in the profile. |
Account Type |
savings/checking |
receipt.GetResAccountType(); |
Returns the type of account 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.
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResLookupFull
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
string data_key = "pi3ZMZoTTM8pLM9wuwws2KBxw";
bool status_check = false;
ResLookupFull resLookupFull = new ResLookupFull(data_key);
HttpsPostRequest mpgReq = new HttpsPostRequest();
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();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("Pan = " + receipt.GetResDataPan());
Console.WriteLine("MaskedPan = " + receipt.GetResDataMaskedPan());
Console.WriteLine("Exp Date = " + receipt.GetResDataExpdate());
Console.WriteLine("Crypt Type = " + receipt.GetResDataCryptType());
Console.WriteLine("Avs Street Number = " + receipt.GetResDataAvsStreetNumber());
Console.WriteLine("Avs Street Name = " + receipt.GetResDataAvsStreetName());
Console.WriteLine("Avs Zipcode = " + receipt.GetResDataAvsZipcode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
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.
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResIscorporatecard
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
string data_key = "eLqsADfwqHDxIpJG9vLnELx01";
bool status_check = false;
ResIscorporatecard resIscorporatecard = new ResIscorporatecard();
resIscorporatecard.SetData(data_key);
HttpsPostRequest mpgReq = new HttpsPostRequest();
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();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("CorporateCard = " + receipt.GetCorporateCard());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
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.
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResGetExpiring
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
bool status_check = false;
ResGetExpiring resGetExpiring = new ResGetExpiring();
HttpsPostRequest mpgReq = new HttpsPostRequest();
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();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
//ResolveData
foreach (string dataKey in receipt.GetDataKeys())
{
Console.WriteLine("\nDataKey = " + dataKey);
Console.WriteLine("Payment Type = " + receipt.GetExpPaymentType(dataKey));
Console.WriteLine("Cust ID = " + receipt.GetExpCustId(dataKey));
Console.WriteLine("Phone = " + receipt.GetExpPhone(dataKey));
Console.WriteLine("Email = " + receipt.GetExpEmail(dataKey));
Console.WriteLine("Note = " + receipt.GetExpNote(dataKey));
Console.WriteLine("Masked Pan = " + receipt.GetExpMaskedPan(dataKey));
Console.WriteLine("Exp Date = " + receipt.GetExpExpdate(dataKey));
Console.WriteLine("Crypt Type = " + receipt.GetExpCryptType(dataKey));
Console.WriteLine("Avs Street Number = " + receipt.GetExpAvsStreetNumber(dataKey));
Console.WriteLine("Avs Street Name = " + receipt.GetExpAvsStreetName(dataKey));
Console.WriteLine("Avs Zipcode = " + receipt.GetExpAvsZipCode(dataKey));
}
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
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).
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResAddToken
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string data_key = "ot-A8R8m9sjsUgltcyTIDNmOVuq9";
string expdate = "1602";
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";
bool status_check = false;
AvsInfo avsCheck = new AvsInfo();
avsCheck.SetAvsStreetNumber("212");
avsCheck.SetAvsStreetName("Payton Street");
avsCheck.SetAvsZipCode("M1M1M1");
CofInfo cof = new CofInfo();
cof.SetIssuerId("168451306048014");
ResAddToken resAddToken = new ResAddToken(data_key, 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.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();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("MaskedPan = " + receipt.GetResDataMaskedPan());
Console.WriteLine("Exp Date = " + receipt.GetResDataExpdate());
Console.WriteLine("Crypt Type = " + receipt.GetResDataCryptType());
Console.WriteLine("Avs Street Number = " + receipt.GetResDataAvsStreetNumber());
Console.WriteLine("Avs Street Name = " + receipt.GetResDataAvsStreetName());
Console.WriteLine("Avs Zipcode = " + receipt.GetResDataAvsZipcode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
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); |
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) |
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
|
|
resAddToken.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 |
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. |
Definitions of Request Fields – Credential on File
Please refer back to Purchase / Preauth with Credential on File section.
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.
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
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";
bool 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.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();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("MaskedPan = " + receipt.GetResDataMaskedPan());
Console.WriteLine("Exp Date = " + receipt.GetResDataExpdate());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
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); |
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 |
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. |