My Unified API Guide Dot NET V1.2.3
User Manual:
Open the PDF directly: View PDF .
Page Count: 476 [warning: Documents this large are best viewed by clicking the View PDF Link!]
- Security and Compliance
- Changes in v1.2.3
- 1 About This Documentation
- 2 Basic Transaction Set
- 3 Credential on File
- 3.1 About Credential on File
- 3.2 Credential on File Info Object and Variables
- 3.3 Credential on File Transaction Types
- 3.4 Initial Transactions in Credential on File
- 3.5 Vault Tokenize Credit Card and Credential on File
- 3.6 Credential on File and Converting Temporary Tokens
- 3.7 Card Verification and Credential on File Transactions
- 4 Vault
- 4.1 About the Vault Transaction Set
- 4.2 Vault Transaction Types
- 4.3 Vault Administrative Transactions
- 4.3.1 Vault Add Credit Card – ResAddCC
- 4.3.2 Vault Temporary Token Add – ResTempAdd
- 4.3.3 Vault Update Credit Card – ResUpdateCC
- 4.3.4 Vault Delete - ResDelete
- 4.3.5 Vault Lookup Full - ResLookupFull
- 4.3.6 Vault Lookup Masked - ResLookupMasked
- 4.3.7 Vault Get Expiring - ResGetExpiring
- 4.3.8 Vault Is Corporate Card - ResIscorporateCard
- 4.3.9 Vault Add Token – ResAddToken
- 4.3.10 Vault Tokenize Credit Card – ResTokenizeCC
- 4.4 Vault Financial Transactions
- 4.5 Hosted Tokenization
- 5 INTERAC® Online Payment
- 5.1 About INTERAC® Online Payment Transactions
- 5.2 Other Documents and References
- 5.3 Website and Certification Requirements
- 5.4 Transaction Flow for INTERAC® Online Payment
- 5.5 Sending an INTERAC® Online Payment Purchase Transaction
- 5.6 INTERAC® Online Payment Purchase
- 5.7 INTERAC® Online Payment Refund
- 5.8 INTERAC® Online Payment Field Definitions
- 6 Mag Swipe Transaction Set
- 7 Level 2/3 Transactions
- 7.1 About Level 2/3 Transactions
- 7.2 Level 2/3 Visa Transactions
- 7.3 Level 2/3 MasterCard Transactions
- 7.4 Level 2/3 American Express Transactions
- 7.4.1 Level 2/3 Transaction Types for Amex
- 7.4.2 Level 2/3 Transaction Flow for Amex
- 7.4.3 Level 2/3 Data Objects in Amex
- 7.4.4 AX Completion
- 7.4.5 AX Force Post
- 7.4.6 AX Purchase Correction
- 7.4.7 AX Refund
- 7.4.8 AX Independent Refund
- 8 MPI
- 8.1 About MPI Transactions
- 8.2 3-D Secure Implementations (VbV, MCSC, SafeKey)
- 8.3 Activating VbV and MCSC
- 8.4 Activating Amex SafeKey
- 8.5 Transaction Flow for MPI
- 8.6 MPI Transactions
- 8.6.1 VbV, MCSC and SafeKey Responses
- 8.6.2 MpiTxn Request Transaction
- 8.6.3 Vault MPI Transaction – ResMpiTxn
- 8.6.4 MPI ACS Request Transaction
- 8.6.5 Purchase with 3-D Secure – cavvPurchase
- 8.6.6 Pre-Authorization with 3-D Secure – cavvPreauth
- 8.6.7 Cavv Result Codes for Verified by Visa
- 8.6.8 Vault Cavv Purchase
- 8.6.9 Vault Cavv Pre-Authorization
- 9 e-Fraud Tools
- 9.1 Address Verification Service
- 9.2 Card Validation Digits (CVD)
- 9.3 Transaction Risk Management Tool
- 9.4 Encorporating All Available Fraud Tools
- 10 Apple Pay In-App and on the Web Integration
- 11 Offlinx™
- 12 Convenience Fee
- 13 Recurring Billing
- 14 Customer Information
- 15 Status Check
- 16 Visa Checkout
- 16.1 About Visa Checkout
- 16.2 Transaction Types - Visa Checkout
- 16.3 Integrating Visa Checkout Lightbox
- 16.4 Transaction Flow for Visa Checkout
- 16.5 Visa Checkout Purchase
- 16.6 Visa Checkout Pre-Authorization
- 16.7 Visa Checkout Completion
- 16.8 Visa Checkout Purchase Correction
- 16.9 Visa Checkout Refund
- 16.10 Visa Checkout Information
- 17 Testing a Solution
- 17.1 About the Merchant Resource Center
- 17.2 Logging In to the QA Merchant Resource Center
- 17.3 Test Credentials for Merchant Resource Center
- 17.4 Getting a Unique Test Store ID and API Token
- 17.5 Processing a Transaction
- 17.6 Testing INTERAC® Online Payment Solutions
- 17.7 Testing MPI Solutions
- 17.8 Testing Visa Checkout
- 17.9 Test Card Numbers
- 17.10 Simulator Host
- 18 Moving to Production
- Appendix A Definitions of Request Fields
- A.1 Definitions of Request Fields – Credential on File
- A.2 Definition of Request Fields – Recurring
- A.3 Definition of Request Fields for Level 2/3 - Visa
- A.4 Definition of Request Fields for Level 2/3 - MasterCard
- A.5 Definition of Request Fields for Level 2/3 - Amex
- A.6 Definition of Request Fields – Offlinx™
- Appendix B Definitions of Response Fields
- Appendix C Error Messages
- Appendix D Process Flow for Basic Pre-Auth, Re-Auth and Completion Transactions
- Appendix E Merchant Checklists for INTERAC® Online Payment Certification Testing
- Appendix F Third-Party Service Provider Checklists for INTERAC® Online Payment Certification Testing
- Appendix G Merchant Checklists for INTERAC® Online Payment Certification
- Appendix H INTERAC® Online Payment Certification Test Case Detail
- Copyright Notice
- Trademarks
![](asset-1.png)
Java - Moneris Gateway API- Integration Guide
Version: 1.2.3
Copyright © Moneris Solutions, 2018
All rights reserved. No part of this publication may be reproduced,
stored in retrieval systems, or transmitted, in any form or by any means,
electronic, mechanical, photocopying, recording, or otherwise, without
the prior written permission of Moneris Solutions Corporation.
![](asset-2.png)
Moneris Gateway API- Integration Guide
Security and Compliance
Your solution may be required to demonstrate compliance with the card associations’ PCI/CISP/PABP
requirements. For more information on how to make your application PCI-DSS compliant, contact the
Moneris Sales Center and visit https://developer.moneris.com to download the PCI_DSS Imple-
mentation Guide.
All Merchants and Service Providers that store, process, or transmit cardholder data must comply with
PCI DSS and the Card Association Compliance Programs. However, certification requirements vary by
business and are contingent upon your "Merchant Level" or "Service Provider Level".
The card association has some data security standards that define specific requirements for all organ-
izations that store, process, or transmit cardholder data. As a Moneris client or partner using this
method of integration, your solution must demonstrate compliance to the Payment Card Industry Data
Security Standard (PCI DSS) and/or the Payment Application Data Security Standard (PA DSS). These
standards are designed to help the cardholders and merchants in such ways as they ensure credit card
numbers are encrypted when transmitted/stored in a database and that merchants have strong access
control measures.
Non-compliant solutions may prevent merchant boarding with Moneris. A non-compliant merchant can
also be subject to fines, fees, assessments or termination of processing services.
For further information on PCI DSS & PA DSS requirements, visit http://www.pcisecuritystandards.org.
Confidentiality
You have a responsibility to protect cardholder and merchant related confidential account information.
Under no circumstances should ANY confidential information be sent via email while attempting to dia-
gnose integration or production issues. When sending sample files or code for analysis by Moneris staff,
all references to valid card numbers, merchant accounts and transaction tokens should be removed and
or obscured. Under no circumstances should live cardholder accounts be used in the test environment.
November 2018
![](asset-3.png)
Moneris Gateway API- Integration Guide
Changes in v1.2.3
This version adds information about passing Offlinx™ data for the CardMatch pixel tag viaUnified
APItransactions.
November 2018
![](asset-4.png)
Table of Contents
Security and Compliance 2
Confidentiality 2
Changes in v1.2.3 3
1 About This Documentation 10
1.1 Purpose 10
Getting Help 10
1.2 Who Is This Guide For? 11
2 Basic Transaction Set 12
2.1 Basic Transaction Type Definitions 12
2.2 Purchase 14
2.3 Pre-Authorization 19
2.4 Pre-Authorization Completion 25
2.5 Re-Authorization 28
2.6 Force Post 30
2.7 Purchase Correction 33
2.8 Refund 35
2.9 Independent Refund 37
2.10 Card Verification with AVSand CVD 39
2.11 Batch Close 43
2.12 Open Totals 45
3 Credential on File 48
3.1 About Credential on File 48
3.2 Credential on File Info Object and Variables 48
3.3 Credential on File Transaction Types 48
3.4 Initial Transactions in Credential on File 49
3.5 Vault Tokenize Credit Card and Credential on File 49
3.6 Credential on File and Converting Temporary Tokens 49
3.7 Card Verification and Credential on File Transactions 50
3.7.1 When to Use Card Verification With COF 50
3.7.2 Credential on File and Vault Add Token 50
3.7.3 Credential on File and Vault Update Credit Card 51
3.7.4 Credential on File and Vault Add Credit Card 51
3.7.5 Credential on File and Recurring Billing 51
4 Vault 52
4.1 About the Vault TransactionSet 52
4.2 Vault Transaction Types 52
4.2.1 Administrative Vault Transaction types 52
4.2.2 Financial Vault Transaction types 54
4.3 Vault Administrative Transactions 54
4.3.1 Vault Add Credit Card – ResAddCC 54
4.3.1.1 Vault Data Key 58
4.3.1.2 Vault Encrypted Add Credit Card – EncResAddCC 58
4.3.2 Vault Temporary Token Add – ResTempAdd 61
4.3.3 Vault Update Credit Card – ResUpdateCC 63
4.3.3.1 Vault Encrypted Update CC - EncResUpdateCC 67
4.3.4 Vault Delete - ResDelete 70
4.3.5 Vault Lookup Full - ResLookupFull 72
4.3.6 Vault Lookup Masked - ResLookupMasked 73
4.3.7 Vault Get Expiring - ResGetExpiring 75
![](asset-5.png)
4.3.8 Vault Is Corporate Card - ResIscorporateCard 76
4.3.9 Vault Add Token – ResAddToken 77
4.3.10 Vault Tokenize Credit Card – ResTokenizeCC 81
4.4 Vault Financial Transactions 85
4.4.1 Customer ID Changes 85
4.4.2 Purchase withVault – ResPurchaseCC 86
4.4.3 Pre-Authorization with Vault – ResPreauthCC 91
4.4.4 Vault Independent Refund CC- ResIndRefundCC 96
4.4.5 Force Post with Vault - ResForcePostCC 98
4.4.6 Card Verification withVault – ResCardVerificationCC 101
4.5 Hosted Tokenization 105
5 INTERAC® Online Payment 106
5.1 About INTERAC® Online Payment Transactions 106
5.2 Other Documents and References 106
5.3 Website and Certification Requirements 107
5.3.1 Things to provide to Moneris 107
5.3.2 Certification process 107
5.3.3 Client Requirements 108
5.3.4 Delays 108
5.4 Transaction Flow for INTERAC® Online Payment 109
5.5 Sending an INTERAC® Online Payment Purchase Transaction 110
5.5.1 Fund-Guarantee Request 110
5.5.2 Online Banking Response and Fund-Confirmation Request 111
5.6 INTERAC® Online Payment Purchase 111
5.7 INTERAC® Online Payment Refund 114
5.8 INTERAC® Online Payment Field Definitions 116
6 Mag Swipe Transaction Set 119
6.1 Mag Swipe Transaction Type Definitions 119
6.1.1 Encrypted Mag Swipe Transactions 120
6.2 Mag Swipe Purchase 120
6.2.1 Encrypted Mag Swipe Purchase 123
6.3 Mag Swipe Pre-Authorization 125
6.3.1 Encrypted Mag Swipe Pre-Authorization 127
6.4 Mag Swipe Completion 130
6.5 Mag Swipe Force Post 132
6.5.1 Encrypted Mag Swipe Force Post 134
6.6 Mag Swipe Purchase Correction 137
6.7 Mag Swipe Refund 138
6.8 Mag Swipe Independent Refund 140
6.8.1 Encrypted Mag Swipe Independent Refund 143
7 Level 2/3 Transactions 146
7.1 About Level 2/3 Transactions 146
7.2 Level 2/3 Visa Transactions 146
7.2.1 Level 2/3 Transaction Types for Visa 146
7.2.2 Level 2/3 Transaction Flow for Visa 148
7.2.3 VS Completion 148
7.2.4 VS Purchase Correction 153
7.2.5 VS Force Post 155
7.2.6 VS Refund 160
7.2.7 VS Independent Refund 164
7.2.8 VS Corpais 169
7.2.8.1 VS Purcha - Corporate Card CommonData 170
7.2.8.2 VS Purchl - Line Item Details 175
7.2.8.3 Sample Code for VS Corpais 178
![](asset-6.png)
7.3 Level 2/3 MasterCard Transactions 180
7.3.1 Level 2/3 Transaction Types for MasterCard 180
7.3.2 Level 2/3 Transaction Flow for MasterCard 182
7.3.3 MC Completion 182
7.3.4 MC Force Post 184
7.3.5 MC Purchase Correction 186
7.3.6 MC Refund 188
7.3.7 MC Independent Refund 190
7.3.8 MC Corpais - Corporate Card Common Data with Line Item Details 193
7.3.8.1 MC Corpac - Corporate Card Common Data 194
7.3.8.2 MC Corpal - Line Item Details 201
7.3.8.3 Tax Array Object - MC Corpais 204
7.3.8.4 Sample Code for MC Corpais 206
7.4 Level 2/3 American Express Transactions 209
7.4.1 Level 2/3 Transaction Types for Amex 209
7.4.2 Level 2/3 Transaction Flow for Amex 211
7.4.3 Level 2/3 Data Objects in Amex 212
7.4.3.1 About the Level 2/3 Data Objects for Amex 212
7.4.3.2 Defining the AxLevel23 Object 212
Table 1 Object 213
Table 1 - Setting the N1Loop Object 214
Table 1 - Setting the AxRef Object 216
Table 2 Object 217
Table 2 - Setting the AxIt1Loop Object 218
Table 2 - Setting the AxIt106s Object 221
Table 2 - Setting the AxTxi Object 221
Table 3 Object 225
Table 3 - Setting the AxTxi Object 226
7.4.4 AX Completion 229
7.4.5 AX Force Post 232
7.4.6 AX Purchase Correction 236
7.4.7 AX Refund 238
7.4.8 AX Independent Refund 242
8 MPI 246
8.1 About MPI Transactions 246
8.2 3-D Secure Implementations (VbV, MCSC, SafeKey) 246
8.3 Activating VbV and MCSC 247
8.4 Activating Amex SafeKey 247
8.5 Transaction Flow for MPI 247
8.6 MPI Transactions 248
8.6.1 VbV, MCSC and SafeKey Responses 249
8.6.2 MpiTxn Request Transaction 251
8.6.2.1 TXN Response and Creating the Popup 253
8.6.3 Vault MPITransaction – ResMpiTxn 253
8.6.4 MPIACS Request Transaction 255
8.6.4.1 ACS Response and Forming a Transaction 257
8.6.5 Purchase with 3-D Secure – cavvPurchase 257
8.6.5.1 Purchase with 3-D Secure and Recurring Billing 266
8.6.6 Pre-Authorization with 3-DSecure – cavvPreauth 268
8.6.7 Cavv Result Codes for Verified by Visa 274
8.6.8 Vault Cavv Purchase 275
8.6.9 Vault Cavv Pre-Authorization 278
![](asset-7.png)
9 e-Fraud Tools 281
9.1 Address Verification Service 283
9.1.1 About Address Verification Service (AVS) 283
9.1.2 AVS Info Object 283
9.1.3 AVS Response Codes 284
9.1.4 AVS Sample Code 287
9.2 Card Validation Digits (CVD) 288
9.2.1 About Card Validation Digits (CVD) 288
9.2.2 Transactions Where CVDIs Required 288
9.2.3 CVD Info Object 289
9.2.4 CVD Result Codes 290
9.2.5 Sample Purchase with CVD Info Object 290
9.3 Transaction Risk Management Tool 291
9.3.1 About the Transaction Risk Management Tool 291
9.3.2 Introduction to Queries 291
9.3.3 Session Query 292
9.3.3.1 Session Query Transaction Flow 298
9.3.4 Attribute Query 299
9.3.4.1 Attribute Query Transaction Flow 303
9.3.5 Handling Response Information 303
9.3.5.1 TRMT Response Fields 304
9.3.5.2 Understanding the Risk Score 307
9.3.5.3 Understanding the Rule Codes, Rule Names and Rule Messages 308
9.3.5.4 Examples of Risk Response 315
Session Query 315
Attribute Query 316
9.3.6 Inserting the Profiling Tags Into Your Website 316
9.4 Encorporating All Available Fraud Tools 318
9.4.1 Implementation Options for TRMT 318
9.4.2 Implementation Checklist 318
9.4.3 Making a Decision 320
10 Apple Pay In-App and on the Web Integration 321
10.1 About Apple Pay In-App and on the Web Integration 321
10.2 About API Integration of Apple Pay 321
10.2.1 Transaction Types That Use Apple Pay 321
10.3 Apple Pay In-App Process Flows 322
10.4 Cavv Purchase – Apple Pay 323
10.5 Cavv Pre-Authorization – Apple Pay 327
11 Offlinx™ 332
11.1 What Is a Pixel Tag? 332
11.2 Offlinx™ and API Transactions 332
12 Convenience Fee 333
12.1 About Convenience Fee 333
12.2 Purchase with Convenience Fee 333
12.3 Convenience Fee Purchase w/ Customer Information 336
12.4 Convenience Fee Purchase with VbV, MCSC and Amex SafeKey 339
13 Recurring Billing 343
13.1 About Recurring Billing 343
13.2 Purchase with Recurring Billing 343
13.3 Recurring Billing Update 346
13.4 Recurring Billing Response Fields and Codes 350
13.5 Credential on File and Recurring Billing 351
14 Customer Information 353
![](asset-8.png)
14.1 Using the Customer Information Object 353
14.1.1 CustInfo Object – Miscellaneous Properties 354
14.1.2 CustInfo Object – Billing and Shipping Information 354
14.1.2.1 Set Methods for Billing and Shipping Info 355
14.1.2.2 Using Hash Tables for Billing and Shipping Info 355
14.1.3 CustInfo Object – Item Information 355
14.1.3.1 Set Methods for Item Information 356
14.1.3.2 Using Hash Tables for Item Information 356
14.2 Customer Information Sample Code 356
15 Status Check 359
15.1 About Status Check 359
15.2 Using Status Check Response Fields 359
15.3 Sample Purchase with Status Check 360
16 Visa Checkout 361
16.1 About Visa Checkout 361
16.2 Transaction Types - Visa Checkout 361
16.3 Integrating Visa Checkout Lightbox 362
16.4 Transaction Flow for Visa Checkout 363
16.5 Visa Checkout Purchase 364
16.6 Visa Checkout Pre-Authorization 366
16.7 Visa Checkout Completion 368
16.8 Visa Checkout Purchase Correction 370
16.9 Visa Checkout Refund 372
16.10 Visa Checkout Information 374
17 Testing a Solution 377
17.1 About the Merchant Resource Center 377
17.2 Logging In to the QAMerchant Resource Center 377
17.3 Test Credentials for Merchant Resource Center 377
17.4 Getting a Unique Test Store ID and API Token 379
17.5 Processing a Transaction 381
17.5.1 Overview 381
17.5.2 HttpsPostRequest Object 382
17.5.3 Receipt Object 383
17.6 Testing INTERAC® Online Payment Solutions 384
17.7 Testing MPI Solutions 385
17.8 Testing Visa Checkout 386
17.8.1 Creating a Visa Checkout Configuration for Testing 387
17.9 Test Card Numbers 387
17.9.1 Test Card Numbers for Level 2/3 388
17.9.2 Test Cards for Visa Checkout 388
17.10 Simulator Host 388
18 Moving to Production 391
18.1 Activating a Production Store Account 391
18.2 Configuring a Store for Production 391
18.2.1 Configuring an INTERAC® Online Payment Store for Production 392
18.2.1.1 Completing the Certification Registration - Merchants 392
18.2.1.2 Third-Party Service/Shopping Cart Provider 393
18.3 Receipt Requirements 394
18.3.1 Certification Requirements 394
Appendix A Definitions of Request Fields 395
A.1 Definitions of Request Fields – Credential on File 405
A.2 Definition of Request Fields – Recurring 406
A.3 Definition of Request Fields for Level 2/3 - Visa 407
![](asset-9.png)
A.4 Definition of Request Fields for Level 2/3 - MasterCard 416
A.5 Definition of Request Fields for Level 2/3 - Amex 426
A.6 Definition of Request Fields – Offlinx™ 436
Appendix B Definitions of Response Fields 437
Appendix C Error Messages 451
Appendix D Process Flow for Basic Pre-Auth, Re-Auth and Completion Transactions 453
Appendix E Merchant Checklists for INTERAC® Online Payment Certification Testing 454
Appendix F Third-Party Service Provider Checklists for INTERAC® Online Payment Cer-
tification Testing 458
Appendix G Merchant Checklists for INTERAC® Online Payment Certification 463
Appendix H INTERAC® Online Payment Certification Test Case Detail 466
H.1 Common Validations 466
H.2 Test Cases 466
H.3 Merchant front-end test case values 470
Copyright Notice 475
Trademarks 475
![](asset-a.png)
1 About This Documentation
1.1 Purpose
This document describes the transaction information for using the Java API for sending credit card trans-
actions. In particular, it describes the format for sending transactions and the corresponding responses
you will receive.
This document contains information about the following features:
lBasic transactions
lMPI – Verified by Visa, MasterCardSecure Code and American Express SafeKey
lINTERAC®Online Payment
lVault
lMSR (Magnetic Swipe Reader) and Encrypted MSR
lApple Pay and Android Pay In-App
lTransactionRisk Management Tool
lConvenience fee
lVisa Checkout
lMasterCard MasterPass
lLevel 2/3 Transactions
Getting Help
Moneris has help for you at every stage of the integration process.
Getting Started During Development Production
Contact our Client
IntegrationSpecialists:
clientintegrations@moneris.com
Hours:Monday – Friday, 8:30am
to 8 pm ET
If you are already working
with an integration spe-
cialist and need technical
development assistance,
contact our eProducts
Technical Consultants:
1-866-319-7450
eproducts@moneris.com
Hours: 8am to 8pm ET
If your application is already live
and you need production support,
contact Moneris Customer Service:
onlinepayments@moneris.com
1-866-319-7450
Available 24/7
For additional support resources, you can also make use of our community forums at
http://community.moneris.com/product-forums/
November 2018 Page 10 of 476
![](asset-b.png)
Moneris Gateway API- Integration Guide
1.2 Who Is This Guide For?
The Moneris Gateway API- Integration Guide is intended for developers integrating with the Moneris
Gateway.
This guide assumes that the system you are trying to integrate meets the requirements outlined below
and that you have some familiarity with the Java programming language.
System Requirements
l[[[Undefined variable GlobalVariables.ProgrammingLanguageMinimumRequired]]] or above
lPort 443 open for bi-directional communication
lWeb server with a SSL certificate
Page 11 of 476 November 2018
![](asset-c.png)
2 Basic Transaction Set
l2.1 Basic Transaction Type Definitions
l2.2 Purchase
l2.3 Pre-Authorization
l2.4 Pre-Authorization Completion
l2.5 Re-Authorization
l2.6 Force Post
l2.7 Purchase Correction
l2.8 Refund
l2.9 Independent Refund
l2.10 Card Verification with AVSand CVD
l2.11 Batch Close
l2.12 Open Totals
2.1 Basic Transaction Type Definitions
The following is a list of basic transactions that are supported by the Moneris Java API.
Purchase
Verifies funds on the customer’s card, removes the funds and prepares them for deposit into
the merchant’s account.
Pre-Authorization
Verifies and locks funds on the customer’s credit card. The funds are locked for a specified
amount of time based on the card issuer.
To retrieve the funds that have been locked by a Pre-Authorization transaction so that they
may be settled in the merchant’s account, a Completion transaction must be performed. A
Pre-Authorization transaction may only be "completed" once.
Completion
Retrieves funds that have been locked (by either a Pre-Authorization or a Re-Authorization
transaction), and prepares them for settlement into the merchant’s account.
Re-Authorization
If a Pre-Authorization transaction has already taken place, and not all the locked funds were
released by a Completion transaction, a Re-Authorization allows you to lock the remaining
funds so that they can be released by another Completion transaction in the future.
Re-Authorization is necessary because funds that have been locked by a Pre-Authorization
transaction can only be released by a Completion transaction one time. If the Completion
amount is less than the Pre-Authorization amount, the remaining money cannot be "com-
pleted".
Force Post
Retrieves the locked funds and prepares them for settlement into the merchant’s account.
This is used when a merchant obtains the authorization number directly from the issuer by a
third-party authorization method (such as by phone).
Purchase Correction
Restores the full amount of a previous Purchase, Completion or Force Post transaction to the
cardholder's card, and removes any record of it from the cardholder's statement.
November 2018 Page 12 of 476
![](asset-d.png)
Moneris Gateway API- Integration Guide
This transaction is sometimes referred to as "void".
This transaction can be used against a Purchase or Completion transaction that occurred
same day provided that the batch containing the original transaction remains open. When
using the automated closing feature, Batch Close occurs daily between 10 and 11pm Eastern
Time.
Refund
Restores all or part of the funds from a Purchase, Completion or Force Post transaction to the
cardholder's card. Unlike a Purchase Correction, there is a record of both the initial charge
and the refund on the cardholder's statement.
Independent Refund
Credits a specified amount to the cardholder’s credit card. The credit card number and expiry
date are mandatory.
It is not necessary for the transaction that you are refunding to have been processed via the
Moneris Gateway
Card Verification
Verifies the validity of the credit card, expiry date and any additional details (such as the Card
Verification Digits or Address Verification details). It does not verify the available amount or
lock any funds on the credit card.
Recur Update
Alters characteristics of a previously registered Recurring Billing transaction.
This transaction is commonly used to update a customer’s credit card information and the
number of recurs to the account.
Recurring billing is explained in more detail in Section 1 (page 1). The Recur Update transaction
is specifically discussed in Section 1.2 (page 1).
Batch Close
Takes the funds from all Purchase, Completion, Refund and Force Post transactions so that
they will be deposited or debited the following business day.
For funds to be deposited the following business day, the batch must close before 11pm
Eastern Time.
Open Totals
Returns the details about the currently open batch.
This transaction is similar to the Batch Close. The difference is that it does not close the batch
for settlement.
Page 13 of 476 November 2018
![](asset-e.png)
2 Basic Transaction Set
2.2 Purchase
Purchase transaction object definition
Purchase purchase = new Purchase();
HttpsPostRequest object for Purchase transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(purchase);
Purchase transaction values
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
purchase.SetOrderId(order_id);
Amount String 10-character decimal purchase.SetAmount(amount);
Credit card number String 20-character alpha-
numeric
purchase.SetPan(pan);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
purchase.SetExpdate(expiry_
date);
E-commerce indic-
ator
String 1-character alpha-
numeric
purchase.SetCryptType(crypt);
Table 1: Purchase transaction object mandatory values
November 2018 Page 14 of 476
![](asset-f.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
CardMatch ID
NOTE: Applies to Off-
linx™ only; must be
unique value for each
transaction
String 50-character alpha-
numeric
purchase.SetCmId
(transaction_id);
Customer inform-
ation
Object N/A purchase.SetCustInfo
(customer);
AVS Object N/A purchase.SetAvsInfo
(avsCheck);
CVD
NOTE: When storing
credentials on the ini-
tial transaction, the
CVDobject must be
sent; for subsequent
transactions using
stored credentials,
CVD can be sent with
cardholder-initiated
transactions only—
merchants must not
store CVD
information.
Object N/A purchase.SetCvdInfo
(cvdCheck);
Convenience fee
NOTE: This variable
does not apply to Cre-
dential onFile trans-
actions.
Object N/A purchase.SetConvFeeInfo
(convFeeInfo);
Recurring billing Object N/A purchase.SetRecur(recurring_
cycle);
Table 2: Purchase transaction object optional values
Page 15 of 476 November 2018
![](asset-10.png)
2 Basic Transaction Set
Value Type Limits Set method
Dynamic descriptor String 20-character alpha-
numeric
purchase
.SetDynamicDescriptor
(dynamic_descriptor);
Wallet indicator1
NOTE: For basic
Purchase and Preau-
thorization, the wallet
indicator applies to
Visa Checkout and
MasterCard Master-
Pass only. For more,
see Appendix A Defin-
itions of Request
Fields
String 3-character alpha-
numeric
purchase.SetWalletIndicator
(wallet_indicator);
Credential on File Info
cof
NOTE: This is a nested
object within the
transaction, and
required when storing
or using the cus-
tomer's stored cre-
dentials. The
Credential on File Info
object has its own
request variables, lis-
ted in blue in the
table below, "Cre-
dential on File Object
Request Variables".
Object N/A purchase.SetCofInfo(cof);
Table 2: Purchase transaction object optional values
1Available to Canadian integrations only.
November 2018 Page 16 of 476
![](asset-11.png)
Moneris Gateway API- Integration Guide
Credential onFile Transaction Object Request Fields
Value Type Limits Set Method
Issuer ID
NOTE: This variable is
required for all mer-
chant-intiated trans-
actions following the
first one; upon sending
the first transaction,
the Issuer ID value is
received in the trans-
action response and
then used in sub-
sequent transaction
requests.
String 15-character alpha-
numeric
variable length
cof.SetIssuerId("VALUE_FOR_
ISSUER_ID");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Indicator String 1-character alphabetic cof.SetPaymentIndicator
("PAYMENT_INDICATOR_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Inform-
ation
String 1-character numeric cof.SetPaymentInformation
("PAYMENT_INFO_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Sample Purchase
using System;
using System.Collections.Generic;
using System.Text;
using Moneris;
namespace CanadaPurchaseConsoleTest
{
class CanadaPurchaseTest
{
public static void Main(string[] args)
{
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string store_id = "store5";
string api_token = "yesguy";
Page 17 of 476 November 2018
![](asset-12.png)
2 Basic Transaction Set
Sample Purchase
string amount = "5.00";
string pan = "4242424242424242";
string expdate = "1901"; //YYMM format
string crypt = "7";
string processing_country_code = "CA";
bool status_check = false;
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("12345678901234");
Purchase purchase = new Purchase();
purchase.SetOrderId(order_id);
purchase.SetAmount(amount);
purchase.SetPan(pan);
purchase.SetExpDate("2011");
purchase.SetCryptType(crypt);
purchase.SetDynamicDescriptor("2134565");
//purchase.SetWalletIndicator(""); //Refer to documentation for details
purchase.SetCofInfo(cof);
//Optional - Set for Multi-Currency only
//setAmount must be 0.00 when using multi-currency
//purchase.SetMCPAmount("500"); //penny value amount 1.25 = 125
//purchase.SetMCPCurrencyCode("840"); //ISO-4217 country currency number
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(purchase);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
Console.WriteLine("HostId = " + receipt.GetHostId());
Console.WriteLine("MCPAmount = " + receipt.GetMCPAmount());
Console.WriteLine("MCPCurrencyCode = " + receipt.GetMCPCurrencyCode());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
November 2018 Page 18 of 476
![](asset-13.png)
Moneris Gateway API- Integration Guide
Sample Purchase
}
}
}
}
2.3 Pre-Authorization
Things to Consider:
lIf a Pre-Authorization transaction is not followed by a Completion transaction, it must
be reversed via a Completion transaction for 0.00. See "Pre-Authorization Completion"
on page25
lA Pre-Authorization transaction may only be "completed" once . If the Completion
transaction is for less than the original amount, a Re-Authorization transaction is
required to collect the remaining funds by another Completion transaction. See Re-
Authorization (page 28).
lFor a process flow, see "Process Flow for Basic Pre-Auth, Re-Auth and Completion Trans-
actions" on page453
Pre-Authorization transaction object definition
PreAuth preauth = new PreAuth();
HttpsPostRequest object for Pre-Authorization transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(preauth);
Pre-Authorization transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
preauth.SetOrderId(order_
id);
Amount String 9-character decimal preauth.SetAmount(amount);
Credit card number String 20-character numeric preauth.SetPan(pan);
Expiry date String 4-character numeric preauth.SetExpdate(expiry_
Table 3: Pre-Authorization object required values
Page 19 of 476 November 2018
![](asset-14.png)
2 Basic Transaction Set
Value Type Limits Set method
date);
E-Commerce indicator String 1-character alpha-
numeric
preauth.SetCryptType(crypt);
Table 3: Pre-Authorization object required values (continued)
Value Type Limits Set method
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Dynamic descriptor String 20-character alpha-
numeric
preauth.SetDynamicDescriptor
(dynamic_descriptor);
CardMatch ID
NOTE: Applies to Off-
linx™ only; must be
unique value for each
transaction
String 50-character alpha-
numeric
preauth.SetCmId(transaction_
id);
Customer inform-
ation
Object N/A preauth.SetCustInfo
(customer);
AVS Object N/A preauth.SetAvsInfo
(avsCheck);
CVD
NOTE: When storing
credentials on the ini-
tial transaction, the
CVDobject must be
sent; for subsequent
transactions using
stored credentials,
CVD can be sent with
cardholder-initiated
transactions only—
merchants must not
store CVD
information.
Object N/A preauth.SetCvdInfo
(cvdCheck);
Table 4: Pre-Authorization object optional values
November 2018 Page 20 of 476
![](asset-15.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
preauth.SetCustId(cust_id);
Wallet indicator1
NOTE: For basic
Purchase and Preau-
thorization, the wallet
indicator applies to
Visa Checkout and
MasterCard Master-
Pass only. For more,
see Appendix A Defin-
itions of Request
Fields
String 3-character alpha-
numeric
preauth.SetWalletIndicator
(wallet_indicator);
Credential on File Info
cof
NOTE: This is a nested
object within the
transaction, and
required when storing
or using the cus-
tomer's stored cre-
dentials. The
Credential on File Info
object has its own
request variables, lis-
ted in blue in the
table below, "Cre-
dential on File Object
Request Variables".
Object N/A cof.SetCofInfo(cof);
1Available to Canadian integrations only.
Page 21 of 476 November 2018
![](asset-16.png)
2 Basic Transaction Set
Credential onFile Transaction Object Request Fields
Value Type Limits Set Method
Issuer ID
NOTE: This variable is
required for all mer-
chant-intiated trans-
actions following the
first one; upon sending
the first transaction,
the Issuer ID value is
received in the trans-
action response and
then used in sub-
sequent transaction
requests.
String 15-character alpha-
numeric
variable length
cof.SetIssuerId("VALUE_FOR_
ISSUER_ID");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Indicator String 1-character alphabetic cof.SetPaymentIndicator
("PAYMENT_INDICATOR_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Inform-
ation
String 1-character numeric cof.SetPaymentInformation
("PAYMENT_INFO_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Sample Pre-Authorization
using System;
using System.Collections.Generic;
using System.Text;
using Moneris;
namespace CanadaPurchaseConsoleTest
{
class CanadaPreauthTest
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
November 2018 Page 22 of 476
![](asset-17.png)
Moneris Gateway API- Integration Guide
Sample Pre-Authorization
string amount = "5.00";
string pan = "4242424242424242";
string expdate = "0412";
string crypt = "7";
string processing_country_code = "CA";
bool status_check = false;
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("12345678901234");
PreAuth preauth = new PreAuth();
preauth.SetOrderId(order_id);
preauth.SetAmount(amount);
preauth.SetPan(pan);
preauth.SetExpDate(expdate);
preauth.SetCryptType(crypt);
//preauth.SetWalletIndicator(""); //Refer to documentation for details
preauth.SetCofInfo(cof);
//Optional - Set for Multi-Currency only
//setAmount must be 0.00 when using multi-currency
//preauth.SetMCPAmount("500"); //penny value amount 1.25 = 125
//preauth.SetMCPCurrencyCode("840"); //ISO-4217 country currency number
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(preauth);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
//Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
//Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.WriteLine("MCPAmount = " + receipt.GetMCPAmount());
Console.WriteLine("MCPCurrencyCode = " + receipt.GetMCPCurrencyCode());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
Page 23 of 476 November 2018
![](asset-18.png)
2 Basic Transaction Set
Sample Pre-Authorization
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Moneris;
namespace CanadaPurchaseConsoleTest
{
class CanadaPreauthTest
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string amount = "5.00";
string pan = "4242424242424242";
string expdate = "0412";
string crypt = "7";
string processing_country_code = "CA";
bool status_check = false;
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("168451306048014");
PreAuth preauth = new PreAuth();
preauth.SetOrderId(order_id);
preauth.SetAmount(amount);
preauth.SetPan(pan);
preauth.SetExpDate(expdate);
preauth.SetCryptType(crypt);
//preauth.SetWalletIndicator(""); //Refer to documentation for details
preauth.SetCofInfo(cof);
//Optional - Set for Multi-Currency only
//setAmount must be 0.00 when using multi-currency
//preauth.SetMCPAmount("500"); //penny value amount 1.25 = 125
//preauth.SetMCPCurrencyCode("840"); //ISO-4217 country currency number
//preauth.SetCmId("8nAK8712sGaAkls56"); //set only for usage with Offlinx - Unique max 50
alphanumeric characters transaction id generated by merchant
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(preauth);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
November 2018 Page 24 of 476
![](asset-19.png)
Moneris Gateway API- Integration Guide
Sample Pre-Authorization
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
//Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
//Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.WriteLine("MCPAmount = " + receipt.GetMCPAmount());
Console.WriteLine("MCPCurrencyCode = " + receipt.GetMCPCurrencyCode());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
2.4 Pre-Authorization Completion
Things to Consider:
lCompletion is also known as "capture" or "pre-authorization completion".
lA Pre-Authorization or Re-Authorization transaction can only be completed once. Refer
to the Re-Authorization transaction (page 28 for more information on how to perform
multiple Completion transactions.
lTo reverse the full amount of a Pre-Authorization transaction, use the Completion trans-
action with the amount set to 0.00.
lTo process this transaction, you need the order ID and transaction number from the ori-
ginal Pre-Authorization transaction.
lFor a process flow, see "Process Flow for Basic Pre-Auth, Re-Auth and Completion Trans-
actions" on page453
Completion transaction object
Completion completion = new Completion();
HttpsPostRequest object for Completion transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(completion);
Page 25 of 476 November 2018
![](asset-1a.png)
2 Basic Transaction Set
Completion transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character
alphanumeric
completion.SetOrderId(order_
id);
Completion Amount String 9-character decimal completion.SetCompAmount(comp_
amount);
Transaction number String 255-character
alphanumeric
completion.SetTxnNumber(txn_
number);
E-Commerce indicator String 1-character
alphanumeric
completion.SetCryptType
(crypt);
Table 5: Completion transaction object mandatory values
Value Type Limits Set method
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Customer ID String 50-character alpha-
numeric
completion.SetCustId(cust_
id);
Dynamic descriptor String 20-character alpha-
numeric
completion
.SetDynamicDescriptor
(dynamic_descriptor);
Shipping indicator1String 1-character alpha-
numeric
completion.SetShipIndicator
(ship_indicator);
Table 6: Completion transaction optional values
Sample Basic Pre-Authorization Completion
namespace Moneris
{
using System;
public class TestCanadaCompletion
{
public static void Main(string[] args)
{
string store_id = "store5";
1Available to Canadian integrations only.
November 2018 Page 26 of 476
![](asset-1b.png)
Moneris Gateway API- Integration Guide
Sample Basic Pre-Authorization Completion
string api_token = "yesguy";
string order_id = "Test20160815041528";
string amount = "2.00";
string txn_number = "118149-0_10";
string crypt = "7";
string cust_id = "my customer id";
string dynamic_descriptor = "my descriptor";
string ship_indicator = "F";
string processing_country_code = "CA";
bool status_check = false;
Completion completion = new Completion();
completion.SetOrderId(order_id);
completion.SetCompAmount(amount);
completion.SetTxnNumber(txn_number);
completion.SetCryptType(crypt);
completion.SetCustId(cust_id);
completion.SetDynamicDescriptor(dynamic_descriptor);
//completion.SetShipIndicator(ship_indicator); //optional
//Optional - Set for Multi-Currency only
//setAmount must be 0.00 when using multi-currency
//completion.SetMCPAmount("300"); //penny value amount 1.25 = 125
//completion.SetMCPCurrencyCode("840"); //ISO-4217 country currency number
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(completion);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
Console.WriteLine("MCPAmount = " + receipt.GetMCPAmount());
Console.WriteLine("MCPCurrencyCode = " + receipt.GetMCPCurrencyCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Page 27 of 476 November 2018
![](asset-1c.png)
2 Basic Transaction Set
2.5 Re-Authorization
For a process flow, Process Flow for Basic Pre-Auth, Re-Auth and Completion Transactions (page 453).
Re-Authorization transaction object definition
ReAuth reauth = new ReAuth();
HttpsPostRequest object for Re-Authorization transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(reauth);
Re-Authorization transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
reauth.SetOrderId(order_
id);;
Original order ID String 50-character alpha-
numeric
reauth.SetOrigOrderId(orig_
order_id);
Amount String 9-character decimal reauth.SetAmount(amount);
Transaction number String 255-character variable
character
reauth.SetTxnNumber(txn_
number);
E-Commerce indicator String 1-character alpha-
numeric
reauth.SetCryptType(crypt);
Table 7: Re-Authorization transaction object mandatory values
Value Type Limits Set Method
Customer ID String 50-character alpha-
numeric
reauth.SetCustId(cust_id);
Status check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Dynamic descriptor String 20-character alpha-
numeric
reauth.SetDynamicDescriptor
(dynamic_descriptor);
Table 1 Re-Authorization transaction optional values
November 2018 Page 28 of 476
![](asset-1d.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set Method
Customer inform-
ation
Object N/A reauth.SetCustInfo
(customer);
AVS Object N/A reauth.SetAvsInfo(avsCheck);
CVD
NOTE: When storing
credentials on the ini-
tial transaction, the
CVDobject must be
sent; for subsequent
transactions using
stored credentials,
CVD can be sent with
cardholder-initiated
transactions only—
merchants must not
store CVD
information.
Object N/A reauth.SetCvdInfo(cvdCheck);
Table 1 Re-Authorization transaction optional values
Sample Re-Authorization
namespace Moneris
{
using System;
public class TestCanadaReauth
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "mvt2713557ss83ss9ssdfsdfsdf";
string orig_order_id = "mvt3525350028";
string amount = "1.00";
string txn_number = "113457-0_10";
string crypt = "8";
string dynamic_descriptor = "123456";
string cust_id = "my customer id";
string processing_country_code = "CA";
bool status_check = false;
ReAuth reauth = new ReAuth();
reauth.SetOrderId(order_id);
reauth.SetCustId(cust_id);
reauth.SetOrigOrderId(orig_order_id);
reauth.SetTxnNumber(txn_number);
reauth.SetAmount(amount);
reauth.SetCryptType(crypt);
reauth.SetDynamicDescriptor(dynamic_descriptor);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
Page 29 of 476 November 2018
![](asset-1e.png)
2 Basic Transaction Set
Sample Re-Authorization
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(reauth);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
2.6 Force Post
Things to Consider:
lThis transaction is an independent completion where the original Pre-Authorization
transaction was not processed via the same Moneris Gateway merchant account.
lIt is not required for the transaction that you are submitting to have been processed via
the Moneris Gateway. However, a credit card number, expiry date and original author-
ization number are required.
lForce Post transactions are not supported for UnionPay
ForcePost transaction object definition
ForcePost forcepost = new ForcePost();
HttpsPostRequest object for ForcePost transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
November 2018 Page 30 of 476
![](asset-1f.png)
Moneris Gateway API- Integration Guide
mpgReq.SetTransaction(forcepost);
Force Post transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
forcepost.SetOrderId(order_
id);
Amount String 9-character decimal forcepost.SetAmount(amount);
Credit card number String 20-character numeric forcepost.SetPan(pan);
Expiry date String 4-character numeric forcepost.SetExpdate(expiry_
date);
Authorization code String 8-character alpha-
numeric
forcepost.SetAuthCode(auth_
code);
E-Commerce indicator String 1-character alpha-
numeric
forcepost.SetCryptType
(crypt);
Table 8: Force Post transaction object mandatory values
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
forcepost.SetCustId(cust_
id);
Dynamic descriptor String 20-character alpha-
numeric
forcepost
.SetDynamicDescriptor
(dynamic_descriptor);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Table 9: Force Post transaction optional values
Sample Basic Force Post
using System;
namespace Moneris
{
public class TestCanadaForcePost
{
public static void Main(string[] args)
{
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
Page 31 of 476 November 2018
![](asset-20.png)
2 Basic Transaction Set
Sample Basic Force Post
string cust_id = "my customer id";
string store_id = "moneris";
string api_token = "hurgle";
string amount = "59.00";
string pan = "4242424242424242";
string expdate = "1901"; //YYMM format
string auth_code = "88864";
string crypt = "7";
string dynamic_descriptor = "my descriptor";
string processing_country_code = "CA";
bool status_check = false;
ForcePost forcepost = new ForcePost();
forcepost.SetOrderId(order_id);
forcepost.SetCustId(cust_id);
forcepost.SetAmount(amount);
forcepost.SetPan(pan);
forcepost.SetExpDate(expdate);
forcepost.SetAuthCode(auth_code);
forcepost.SetCryptType(crypt);
forcepost.SetDynamicDescriptor(dynamic_descriptor);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(forcepost);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CorporateCard = " + receipt.GetCorporateCard());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
//Console.WriteLine("MessageId = " + receipt.GetMessageId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
November 2018 Page 32 of 476
![](asset-21.png)
Moneris Gateway API- Integration Guide
2.7 Purchase Correction
Things to Consider:
lPurchase correction is also known as "void" or "correction".
lTo process this transaction, you need the order ID and the transaction number from
the original Completion, Purchase or Force Post transaction.
Purchase Correction transaction object definition
PurchaseCorrection purchasecorrection = new PurchaseCorrection();
HttpsPostRequest object for Purchase Correction transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(purchasecorrection);
Purchase Correction transaction object values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
purchasecorrection
.SetOrderId(order_id);
Transaction number String 255-character variable
character
purchasecorrection
.SetTxnNumber(txn_number);
E-Commerce indicator String 1-character alpha-
numeric
purchasecorrection
.SetCryptType(crypt);
Table 10: Purchase Correction transaction object mandatory values
Value Type Limits Set method
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Customer ID String 50-character alpha-
numeric
purchasecorrection.SetCustId
(cust_id);
Dynamic descriptor String 20-character alpha-
numeric
purchasecorrection
.SetDynamicDescriptor
(dynamic_descriptor);
Table 11: Purchase Correction transaction optional values
Page 33 of 476 November 2018
![](asset-22.png)
2 Basic Transaction Set
Sample Purchase Correction
namespace Moneris
{
using System;
public class TestCanadaPurchaseCorrection
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test20150723031154";
string txn_number = "165745-0_10";
string crypt = "8";
string dynamic_descriptor = "123456";
string processing_country_code = "CA";
bool status_check = false;
PurchaseCorrection purchasecorrection = new PurchaseCorrection();
purchasecorrection.SetOrderId(order_id);
purchasecorrection.SetTxnNumber(txn_number);
purchasecorrection.SetCryptType(crypt);
purchasecorrection.SetDynamicDescriptor(dynamic_descriptor);
purchasecorrection.SetCustId("my customer id");
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(purchasecorrection);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
November 2018 Page 34 of 476
![](asset-23.png)
Moneris Gateway API- Integration Guide
2.8 Refund
To process this transaction, you need the order ID and transaction number from the original Com-
pletion, Purchase or Force Post transaction.
Refund transaction object definition
Refund refund = new Refund();
HttpsPostRequest object for Refund transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(refund);
Refund transaction object values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
refund.SetOrderId(order_id);
Amount String 9-character decimal refund.SetAmount(amount);
Transaction number String 255-character variable
character
refund.SetTxnNumber(txn_
number);
E-Commerce indicator String 1-character alpha-
numeric
refund.SetCryptType(crypt);
Table 12: Refund transaction object mandatory values
Value Type Limits Set method
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Table 13: Refund transaction optional values
Sample Refund
namespace Moneris
{
using System;
public class TestCanadaRefund
{
public static void Main(string[] args)
{
string store_id = "store1";
Page 35 of 476 November 2018
![](asset-24.png)
2 Basic Transaction Set
Sample Refund
string api_token = "yesguy";
string amount = "1.00";
string crypt = "7";
string dynamic_descriptor = "123456";
string custid = "mycust9";
string order_id = "mvt3230836758";
string txn_number = "21964-0_10";
string processing_country_code = "CA";
bool status_check = false;
Refund refund = new Refund();
refund.SetTxnNumber(txn_number);
refund.SetOrderId(order_id);
refund.SetAmount(amount);
refund.SetCryptType(crypt);
refund.SetCustId(custid);
refund.SetDynamicDescriptor(dynamic_descriptor);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(refund);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
November 2018 Page 36 of 476
![](asset-25.png)
Moneris Gateway API- Integration Guide
2.9 Independent Refund
Things to Consider:
lBecause 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.
Independent Refund transaction object definition
IndependentRefund indrefund = new IndependentRefund();
HttpsPostRequest object for Independent Refund transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(indrefund);
Independent Refund transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
indrefund.SetOrderId(order_
id);
Amount String 9-character decimal indrefund.SetAmount(amount);
Credit card number String 20-character alpha-
numeric
indrefund.SetPan(pan);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
indrefund.SetExpdate(expiry_
date);
E-Commerce indicator String 1-character alpha-
numeric
indrefund.SetCryptType
(crypt);
Table 14: Independent Refund transaction object mandatory values
Page 37 of 476 November 2018
![](asset-26.png)
2 Basic Transaction Set
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
indrefund.SetCustId(cust_
id);
Dynamic descriptor String 20-character alpha-
numeric
indrefund
.SetDynamicDescriptor
(dynamic_descriptor);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Table 15: Independent Refund transaction optional values
Sample Independent Refund
namespace Moneris
{
using System;
public class TestCanadaIndependentRefund
{
public static void Main(string[] args)
{
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string store_id = "store5";
string api_token = "yesguy";
string cust_id = "my customer id";
string amount = "20.00";
string pan = "4242424242424242";
string expdate = "1901"; //YYMM
string crypt = "7";
string processing_country_code = "CA";
bool status_check = false;
IndependentRefund indrefund = new IndependentRefund();
indrefund.SetOrderId(order_id);
indrefund.SetCustId(cust_id);
indrefund.SetAmount(amount);
indrefund.SetPan(pan);
indrefund.SetExpdate(expdate);
indrefund.SetCryptType(crypt);
indrefund.SetDynamicDescriptor("123456");
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(indrefund);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
November 2018 Page 38 of 476
![](asset-27.png)
Moneris Gateway API- Integration Guide
Sample Independent Refund
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
2.10 Card Verification with AVSand CVD
Things to Consider:
lThe Card Verification transaction is only supported by Visa, MasterCard and Discover
lFor some Credential onFile transactions, Card Verification with AVSand CVDis used as
a prior step to get the Issuer IDused in the subsequent transaction
lFor Card Verification, CVD is supported by Visa, MasterCard and Discover.
lFor Card Verification, AVS is supported by Visa, MasterCard and Discover.
lWhen testing Card Verification, please use the Visa and MasterCard test card numbers
provided in the MasterCard Card Verification and Visa Card Verification tables available
in CVD & AVS (E-Fraud) Simulator.
lFor a full list of possible AVS & CVD result codes refer to the CVD and AVS Result Code
tables.
Card Verification object definition
CardVerification cardVerification = new CardVerification();
HttpsPostRequest object for Card Verification transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(cardVerification);
Page 39 of 476 November 2018
![](asset-28.png)
2 Basic Transaction Set
Card Verification transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
cardVerification.SetOrderId
(order_id);
Credit card number String 20-character alpha-
numeric
cardVerification.SetPan
(pan);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
cardVerification.SetExpdate
(expiry_date);
E-commerce indicator String 1-character alpha-
numeric
cardVerification
.SetCryptType(crypt);
AVS Object N/A cardVerification.SetAvsInfo
(avsCheck);
CVD
NOTE: When storing
credentials on the ini-
tial transaction, the
CVDobject must be
sent; for subsequent
transactions using
stored credentials, CVD
can be sent with card-
holder-initiated trans-
actions only—
merchants must not
store CVD information.
Object N/A cardVerification.SetCvdInfo
(cvdCheck);
Table 16: Card Verification transaction object mandatory values
November 2018 Page 40 of 476
![](asset-29.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set Method
Credential on File Info
cof
NOTE: This is a nested
object within the trans-
action, and required
when storing or using
the customer's stored
credentials. The Cre-
dential on File Info
object has its own
request variables, lis-
ted in blue in the table
below, "Credential on
File Object Request
Variables".
Object N/A cardVerification.SetCofInfo
(cof);
Table 17: Basic Card Verification transaction object optional values
Credential onFile Transaction Object Request Fields
Value Type Limits Set Method
Issuer ID
NOTE: This variable is
required for all mer-
chant-intiated trans-
actions following the
first one; upon sending
the first transaction,
the Issuer ID value is
received in the trans-
action response and
then used in sub-
sequent transaction
requests.
String 15-character alpha-
numeric
variable length
cof.SetIssuerId("VALUE_FOR_
ISSUER_ID");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Indicator String 1-character alphabetic cof.SetPaymentIndicator
("PAYMENT_INDICATOR_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Inform-
ation
String 1-character numeric cof.SetPaymentInformation
("PAYMENT_INFO_VALUE");
Page 41 of 476 November 2018
![](asset-2a.png)
2 Basic Transaction Set
Value Type Limits Set Method
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Sample Card Verification
namespace Moneris
{
using System;
public class TestCanadaCardVerficiation
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string pan = "4242424242424242";
string expdate = "1901"; //YYMM format
string crypt = "7";
string processing_country_code = "CA";
bool status_check = false;
AvsInfo avsCheck = new AvsInfo();
avsCheck.SetAvsStreetNumber("212");
avsCheck.SetAvsStreetName("Payton Street");
avsCheck.SetAvsZipCode("M1M1M1");
CvdInfo cvdCheck = new CvdInfo();
cvdCheck.SetCvdIndicator("1");
cvdCheck.SetCvdValue("099");
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("12345678901234");
CardVerification cardVerification = new CardVerification();
cardVerification.SetOrderId(order_id);
cardVerification.SetPan(pan);
cardVerification.SetExpDate(expdate);
cardVerification.SetCryptType(crypt);
cardVerification.SetAvsInfo(avsCheck);
cardVerification.SetCvdInfo(cvdCheck);
cardVerification.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(cardVerification);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
November 2018 Page 42 of 476
![](asset-2b.png)
Moneris Gateway API- Integration Guide
Sample Card Verification
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
2.11 Batch Close
Batch Close transaction object definition
BatchClose batchclose = new BatchClose();
HttpsPostRequest object for Batch Close transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(batchclose);
Batch Close transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
ECR(electronic cash
register) number
String No limit (value
provided by Moneris)
batchclose.SetEcrno(ecr_no);
Table 18: Batch Close transaction object mandatory values
Sample Batch Close
namespace Moneris
{
Page 43 of 476 November 2018
![](asset-2c.png)
2 Basic Transaction Set
Sample Batch Close
using System;
public class TestCanadaBatchClose
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string ecr_no = "66013455"; //ecr within store
string processing_country_code = "CA";
bool status_check = false;
BatchClose batchclose = new BatchClose();
batchclose.SetEcrno(ecr_no);
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(batchclose);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
if ((receipt.GetReceiptId()).Equals("Global Error Receipt"))
{
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = null");
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
}
else
{
foreach (string ecr in receipt.GetTerminalIDs())
{
Console.WriteLine("ECR: " + ecr);
foreach (string cardType in receipt.GetCreditCards(ecr))
{
Console.WriteLine("\tCard Type: " + cardType);
Console.WriteLine("\t\tPurchase: Count = "
+ receipt.GetPurchaseCount(ecr, cardType)
+ " Amount = "
+ receipt.GetPurchaseAmount(ecr,
cardType));
Console.WriteLine("\t\tRefund: Count = "
+ receipt.GetRefundCount(ecr, cardType)
+ " Amount = "
+ receipt.GetRefundAmount(ecr, cardType));
November 2018 Page 44 of 476
![](asset-2d.png)
Moneris Gateway API- Integration Guide
Sample Batch Close
Console.WriteLine("\t\tCorrection: Count = "
+ receipt.GetCorrectionCount(ecr, cardType)
+ " Amount = "
+ receipt.GetCorrectionAmount(ecr,
cardType));
}
}
}
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
2.12 Open Totals
OpenTotals transaction object definition
OpenTotals opentotals = new OpenTotals();
HttpsPostRequest object for Open Totals transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(opentotals);
Open Totals transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
ECR(electronic cash
register) number
String No limit (value
provided by Moneris)
opentotals.SetEcrno(ecr_no);
Table 19: Open Totals transaction object mandatory values
Sample Open Totals
namespace Moneris
{
using System;
public class TestCanadaOpenTotals
{
public static void Main(string[] args)
{
string store_id = "store5";
Page 45 of 476 November 2018
![](asset-2e.png)
2 Basic Transaction Set
Sample Open Totals
string api_token = "yesguy";
string ecr_no = "66013455";
//string ecr_no = "66013455";
string processing_country_code = "CA";
OpenTotals opentotals = new OpenTotals();
opentotals.SetEcrno(ecr_no);
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(opentotals);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
if ((receipt.GetReceiptId()).Equals("Global Error Receipt") ||
receipt.GetReceiptId().Equals("") ||
receipt.GetReceiptId().Equals("null"))
{
Console.WriteLine("CardType = null ");
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = null");
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
}
else
{
foreach (string ecr in receipt.GetTerminalIDs())
{
Console.WriteLine("ECR: " + ecr);
foreach (string cardType in receipt.GetCreditCards(ecr))
{
Console.WriteLine("\tCard Type: " + cardType);
Console.WriteLine("\t\tPurchase: Count = "
+ receipt.GetPurchaseCount(ecr, cardType)
+ " Amount = "
+ receipt.GetPurchaseAmount(ecr,
cardType));
Console.WriteLine("\t\tRefund: Count = "
+ receipt.GetRefundCount(ecr, cardType)
+ " Amount = "
+ receipt.GetRefundAmount(ecr, cardType));
Console.WriteLine("\t\tCorrection: Count = "
+ receipt.GetCorrectionCount(ecr, cardType)
+ " Amount = "
+ receipt.GetCorrectionAmount(ecr,
cardType));
November 2018 Page 46 of 476
![](asset-2f.png)
Moneris Gateway API- Integration Guide
Sample Open Totals
}
}
}
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Page 47 of 476 November 2018
![](asset-30.png)
3 Credential on File
l3.1 About Credential on File
l3.2 Credential on File Info Object and Variables
l3.3 Credential on File Transaction Types
l3.4 Initial Transactions in Credential on File
l3.5 Vault Tokenize Credit Card and Credential on File
l3.7 Card Verification and Credential on File Transactions
3.1 About Credential on File
When storing customers' credit card credentials for use in future authorizations, or when using these cre-
dentials in subsequent transactions, card brands now require merchants to indicate this in the trans-
action request.
In the Moneris API, this is handled by the Moneris Gateway via the inclusion of the Credential onFile info
object and its variables in the transaction request.
While the requirements for handling Credential onFile transactions relate to Visa, Mastercard and Dis-
cover only, in order to avoid confusion and prevent error, please implement these changes for all card
types and the Moneris system will then correctly flow the relevant card data values as appropriate.
While in the testing phase, we recommend that you test with Visa cards because implementation for the
other card brands is still in process.
NOTE: If either the first transaction or a Card Verification authorization is declined when
attempting to store cardholder credentials, those credentials cannot be stored —therefore
the merchant must not use the credential for any subsequent transactions.
3.2 Credential on File Info Object and Variables
The Credential onFile Info object is nested within the request for the applicable transaction types.
Object:
cof
Variables in the cof object:
Payment Indicator
Payment Information
Issuer ID
For more information, see Definitions of Request Fields – Credential on File.
3.3 Credential on File Transaction Types
The Credential onFile Info object applies to the following transaction types:
November 2018 Page 48 of 476
![](asset-31.png)
Moneris Gateway API- Integration Guide
lPurchase
lPre-Authorization
lPurchase with 3-D Secure – cavvPurchase
lPurchase with 3-D Secure and Recurring Billing
lPre-Authorization with 3-DSecure – cavvPreauth
lPurchase withVault – ResPurchaseCC
lPre-Authorization with Vault – ResPreauthCC
lCard Verification with AVSand CVD
lCard Verification withVault – ResCardVerificationCC
lVault Add Credit Card – ResAddCC
lVault Update Credit Card – ResUpdateCC
lVault Add Token – ResAddToken
lVault Tokenize Credit Card – ResTokenizeCC
lRecurring Billing
3.4 Initial Transactions in Credential on File
When sending an initial transaction with the Credential on File Info object, i.e., a transaction request
where the cardholder's credentials are being stored for the first time, it is important to understand the
following:
lYou must send the cardholder'sCard Verification Digits (CVD)
lIssuer IDwill be sent without a value on the initial transaction, because it is received in the
response to that initial transaction; for all subsequent merchant-intiated transactions and all
administrative transactions you send this Issuer ID
lThe payment information field should always be set to a value of 0 on the first transaction
lThe payment indicator field should be set to the value that is appropriate for the transaction
3.5 Vault Tokenize Credit Card and Credential on File
When you want to store cardholder credentials from previous transactions into the Vault, you use the
Vault Tokenize Credit Card transaction request. Credential on File rules require that only previous trans-
actions with the Credential onFile Info object can be tokenized to the Vault.
For more information about this transaction, see 4.3.10 Vault Tokenize Credit Card – ResTokenizeCC.
3.6 Credential on File and Converting Temporary Tokens
In the event you decide to convert a temporary token representing cardholder credentials into a per-
manent token, these credentials become stored credentials, and therefore necessary to send Credential
onFile information.
For Temporary Token Add transactions where you subsequently decide to convert the temporary token
into a permanent token (stored credentials):
Page 49 of 476 November 2018
![](asset-32.png)
3 Credential on File
1. Send a transaction request that includes the Credential onFile Info object to get the Issuer ID; this
can be a CardVerification, Purchase or Pre-Authorization request
2. After completing the transaction, send the Vault Add Token request with the Credential onFile
object (IssuerID only) in order to convert the temporary token to a permanent one.
3.7 Card Verification and Credential on File Transactions
In the absence of a Purchase or Pre-Authorization, a Card Verification transaction is used to get the
unique Issuer IDvalue (issuerId) that is used in subsequent Credential on File transactions. IssuerIDis a
variable included in the nested Credential onFile Info object.
For all first-time transactions, including Card Verification transactions, you must also request the card-
holder's CardVerification Details (CVD). For more onCVD, see 9.2 Card Validation Digits (CVD).
For a complete list of these variables, see each transaction type or Definitions of Request Fields – Cre-
dential on File
The Card Verification request, including the Credential on File Info object, must be sent immediately prior
to storing cardholder credentials.
For information about Card Verification, see 2.10 Card Verification with AVSand CVD.
3.7.1 When to Use Card Verification With COF
If you are not sending a Purchase or Pre-Authorization transaction (i.e., you are not charging the cus-
tomer immediately), you must use Card Verification (or in the case of Vault Add Token, Card Verification
with Vault) first before running the transaction in order to get the Issuer ID.
Transactions this applies to:
Vault Add Credit Card – ResAddCC
Vault Update Credit Card – ResUpdateCC
Vault Add Token – ResAddToken
Recurring Billing transactions, if:
lthe first transaction is set to start on a future date
3.7.2 Credential on File and Vault Add Token
For Vault Add Token transactions:
1. Send Card Verification with Vault transaction request including the Credential onFile object to get
the IssuerID
2. Send the Vault Add Token request including the Credential on File object (with Issuer ID only;
other fields are not applicable)
For more on this transaction type, see 4.3.9 Vault Add Token – ResAddToken.
November 2018 Page 50 of 476
![](asset-33.png)
Moneris Gateway API- Integration Guide
3.7.3 Credential on File and Vault Update Credit Card
For Vault Update CreditCard transactions where you are updating the credit card number:
1. Send Card Verification transaction request including the Credential onFile object to get the
IssuerID
2. Send the Vault Update Credit Card request including the Credential on File Info object (IssuerID
only).
For more on this transaction type, see 4.3.3 Vault Update Credit Card – ResUpdateCC.
3.7.4 Credential on File and Vault Add Credit Card
For Vault Add Credit Card transactions:
1. Send Card Verification transaction request including the Credential onFile object to get the
IssuerID
2. Send the Vault Add Credit Card request including the Credential on File Info object (IssuerID only)
For more on this transaction type, see 4.3.1 Vault Add Credit Card – ResAddCC.
3.7.5 Credential on File and Recurring Billing
NOTE: The value of the payment indicator field must be Rwhen sending Recurring Billing
transactions.
For Recurring Billing transactions which are set to start immediately:
1. Send a Purchase transaction request with both the Recurring Billing and Credential on File info
objects
For Recurring Billing transactions which are set to start on a future date:
1. Send Card Verification transaction request including the Credential onFile info object to get the
IssuerID
2. Send Purchase transaction request with the Recur and Credential on File info objects included
For updating a Recurring Billing series where you are updating the card number (does not apply if you are
only modifying the schedule or amount in a recurring series):
1. Send CardVerification request including the Credential on File info object to get the Issuer ID
2. Send a Recurring Billing Update transaction
For more information about the Recurring Billing object, see Definition of Request Fields – Recurring.
Page 51 of 476 November 2018
![](asset-34.png)
4 Vault
l4.1 About the Vault TransactionSet
l4.2 Vault Transaction Types
l4.3 Vault Administrative Transactions
l4.4 Vault Financial Transactions
l4.5 Hosted Tokenization
4.1 About the Vault TransactionSet
The Vault feature allows merchants to create customer profiles, edit those profiles, and use them to pro-
cess transactions without having to enter financial information each time. Customer profiles store cus-
tomer data essential to processing transactions, including credit and signature debit.
The Vault is a complement to the recurring payment module. It securely stores customer account inform-
ation on Moneris secure servers. This allows merchants to bill customers for routine products or services
when an invoice is due.
4.2 Vault Transaction Types
The Vault API supports both administrative and financial transactions.
4.2.1 Administrative Vault Transaction types
ResAddCC
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 asso-
ciate with the saved information.
EncResAddCC
Creates a new credit card profile, but requires the card data to be either swiped or manually
keyed in via a Moneris-provided encrypted mag swipe reader.
ResTempAdd
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.
During the lifetime of this temporary token, it may be used for any other vault transaction
before it is permanently deleted from the system.
ResUpdateCC
Updates a Vault profile (based on the data key) to contain credit card information.
All information contained within a credit card profile is updated as indicated by the submitted
fields.
EncResUpdateCC
Updates a profile (based on the data key) to contain credit card information. The encrypted
version of this transaction requires the card data to either be swiped or manually keyed in via
a Moneris-provided encrypted mag swipe reader.
November 2018 Page 52 of 476
![](asset-35.png)
Moneris Gateway API- Integration Guide
ResDelete
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.
ResLookupFull
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 ResLookupMasked (which returns the masked credit card number), this transaction
returns both the masked and the unmasked credit card numbers.
ResLookupMasked
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 ResLookupFull (which only returns both the masked and the unmasked credit card
numbers), this transaction only returns the masked credit card number.
ResGetExpiring
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 num-
bers 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.
ResIscorporatecard
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.
ResAddToken
Converts a Hosted Tokenization temporary token to a permanent Vault token.
A temporary token is valid for 15 minutes after it is created.
ResTokenizeCC
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. A transaction that was pre-
viously done in Moneris Gateway is taken, and the card data from that transaction is stored
in the Moneris Vault.
As with ResAddCC, 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.
Page 53 of 476 November 2018
![](asset-36.png)
4 Vault
4.2.2 Financial Vault Transaction types
ResPurchaseCC
Uses the data key to identify a previously registered credit card profile. The details saved
within the profile are then submitted to perform a Purchase transaction.
ResPreauthCC
Uses the data key to identify a previously registered credit card profile. The details within the
profile are submitted to perform a Pre-Authorization transaction.
ResIndRefundCC
Uses the unique data key to identify a previously registered credit card profile, and credits a
specified amount to that credit card.
ResMpiTxn
Uses the data key (as opposed to a credit card number) in a VBV/SecureCode Txn MPI trans-
action. The merchant uses the data key with ResMpiTxn request, and then reads the
response fields to verify whether the card is enrolled in Verified by Visa or MasterCard
SecureCode. Retrieves the vault transaction value to pass on to Visa or MasterCard.
After it has been validated that the data key is is enrolled in 3-D Secure, a window appears in
which the customer can enter the 3-D Secure password. The merchant may initiate the form-
ing of the validation form getMpiInLineForm().
For more information on integrating with MonerisMPI, refer to 8 MPI
4.3 Vault Administrative Transactions
Administrative transactions allow you to perform such tasks as creating new Vault profiles, deleting exist-
ing Vault profiles and updating profile information.
Some Vault Administrative Transactions require the Credential onFile object to be sent with the issuer ID
field only.
4.3.1 Vault Add Credit Card – ResAddCC
ResAddCC transaction object definition
ResAddCC resaddcc = new ResAddCC();
HttpsPostRequest object for ResAddCC transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resaddcc);
ResAddCC transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
November 2018 Page 54 of 476
![](asset-37.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
Credit card number String 20-character alpha-
numeric
resaddcc.SetPan(pan);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
resaddcc.SetExpdate(expiry_
date);
E-commerce indicator String 1-character alpha-
numeric
resaddcc.SetCryptType
(crypt);
Credential on File Info
cof
NOTE: This is a nested
object within the trans-
action, and required
when storing or using
the customer's stored
credentials. The Cre-
dential on File Info
object has its own
request variables, lis-
ted in blue in the table
below, "Credential on
File Object Request
Variables".
Object N/A resaddcc.SetCofInfo(cof);
Table 20: Vault Add Credit Card transaction object mandatory values
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
resaddcc.SetCustId(cust_id);
AVS information Object N/A resaddcc.SetAvsInfo
(avsCheck);
Email address String 30-character alpha-
numeric
resaddcc.SetEmail(email);
Table 21: Vault Add Credit Card transaction optional values
Page 55 of 476 November 2018
![](asset-38.png)
4 Vault
Value Type Limits Set method
Phone number String 30-character alpha-
numeric
resaddcc.SetPhone(phone);
Note String 30-character alpha-
numeric
resaddcc.SetNote(note);
Data key format String 2-character alpha-
numeric
resaddcc.SetDataKeyFormat
(data_key_format)
Table 21: Vault Add Credit Card transaction optional values
Credential onFile Transaction Object Request Fields
Value Type Limits Set Method
Issuer ID
NOTE: This variable is
required for all mer-
chant-intiated trans-
actions following the
first one; upon sending
the first transaction,
the Issuer ID value is
received in the trans-
action response and
then used in sub-
sequent transaction
requests.
String 15-character alpha-
numeric
variable length
cof.SetIssuerId("VALUE_FOR_
ISSUER_ID");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Sample 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";
November 2018 Page 56 of 476
![](asset-39.png)
Moneris Gateway API- Integration Guide
Sample Vault Add Credit Card
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);
Page 57 of 476 November 2018
![](asset-3a.png)
4 Vault
Sample Vault Add Credit Card
}
}
}
}
Vault response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
4.3.1.1 Vault Data Key
The ResAddCC sample code includes the following instruction from the Receipt object:
Console.WriteLine("DataKey = " + receipt.GetDataKey());
The data key response field is populated when you send a Vault Add Credit Card – ResAddCC (page 54),
Vault Encrypted Add Credit Card – EncResAddCC (page 58),Vault Tokenize Credit Card – ResTokenizeCC
(page 81),Vault Temporary Token Add – ResTempAdd (page 61) or Vault Add Token – ResAddToken
(page 77) transaction. It is the profile identifier that all future financial Vault transactions will use to asso-
ciate with the saved information.
The data key is a maximum 28-character alphanumeric string.
4.3.1.2 Vault Encrypted Add Credit Card – EncResAddCC
Vault Encrypted Add Credit Card transaction object definition
EncResAddCC encresaddcc = new EncResAddCC();
HttpsPostRequest object for Vault Encrypted Add Credit Card transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(encresaddcc);
Vault Encrypted Add Credit Card transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
November 2018 Page 58 of 476
![](asset-3b.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
Encrypted Track2 data String 40-character numeric encresaddcc.SetEncTrack2
(enc_track2);
Device type String 30-character alpha-
numeric
encresaddcc.SetDeviceType
(device_type);
E-commerce indicator String 1-character alpha-
numeric
encresaddcc.SetCryptType
(crypt);
Table 22: Vault Encrypted Add Credit Card transaction object mandatory values
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
encresaddcc.SetCustId(cust_
id);
AVS information Object Not applicable. Click
hereSee 9.1 (page 283).
encresaddcc.SetAvsInfo
(avsCheck);
Email address String 30-character alpha-
numeric
encresaddcc.SetEmail(email);
Phone number String 30-character alpha-
numeric
encresaddcc.SetPhone(phone);
Note String 30-character alpha-
numeric
encresaddcc.SetNote(note);
Data key format1String 2-character alpha-
numeric
encresaddcc.SetDataKeyFormat
(data_key_format)
Table 23: Vault Encrypted Add Credit Card transaction optional values
Sample Vault Encrypted Add Credit Card
namespace Moneris
{
using System;
public class TestCanadaEncResAddCC
{
public static void Main(string[] args)
{
/******************* REQUEST VARIABLES*******************************/
1Available to Canadian integrations only.
Page 59 of 476 November 2018
![](asset-3c.png)
4 Vault
Sample Vault Encrypted Add Credit Card
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "nqa";
string amount = "1.00";
string device_type = "idtech_bdk";
string crypt = "7";
string enc_track2 = "ENCRYPTEDTRACK2DATA";
string data_key_format = "0";
string processing_country_code = "CA";
bool status_check = false;
EncResAddCC encresaddcc = new EncResAddCC();
encresaddcc.SetEncTrack2(enc_track2);
encresaddcc.SetDeviceType(device_type);
encresaddcc.SetCryptType(crypt);
encresaddcc.SetCustId(cust_id);
encresaddcc.SetNote("Just a note");
encresaddcc.SetEmail("example@test.com");
encresaddcc.SetPhone("866-319-7450");
//encresaddcc.SetDataKeyFormat(data_key_format); //optional
/*************** Address Verification Service **********************/
AvsInfo avsCheck = new AvsInfo();
avsCheck.SetAvsStreetNumber("212");
avsCheck.SetAvsStreetName("Payton Street");
avsCheck.SetAvsZipCode("M1M1M1");
encresaddcc.SetAvsInfo(avsCheck);
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(encresaddcc);
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("\nCust 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());
November 2018 Page 60 of 476
![](asset-3d.png)
Moneris Gateway API- Integration Guide
Sample Vault Encrypted Add Credit Card
Console.WriteLine("Avs Zipcode = " + receipt.GetResDataAvsZipcode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Vault response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
4.3.2 Vault Temporary Token Add – ResTempAdd
Creates a new temporary token credit card profile. This transaction requires a duration to be set to indic-
ate how long the temporary token is to be stored for.
During the lifetime of this temporary token, it may be used for any other Vault transaction before it is per-
manently deleted from the system.
Things to Consider:
lThe duration, or lifetime, of the temporary token can be set to be a maximum of 15
minutes.
Vault Temporary Token Add transaction object definition
ResTempAdd resTempAdd = new ResTempAdd();
HttpsPostRequest object for Vault Temporary Token Add transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resTempAdd);
Vault Temporary Token Add transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Page 61 of 476 November 2018
![](asset-3e.png)
4 Vault
Value Type Limits Set method
Credit card number String 20-character numeric resTempAdd.SetPan(pan);
Expiry date String 4-character numeric resTempAdd.SetExpdate
(expiry_date);
Duration String 3-character numeric
maximum 15 minutes
resTempAdd.SetDuration
(duration);
E-commerce indicator String 1-character alpha-
numeric
resTempAdd.SetCryptType
(crypt);
Table 24: Vault Temporary Token Add transaction object mandatory values
Value Type Limits Set method
Data key format1String 2-character alpha-
numeric
resTempAdd.SetDataKeyFormat
(data_key_format)
Table 25: Vault Temporary Token Add transaction optional values
Sample Vault Temporary Token Add
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";
string data_key_format = "0";
string processing_country_code = "CA";
bool status_check = false;
ResTempAdd resTempAdd = new ResTempAdd();
resTempAdd.SetPan(pan);
resTempAdd.SetExpDate(expdate);
resTempAdd.SetDuration(duration);
resTempAdd.SetCryptType(crypt_type);
//resTempAdd.SetDataKeyFormat(data_key_format); //optional
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
1Available to Canadian integrations only.
November 2018 Page 62 of 476
![](asset-3f.png)
Moneris Gateway API- Integration Guide
Sample Vault Temporary Token Add
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 response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
4.3.3 Vault Update Credit Card – ResUpdateCC
Updates a Vault profile (based on the data key) to contain credit card information. All information con-
tained within a credit card profile is updated as indicated by the submitted fields.
Things to Consider:
lThis will update a profile to contain Credit Card information by referencing the profile’s
unique data key. If the profile which is being updated was already a Credit Card profile,
all information contained within it will simply be updated as indicated by the submitted
fields. This means that all fields are optional, and only those fields that are submitted
will be updated.
lTo update a specific field on the profile, only set that specific element using the cor-
responding set method.
Page 63 of 476 November 2018
![](asset-40.png)
4 Vault
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 values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Data key String 25-character alpha-
numeric
resUpdateCC.SetData(data_
key);
Table 26: Vault Update Credit Card transaction object mandatory values
Optional values that are submitted to the ResUpdateCC object are updated. Unsubmitted optional val-
ues (with one exception) remain unchanged. This allows you to change only the fields you want.
If a profile contains AVS information, but a Vault Update Credit Card transaction is submitted without an
AVS Info object, the existing AVS Info details are deactivated and the new credit card information is
registered without AVS.
Value Type Limits Set method
Credit card number String 20-character alpha-
numeric
resUpdateCC.SetPan(pan);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
resUpdateCC.SetExpdate
(expiry_date);
E-commerce indicator String 1-character alpha-
numeric
resUpdateCC.SetCryptType
(crypt);
Customer ID String 50-character alpha-
numeric
resUpdateCC.SetCustId(cust_
id);
AVS information Object n/a resUpdateCC.SetAvsInfo
(avsCheck);
Email address String 30-character alpha-
numeric
resUpdateCC.SetEmail(email);
Table 27: Vault Update Credit Card transaction optional values
November 2018 Page 64 of 476
![](asset-41.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
Phone number String 30-character alpha-
numeric
resUpdateCC.SetPhone(phone);
Note String 30-character alpha-
numeric
resUpdateCC.SetNote(note);
Credential on File Info
cof
NOTE: This is a nested
object within the trans-
action, and required
when storing or using
the customer's stored
credentials. The Cre-
dential on File Info
object has its own
request variables, lis-
ted in blue in the table
below, "Credential on
File Object Request
Variables".
Object N/A resUpdateCC.SetCofInfo(cof);
Credential onFile Transaction Object Request Fields
Value Type Limits Set Method
Issuer ID
NOTE: This variable is
required for all mer-
chant-intiated trans-
actions following the
first one; upon sending
the first transaction,
the Issuer ID value is
received in the trans-
action response and
then used in sub-
sequent transaction
requests.
String 15-character alpha-
numeric
variable length
cof.SetIssuerId("VALUE_FOR_
ISSUER_ID");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Sample Vault Update Credit Card
namespace Moneris
{
Page 65 of 476 November 2018
![](asset-42.png)
4 Vault
Sample Vault Update Credit Card
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";
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");
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.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resUpdateCC);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
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());
November 2018 Page 66 of 476
![](asset-43.png)
Moneris Gateway API- Integration Guide
Sample Vault Update Credit Card
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 response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
4.3.3.1 Vault Encrypted Update CC - EncResUpdateCC
Vault Encrypted Update CC transaction object definition
EncResUpdateCC encresupdatecc = new EncResUpdateCC();
HttpsPostRequest object for Vault Encrypted Update CC transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(encresupdatecc);
Vault Encrypted Update CC transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Data key String 25-character alpha-
numeric
encresupdatecc.SetData(data_
key);
Encrypted Track2 data String Variable length encresupdatecc.SetEncTrack2
(enc_track2);
Device type String 30-character alpha-
numeric
encresupdatecc.SetDeviceType
(device_type);
Table 28: Vault Encrypted Update CC transaction object mandatory values
Page 67 of 476 November 2018
![](asset-44.png)
4 Vault
Optional values that are submitted to the ResUpdateCC object are updated, while unsubmitted optional
values (with one exception) remain unchanged. This allows you to change only the fields you want.
The exception is that if you are making changes to the payment type, all of the variables in the optional
values table below must be submitted.
If you update a profile to a different payment type, it is automatically deactivated and a new credit card
profile is created and assigned to the data key. The only values from the prior profile that will remain
unchanged are the customer ID, phone number, email address, and note.
EXAMPLE:If a profile contains AVS information, but a ResUpdateCC transaction is sub-
mitted without an AVSInfo object, the existing AVSInfo details are deactivated and the new
credit card information is registered without AVS.
Value Type Limits Set method
E-commerce indicator String 1-character alpha-
numeric
encresupdatecc.SetCryptType
(crypt);
Customer ID String 50-character alpha-
numeric
encresupdatecc.SetCustId
(cust_id);
AVS information Object Not applicable. Click
hereSee 9.1 (page 283).
encresupdatecc.SetAvsInfo
(avsCheck);
Email address String 30-character alpha-
numeric
encresupdatecc.SetEmail
(email);
Phone number String 30-character alpha-
numeric
encresupdatecc.SetPhone
(phone);
Note String 30-character alpha-
numeric
encresupdatecc.SetNote
(note);
Table 29: Vault Encrypted Update CC transaction optional values
Sample Vault Encrypted Update CC - CA
namespace Moneris
{
using System;
public class TestCanadaEncResUpdateCC
{
public static void Main(string[] args)
{
/******************* REQUEST VARIABLES*******************************/
string store_id = "store5";
November 2018 Page 68 of 476
![](asset-45.png)
Moneris Gateway API- Integration Guide
Sample Vault Encrypted Update CC - CA
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "nqa";
string device_type = "idtech_bdk";
string crypt = "7";
string enc_track2 = "ENCRYPTEDTRACK2DATA";
string processing_country_code = "CA";
string data_key = "gF5IpsWD3s42r2TZxZyecE9Gs";
bool status_check = false;
EncResUpdateCC encresupdatecc = new EncResUpdateCC();
encresupdatecc.SetDataKey(data_key);
encresupdatecc.SetCustId(cust_id);
encresupdatecc.SetNote("Just a note2");
encresupdatecc.SetEmail("example1@test.com");
encresupdatecc.SetPhone("866-319-7450");
encresupdatecc.SetEncTrack2(enc_track2);
encresupdatecc.SetDeviceType(device_type);
encresupdatecc.SetCryptType(crypt);
/*************** Address Verification Service **********************/
AvsInfo avsCheck = new AvsInfo();
avsCheck.SetAvsStreetNumber("3300");
avsCheck.SetAvsStreetName("Bloor Street");
avsCheck.SetAvsZipCode("M2X2X2");
encresupdatecc.SetAvsInfo(avsCheck);
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(encresupdatecc);
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("\nCust 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();
Page 69 of 476 November 2018
![](asset-46.png)
4 Vault
Sample Vault Encrypted Update CC - CA
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Vault response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
4.3.4 Vault Delete - ResDelete
NOTE: After a profile has been deleted, the details can no longer be retrieved.
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 values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Data key String 25-character alpha-
numeric
resDelete.SetData(data_key);
Table 30: Vault Delete transaction object mandatory values
Sample Vault Delete
namespace Moneris
{
using System;
using System.Text;
November 2018 Page 70 of 476
![](asset-47.png)
Moneris Gateway API- Integration Guide
Sample Vault Delete
using System.Collections;
public class TestCanadaResDelete
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string data_key = "PjVKjtEmc1FvFyjxHE4EwBMxi";
string processing_country_code = "CA";
bool status_check = false;
ResDelete resDelete = new ResDelete(data_key);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resDelete);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
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 response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
Page 71 of 476 November 2018
![](asset-48.png)
4 Vault
4.3.5 Vault Lookup Full - ResLookupFull
Vault Lookup Full transaction object definition
ResLookupFull resLookupFull = new ResLookupFull(data_key);
HttpsPostRequest object for Vault Lookup Full transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resLookupFull);
Vault Lookup Full transaction values
Value Type Limits Set method
Data key String 25-character alpha-
numeric
resLookupFull.SetData(data_
key);
Table 31: Vault Lookup Full transaction object mandatory values
Sample Vault Lookup Full
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";
string processing_country_code = "CA";
bool status_check = false;
ResLookupFull resLookupFull = new ResLookupFull(data_key);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resLookupFull);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
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());
November 2018 Page 72 of 476
![](asset-49.png)
Moneris Gateway API- Integration Guide
Sample Vault Lookup Full
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 response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
4.3.6 Vault Lookup Masked - ResLookupMasked
Vault Lookup Masked transaction object definition
ResLookupMasked resLookupMasked = new ResLookupMasked();
HttpsPostRequest object for Vault Lookup Masked transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resLookupMasked);
Vault Lookup Masked transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Data key String 25-character alpha-
numeric
Table 32: Vault Lookup Masked transaction object mandatory values
Page 73 of 476 November 2018
![](asset-4a.png)
4 Vault
Sample Vault Lookup Masked -CA
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";
string processing_country_code = "CA";
bool status_check = false;
ResLookupMasked resLookupMasked = new ResLookupMasked();
resLookupMasked.SetData(data_key);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resLookupMasked);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
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 response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
November 2018 Page 74 of 476
![](asset-4b.png)
Moneris Gateway API- Integration Guide
4.3.7 Vault Get Expiring - ResGetExpiring
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 Get Expiring transaction values
ResGetExpiring transaction object mandatory values: None.
Sample Vault Get Expiring - CA
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";
string processing_country_code = "CA";
bool status_check = false;
ResGetExpiring resGetExpiring = new ResGetExpiring();
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resGetExpiring);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
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));
Page 75 of 476 November 2018
![](asset-4c.png)
4 Vault
Sample Vault Get Expiring - CA
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 response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
4.3.8 Vault Is Corporate Card - ResIscorporateCard
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 values
Value Type Limits Set method
Data key String 25-character alpha-
numeric
resIscorporatecard.SetData
(data_key);
Table 33: Vault Is Corporate Card transaction object mandatory values
Sample Vault Is Corporate Card - CA
namespace Moneris
{
using System;
November 2018 Page 76 of 476
![](asset-4d.png)
Moneris Gateway API- Integration Guide
Sample Vault Is Corporate Card - CA
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";
string processing_country_code = "CA";
bool status_check = false;
ResIscorporatecard resIscorporatecard = new ResIscorporatecard();
resIscorporatecard.SetData(data_key);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resIscorporatecard);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
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 response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
4.3.9 Vault Add Token – ResAddToken
This transaction is used to convert a temporary token into a permanent token for storage in the Moneris
Vault
Page 77 of 476 November 2018
![](asset-4e.png)
4 Vault
Things to Consider:
l
lIf you intend to store the token for use in future transactions (i.e.,Credential on File
transactions), first you must send either a Vault financial transaction (Purchase
withVault orPre-Authorization with Vault) or a Card Verification with Vault in order to
get the IssuerID
lThe Vault AddToken request uses the Issuer ID to indicate that it is referencing stored
credentials
Vault Add Token transaction object definition
ResAddToken resAddToken = new ResAddToken(data_key, crypt_type);
HttpsPostRequest object for Vault Add Token transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resAddToken);
Vault Add Token transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Data key String 28-character alpha-
numeric
resAddToken.SetData(data_
key);
E-commerce indicator String 1-character alpha-
numeric
resAddToken.SetCryptType
(crypt);
Credential on File Info
cof
NOTE: This is a nested
object within the trans-
action, and required
when storing or using
the customer's stored
credentials. The Cre-
dential on File Info
object has its own
request variables, lis-
ted in blue in the table
below, "Credential on
File Object Request
Variables".
Object N/A resaddcc.SetCofInfo(cof);
Table 34: Vault Add Token transaction object mandatory values
November 2018 Page 78 of 476
![](asset-4f.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
resAddToken.SetCustId(cust_
id);
AVS information Object N/A resAddToken.SetAvsInfo
(avsCheck);
Email address String 30-character alpha-
numeric
resAddToken.SetEmail(email);
Phone number String 30-character alpha-
numeric
resAddToken.SetPhone(phone);
Note String 30-character alpha-
numeric
resAddToken.SetNote(note);
Data key format1String 2-character alpha-
numeric
resAddToken.SetDataKeyFormat
(data_key_format)
Table 35: Vault Add Token transaction optional values
Credential onFile Transaction Object Request Fields
Value Type Limits Set Method
Issuer ID
NOTE: This variable is
required for all mer-
chant-intiated trans-
actions following the
first one; upon sending
the first transaction,
the Issuer ID value is
received in the trans-
action response and
then used in sub-
sequent transaction
requests.
String 15-character numeric
variable length
cof.SetIssuerId("VALUE_FOR_
ISSUER_ID");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Sample Vault Add Token
namespace Moneris
{
1Available to Canadian integrations only.
Page 79 of 476 November 2018
![](asset-50.png)
4 Vault
Sample Vault Add Token
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";
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");
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.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resAddToken);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
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());
November 2018 Page 80 of 476
![](asset-51.png)
Moneris Gateway API- Integration Guide
Sample Vault Add Token
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 response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
4.3.10 Vault Tokenize Credit Card – ResTokenizeCC
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 IDreceived in the previous transaction response is sent in the Vault Tokenize Credit Card
request to reference that this is a stored credential.
Basic transactions that can be tokenized are:
lPurchase
lPre-Authorization
lCard Verification
The tokenization process is outlined below :
Figure 1: Tokenize process diagram
Page 81 of 476 November 2018
![](asset-52.png)
4 Vault
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 values
These mandatory values reference a previously processed credit card financial transaction. The credit
card number, expiry date, and e-commerce indicator from the original transaction are registered in the
Vault for future financial Vault transactions.
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
resTokenizeCC.SetOrderId
(order_id);
Transaction number String 255-character alpha-
numeric
resTokenizeCC.SetTxnNumber
(txn_number);
Table 36: Vault Tokenize Credit Card transaction object mandatory values
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
resTokenizeCC.SetCustId
(cust_id);
Email address String 30-character alpha-
numeric
resTokenizeCC.SetEmail
(email);
Phone number String 30-character alpha-
numeric
resTokenizeCC.SetPhone
(phone);
Note String 30-character alpha-
numeric
resTokenizeCC.SetNote(note);
Table 37: Vault Tokenize Credit Card transaction optional values
November 2018 Page 82 of 476
![](asset-53.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
AVS information Object N/A resTokenizeCC.SetAvsInfo
(avsCheck);
Data key format1String 2-character alpha-
numeric
resTokenizeCC
.SetDataKeyFormat(data_key_
format)
Credential on File Info
cof
NOTE: This is a nested
object within the trans-
action, and required
when storing or using
the customer's stored
credentials. The Cre-
dential on File Info
object has its own
request variables, lis-
ted in blue in the table
below, "Credential on
File Object Request
Variables".
Object N/A resTokenizeCC.SetCofInfo
(cof);
Credential onFile Transaction Object Request Fields
Value Type Limits Set Method
Issuer ID
NOTE: This variable is
required for all mer-
chant-intiated trans-
actions following the
first one; upon sending
the first transaction,
the Issuer ID value is
received in the trans-
action response and
then used in sub-
sequent transaction
requests.
String 15-character alpha-
numeric
variable length
cof.SetIssuerId("VALUE_FOR_
ISSUER_ID");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
1Available to Canadian integrations only.
Page 83 of 476 November 2018
![](asset-54.png)
4 Vault
Any field that is not set in the tokenize request is not stored with the transaction. That is, Moneris Gate-
way does not automatically take the optional information that was part of the original transaction.
The ResolveData that is returned in the response fields indicates what values were registered for this pro-
file.
Sample Vault Tokenize Credit Card
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";
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");
ResTokenizeCC resTokenizeCC = new ResTokenizeCC();
resTokenizeCC.SetOrderId(order_id);
resTokenizeCC.SetTxnNumber(txn_number);
resTokenizeCC.SetCustId(cust_id);
resTokenizeCC.SetPhone(phone);
resTokenizeCC.SetEmail(email);
resTokenizeCC.SetNote(note);
resTokenizeCC.SetAvsInfo(avsCheck);
resTokenizeCC.SetCofInfo(cof);
//resTokenizeCC.SetDataKeyFormat(data_key_format); //optional
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resTokenizeCC);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
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());
November 2018 Page 84 of 476
![](asset-55.png)
Moneris Gateway API- Integration Guide
Sample Vault Tokenize Credit Card
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.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Vault response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
4.4 Vault Financial Transactions
After a financial transaction is complete, the response fields indicate all the values that are currently
saved under the profile that was used.
4.4.1 Customer ID Changes
Some financial transactions take the customer ID as an optional value. The customer ID may or may not
already be in the Vault profile when the transaction is sent. Therefore, it is possible to change the value of
the customer ID by performing a financial transaction
The table below shows what the customer ID will be in the response field after a financial transaction is
performed.
Already in profile? Passed in? Version used in response
No No Customer ID not used in transaction
No Yes Passed in
Table 38: Customer ID use in response fields
Page 85 of 476 November 2018
![](asset-56.png)
4 Vault
Already in profile? Passed in? Version used in response
Yes No Profile
Yes Yes Passed in
4.4.2 Purchase withVault – ResPurchaseCC
Purchase withVault transaction object definition
ResPurchaseCC resPurchaseCC = new ResPurchaseCC();
HttpsPostRequest object for Purchase withVault transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resPurchaseCC);
Purchase withVault transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Data key String 25-character alpha-
numeric
resPurchaseCC.SetData(data_
key);
Order ID String 50-character alpha-
numeric
resPurchaseCC.SetOrderId
(order_id);
Amount String 9-character decimal resPurchaseCC.SetAmount
(amount);
Table 39: Purchase withVault transaction object mandatory values
November 2018 Page 86 of 476
![](asset-57.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
E-commerce indicator String 1-character alpha-
numeric
resPurchaseCC.SetCryptType
(crypt);
Credential on File Info
cof
NOTE: This is a nested
object within the trans-
action, and required
when storing or using
the customer's stored
credentials. The Cre-
dential on File Info
object has its own
request variables, lis-
ted in blue in the table
below, "Credential on
File Object Request
Variables".
Object N/A cof.SetCofInfo(cof);
Value Type Limits Set method
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Expiry date String 4-character numeric
YYMMformat.
(Note that this is
reversed from the
date displayed on the
card, which is MMYY)
resPurchaseCC.SetExpdate
(expiry_date);
Customer ID String 50-character alpha-
numeric
resPurchaseCC.SetCustId
(cust_id);
Dynamic descriptor String 20-character alpha-
numeric
resPurchaseCC
.SetDynamicDescriptor
(dynamic_descriptor);
Customer information Object N/A resPurchaseCC.SetCustInfo
(customer);
Table 40: Purchase withVault transaction optional values
Page 87 of 476 November 2018
![](asset-58.png)
4 Vault
Value Type Limits Set method
AVS information Object N/A resPurchaseCC.SetAvsInfo
(avsCheck);
CVD information
NOTE: When storing
credentials on the ini-
tial transaction, the
CVDobject must be
sent; for subsequent
transactions using
stored credentials,
CVD can be sent with
cardholder-initiated
transactions only—
merchants must not
store CVD
information.
Object N/A resPurchaseCC.SetCvdInfo
(cvdCheck);
Recurring billing Object N/A resPurchaseCC.SetRecur
(recurring_cycle);
November 2018 Page 88 of 476
![](asset-59.png)
Moneris Gateway API- Integration Guide
Credential onFile Transaction Object Request Fields
Value Type Limits Set Method
Issuer ID
NOTE: This variable is
required for all mer-
chant-intiated trans-
actions following the
first one; upon sending
the first transaction,
the Issuer ID value is
received in the trans-
action response and
then used in sub-
sequent transaction
requests.
String 15-character alpha-
numeric
variable length
cof.SetIssuerId("VALUE_FOR_
ISSUER_ID");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Indicator String 1-character alphabetic cof.SetPaymentIndicator
("PAYMENT_INDICATOR_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Inform-
ation
String 1-character numeric cof.SetPaymentInformation
("PAYMENT_INFO_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Sample Purchase withVault
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResPurchaseCC
{
public static void Main(string[] args)
{
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string store_id = "store1";
string api_token = "yesguy";
string data_key = "eLqsADfwqHDxIpJG9vLnELx01";
string amount = "1.00";
string cust_id = "customer1"; //if sent will be submitted, otherwise cust_id from profile will be
Page 89 of 476 November 2018
![](asset-5a.png)
4 Vault
Sample Purchase withVault
used
string crypt_type = "1";
string descriptor = "my descriptor";
string processing_country_code = "CA";
bool status_check = false;
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("12345678901234");
ResPurchaseCC resPurchaseCC = new ResPurchaseCC();
resPurchaseCC.SetDataKey(data_key);
resPurchaseCC.SetOrderId(order_id);
resPurchaseCC.SetCustId(cust_id);
resPurchaseCC.SetAmount(amount);
resPurchaseCC.SetCryptType(crypt_type);
resPurchaseCC.SetDynamicDescriptor(descriptor);
resPurchaseCC.SetCofInfo(cof);
//resPurchaseCC.SetExpDate("1511"); //optional - use for temp token only
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resPurchaseCC);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("Masked Pan = " + 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();
November 2018 Page 90 of 476
![](asset-5b.png)
Moneris Gateway API- Integration Guide
Sample Purchase withVault
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Vault response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
4.4.3 Pre-Authorization with Vault – ResPreauthCC
Pre-Authorization with Vault transaction object definition
ResPreauthCC resPreauthCC = new ResPreauthCC();
HttpsPostRequest object for Pre-Authorization with Vault transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resPreauthCC);
Pre-Authorization with Vault transaction values
Value Type Limits Set method
Data key String 25- character alpha-
numeric
resPreauthCC.SetData(data_
key);
Order ID String 50-character alpha-
numeric
resPreauthCC.SetOrderId
(order_id);
Amount String 9-character decimal resPreauthCC.SetAmount
(amount);
Table 41: Pre-Authorization with Vault transaction object mandatory values
Page 91 of 476 November 2018
![](asset-5c.png)
4 Vault
Value Type Limits Set method
E-commerce indicator String 1-character alpha-
numeric
resPreauthCC.SetCryptType
(crypt);
Credential on File Info
cof
NOTE: This is a nested
object within the trans-
action, and required
when storing or using
the customer's stored
credentials. The Cre-
dential on File Info
object has its own
request variables, lis-
ted in blue in the table
below, "Credential on
File Object Request
Variables".
Object N/A resPreauthCC.SetCofInfo
(cof);
Table 41: Pre-Authorization with Vault transaction object mandatory values (continued)
Value Type Limits Set method
Status Check Boolean true/false mpgReq.SetStatusCheck(status_
check);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
resPreauthCC.SetExpdate
(expiry_date);
Customer ID String 50-character alpha-
numeric
resPreauthCC.SetCustId(cust_
id);
Table 42: Pre-Authorization with Vault transaction optional values
November 2018 Page 92 of 476
![](asset-5d.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
Customer inform-
ation
Object N/A resPreauthCC.SetCustInfo
(customer);
AVS information Object N/A resPreauthCC.SetAvsInfo
(avsCheck);
CVD information
NOTE: When storing
credentials on the ini-
tial transaction, the
CVDobject must be
sent; for subsequent
transactions using
stored credentials,
CVD can be sent with
cardholder-initiated
transactions only—
merchants must not
store CVD
information.
Object N/A resPreauthCC.SetCvdInfo
(cvdCheck);
Page 93 of 476 November 2018
![](asset-5e.png)
4 Vault
Credential onFile Transaction Object Request Fields
Value Type Limits Set Method
Issuer ID
NOTE: This variable is
required for all mer-
chant-intiated trans-
actions following the
first one; upon sending
the first transaction,
the Issuer ID value is
received in the trans-
action response and
then used in sub-
sequent transaction
requests.
String 15-character alpha-
numeric
variable length
cof.SetIssuerId("VALUE_FOR_
ISSUER_ID");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Indicator String 1-character alphabetic cof.SetPaymentIndicator
("PAYMENT_INDICATOR_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Inform-
ation
String 1-character numeric cof.SetPaymentInformation
("PAYMENT_INFO_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Sample Pre-Authorization with Vault
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResPreauthCC
{
public static void Main(string[] args)
{
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string store_id = "store1";
string api_token = "yesguy";
string data_key = "YeMnLZ8i2p02gbwSB8i8Q02Fo";
string amount = "1.00";
string cust_id = "customer1"; //if sent will be submitted, otherwise cust_id from profile will be
November 2018 Page 94 of 476
![](asset-5f.png)
Moneris Gateway API- Integration Guide
Sample Pre-Authorization with Vault
used
string crypt_type = "1";
string dynamic_descriptor = "my descriptor";
string processing_country_code = "CA";
bool status_check = false;
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("12345678901234");
ResPreauthCC resPreauthCC = new ResPreauthCC();
resPreauthCC.SetDataKey(data_key);
resPreauthCC.SetOrderId(order_id);
resPreauthCC.SetCustId(cust_id);
resPreauthCC.SetAmount(amount);
resPreauthCC.SetCryptType(crypt_type);
resPreauthCC.SetDynamicDescriptor(dynamic_descriptor);
resPreauthCC.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(resPreauthCC);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("Masked Pan = " + 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();
}
Page 95 of 476 November 2018
![](asset-60.png)
4 Vault
Sample Pre-Authorization with Vault
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Vault response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
4.4.4 Vault Independent Refund CC- ResIndRefundCC
Vault Independent Refund transaction object definition
ResIndRefundCC resIndRefundCC = new ResIndRefundCC();
HttpsPostRequest object for Vault Independent Refund transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resIndRefundCC);
Vault Independent Refund transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Data key String 25-character alpha-
numeric
resIndRefundCC.SetData(data_
key);
Order ID String 50-character alpha-
numeric
resIndRefundCC.SetOrderId
(order_id);
Amount String 9-character decimal resIndRefundCC.SetAmount
(amount);
E-commerce indicator String 1-character alpha-
numeric
resIndRefundCC.SetCryptType
(crypt);
Table 43: Vault Independent Refund transaction object mandatory values
November 2018 Page 96 of 476
![](asset-61.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
resIndRefundCC.SetCustId
(cust_id);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
resIndRefundCC.SetExpdate
(expiry_date);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Dynamic descriptor String 20-character alpha-
numeric
resIndRefundCC
.SetDynamicDescriptor
(dynamic_descriptor);
Table 44: Vault Independent Refund transaction optional values
Sample Vault Independent Refund
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResIndRefundCC
{
public static void Main(string[] args)
{
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string store_id = "store1";
string api_token = "yesguy";
string data_key = "qJD5kCZiCjsfabKH7WuxoHyZx";
string amount = "1.00";
string cust_id = "customer1";
string crypt_type = "1";
string processing_country_code = "CA";
bool status_check = false;
ResIndRefundCC resIndRefundCC = new ResIndRefundCC();
resIndRefundCC.SetOrderId(order_id);
resIndRefundCC.SetCustId(cust_id);
resIndRefundCC.SetAmount(amount);
resIndRefundCC.SetCryptType(crypt_type);
resIndRefundCC.SetData(data_key);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resIndRefundCC);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Page 97 of 476 November 2018
![](asset-62.png)
4 Vault
Sample Vault Independent Refund
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("Masked Pan = " + 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 response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
4.4.5 Force Post with Vault - ResForcePostCC
Force Post with Vault transaction object definition
ResForcePostCC resForcePostCC = new ResForcePostCC();
HttpsPostRequest object for Force Post with Vault transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resForcePostCC);
November 2018 Page 98 of 476
![](asset-63.png)
Moneris Gateway API- Integration Guide
Force Post with Vault transaction object values
Value Type Limits Set Method
Amount String 9-character decimal resForcePostCC.SetAmount
(amount);
Data key String 25-character alpha-
numeric
resForcePostCC.SetData(data_
key);
Authorization code String 8-character alpha-
numeric
resForcePostCC.SetAuthCode
(auth_code);
E-commerce indicator String 1-character alpha-
numeric
resForcePostCC.SetCryptType
(crypt);
Table 1 Force Post with Vault transaction object mandatory values
Value Type Limits Set Method
Customer ID String 50-character alpha-
numeric
resForcePostCC.SetCustId
(cust_id);
Dynamic Descriptor String 20-character alpha-
numeric
resForcePostCC
.SetDynamicDescriptor
(dynamic_descriptor);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Table 2 Force Post with Vault transaction object optional values
Sample ForcePost with Vault
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResForcePostCC
{
public static void Main(string[] args)
{
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string store_id = "store1";
string api_token = "yesguy";
string data_key = "eLqsADfwqHDxIpJG9vLnELx01";
string amount = "1.00";
string cust_id = "customer1"; //if sent will be submitted, otherwise cust_id from profile will be
used
string auth_code = "245465";
string crypt_type = "7";
Page 99 of 476 November 2018
![](asset-64.png)
4 Vault
Sample ForcePost with Vault
string descriptor = "my descriptor";
string processing_country_code = "CA";
bool status_check = false;
ResForcePostCC resForcePostCC = new ResForcePostCC();
resForcePostCC.SetDataKey(data_key);
resForcePostCC.SetOrderId(order_id);
resForcePostCC.SetCustId(cust_id);
resForcePostCC.SetAmount(amount);
resForcePostCC.SetAuthCode(auth_code);
resForcePostCC.SetCryptType(crypt_type);
resForcePostCC.SetDynamicDescriptor(descriptor);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resForcePostCC);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("Masked Pan = " + 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);
}
}
}
}
November 2018 Page 100 of 476
![](asset-65.png)
Moneris Gateway API- Integration Guide
4.4.6 Card Verification withVault – ResCardVerificationCC
Things to Consider:
lThis transaction type only applies to Visa, Mastercard and Discover transactions
lThe card number and expiry date for this transaction are passed using a token, as rep-
resented by the data key value
lWhen using a temporary token (e.g., such as with Hosted Tokenization) and you intend
to store the cardholder credentials, this transaction must be run prior to running the
Vault Add Token transaction
Card Verification with Vault object definition
CardVerification rescardverify = new CardVerification();
HttpsPostRequest object for Card Verification with Vault transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(rescardverify);
Card Verification with Vault transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
rescardverify.SetOrderId
(order_id);
Data key String 25-character alpha-
numeric
rescardverify
.SetDataKeyFormat(data_key_
format)
E-commerce indicator String 1-character alpha-
numeric
rescardverify.SetCryptType
(crypt);
Table 45: Card Verification with Vault transaction object mandatory values
Page 101 of 476 November 2018
![](asset-66.png)
4 Vault
Value Type Limits Set method
AVS Object N/A rescardverify.SetAvsInfo
(avsCheck);
CVD Object N/A rescardverify.SetCvdInfo
(cvdCheck);
Credential on File Info
cof
NOTE: This is a nested
object within the trans-
action, and required
when storing or using
the customer's stored
credentials. The Cre-
dential on File Info
object has its own
request variables, lis-
ted in blue in the table
below, "Credential on
File Object Request
Variables".
Object N/A rescardverify.SetCofInfo
(cof);
Table 45: Card Verification with Vault transaction object mandatory values
November 2018 Page 102 of 476
![](asset-67.png)
Moneris Gateway API- Integration Guide
Credential onFile Transaction Object Request Fields
Value Type Limits Set Method
Issuer ID
NOTE: This variable is
required for all mer-
chant-intiated trans-
actions following the
first one; upon sending
the first transaction,
the Issuer ID value is
received in the trans-
action response and
then used in sub-
sequent transaction
requests.
String 15-character alpha-
numeric
variable length
cof.SetIssuerId("VALUE_FOR_
ISSUER_ID");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Indicator String 1-character alphabetic cof.SetPaymentIndicator
("PAYMENT_INDICATOR_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Inform-
ation
String 1-character numeric cof.SetPaymentInformation
("PAYMENT_INFO_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Sample Card Verification with Vault
namespace Moneris
{
using System;
public class TestResCardVerificationCC
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string data_key = "V6F9PJKdXQj6vKiCMNrWbsyJ2";
string order_id = "Test_P_033333_6";
string cust_id = "Customer1";
string crypt = "7";
string processing_country_code = "CA";
bool status_check = false;
Page 103 of 476 November 2018
![](asset-68.png)
4 Vault
Sample Card Verification with Vault
/*************** Address Verification Service **********************/
AvsInfo avsCheck = new AvsInfo();
avsCheck.SetAvsStreetNumber("212");
avsCheck.SetAvsStreetName("Payton Street");
avsCheck.SetAvsZipCode("M1M1M1");
/****************** Card Validation Digits *************************/
CvdInfo cvdCheck = new CvdInfo();
cvdCheck.SetCvdIndicator("1");
cvdCheck.SetCvdValue("099");
/*************** Credential on File *************************************/
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("12345678901234");
ResCardVerificationCC rescardverify = new ResCardVerificationCC();
rescardverify.SetDataKey(data_key);
rescardverify.SetOrderId(order_id);
rescardverify.SetCustId(cust_id);
//rescardverify.SetExpDate("1612"); //for use with Temp Tokens only
rescardverify.SetCryptType(crypt);
rescardverify.SetAvsInfo(avsCheck);
rescardverify.SetCvdInfo(cvdCheck);
rescardverify.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(rescardverify);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
November 2018 Page 104 of 476
![](asset-69.png)
Moneris Gateway API- Integration Guide
Sample Card Verification with Vault
}
}
} // end TestResCardVerificationCC
}
4.5 Hosted Tokenization
Moneris Hosted Tokenization is a solution for online e-commerce merchants who do not want to handle
credit card numbers directly on their websites, yet want the ability to fully customize their check-out web
page appearance.
When an hosted tokenization transaction is initiated, the Moneris Gateway displays (on the merchant’s
behalf) a single text box on the merchant’s checkout page. The cardholder can then securely enter the
credit card information into the text box. Upon submission of the payment information on the checkout
page, Moneris Gateway returns a temporary token representing the credit card number to the mer-
chant. This is then used in an API call to process a financial transaction directly with Moneris to charge
the card. After receiving a response to the financial transaction, the merchant generates a receipt and
allows the cardholder to continue with online shopping.
For more details on how to implement the Moneris Hosted Tokenization feature, see the Hosted Solu-
tions Integration Guide. The guide can be downloaded from the Moneris Developer Portal
(https://developer.moneris.com).
Page 105 of 476 November 2018
![](asset-6a.png)
5 INTERAC® Online Payment
l5.1 About INTERAC® Online Payment Transactions
l5.2 Other Documents and References
l5.3 Website and Certification Requirements
l5.4 Transaction Flow for INTERAC® Online Payment
l5.5 Sending an INTERAC® Online Payment Purchase Transaction
l5.6 INTERAC® Online Payment Purchase
l5.7 INTERAC® Online Payment Refund
l5.8 INTERAC® Online Payment Field Definitions
5.1 About INTERAC® Online Payment Transactions
The INTERAC® Online Payment method offers cardholders the ability to pay using online banking. This
payment method can be combined with the Moneris Gateway API solution to allow online payments
using credit and debit cards.
INTERAC® Online Payment transactions via the API require two steps:
1. The cardholder guarantees the funds for the purchase amount using their online banking pro-
cess.
2. The merchant confirms the payment by sending an INTERAC® Online Payment purchase request
to Moneris using the API.
Any of the transaction objects that are defined in this section can be passed to the HttpsPostRequest
connection object defined in Section 17.5 (page 381)here.
INTERAC® Online Payment transactions are available to Canadian integrations only.
5.2 Other Documents and References
INTERAC® Online Payment is offered by Acxsys Corporation, which is also a licensed user of the Interac
logo. Refer to the following documentation and websites for additional details.
INTERAC® Online PaymentMerchant Guideline
Visit the Moneris Developer Portal (https://developer.moneris.com) to access the latest documentation
and downloads.
This details the requirements for each page consumers visit on a typical INTERAC® Online Payment mer-
chant website. It also details the requirements that can be displayed on any page (that is, requirements
that are not page-specific).
Logos
Visit the Moneris Developer Portal (https://developer.moneris.com) to access the logos and downloads.
November 2018 CanadaOnly Page 106 of 476
![](asset-6b.png)
Moneris Gateway API- Integration Guide
5.3 Website and Certification Requirements
5.3.1 Things to provide to Moneris
Refer to the Merchant Guidelines referenced in Section 5.2 for instructions on proper use of logos and
the term "INTERAC® Online Payment". You need to provide Moneris with the following registration
information:
lMerchant logo to be displayed on the INTERAC® Online Payment Gateway page
lIn both French and English
l120 × 30 pixels
lOnly PNG format is supported.
lMerchant business name
lIn both English and French
lMaximum 30 characters.
lList of all referrer URLs. That is, URLs from which the customer may be redirected to the INTERAC®
Online Payment gateway.
lList of all URLs that may appear in the IDEBIT_FUNDEDURL field of the https form POST to the
INTERAC® Online Payment Gateway.
lList of all URLs that may appear in the IDEBIT_NOTFUNDEDURL field of the https form POST to the
INTERAC® Online Payment Gateway.
Note that if your test and production environments are different, provide the above information for
both environments.
5.3.2 Certification process
Test cases
All independent merchants and third-party service/shopping cart providers must pass the certification
process by conducting all the test cases outlined in Appendix E (page 454) and "Third-Party Service Pro-
vider Checklists for INTERAC® Online Payment Certification Testing" on page458 respectively. This is
required after you have completed all of your testing.
Any major changes to your website after certification (with respect to the INTERAC® Online Payment func-
tionality) require the site to be re-certified by completing the test cases again.
Appendix H (page 466) is the Certification Test Case Detail showing all the information and requirements
for each test case.
Page 107 of 476 Canada Only November 2018
![](asset-6c.png)
5 INTERAC® Online Payment
Screenshots
You must provide Moneris with screenshots of your check-out process showing examples of approved
and declined transactions using the INTERAC® Online Payment service.
Checklists
To consistently portray the INTERAC Online service as a secure payment option, you must complete the
respective Merchant Requirement checklist inAppendix E (page 454) or Appendix F (page 458)accordingly.
The detailed descriptions of the requirements in these checklists can be found in the INTERAC® Online
Payment Merchant Guidelines document referred to in 5.2 (page 106). If any item does not apply, mark it
as "N/A".
After completion, fax or email the results to the Moneris Integration Support help desk for review before
implementing the change into the production environment.
5.3.3 Client Requirements
Checklists
As a merchant using an INTERAC® Online Payment-certified third-party solution, your clients must com-
plete the Merchant Checklists for INTERAC® Online Payment Certification form (Appendix G, page 463).
They will not be required to complete any of the test cases.
Your clients must also complete the Merchant Requirement checklist (Appendix G, page 463). Ensure that
your product documentation properly instructs your clients to fax or email the results to the Moneris
Integration Support helpdesk for registration purposes.
Screenshots
Your clients must provide Moneris with screenshots of their check-out process that show examples of
approved and declined transactions using INTERAC® Online Payment.
5.3.4 Delays
Note that merchants that fall under the following category codes listed in Table 46 may experience delays
in the certification or registration process of up to 7 days.
Category code Merchant type/name
4812 Telecommunication equipment including telephone sales
4829 Money transfer—merchant
5045 Computers, computer peripheral equipment, software
5732 Electronic sales
6012 Financial institution—merchandise and services
6051 Quasi cash—merchant
Table 46: Category codes that might introduce certification/registration delays
November 2018 CanadaOnly Page 108 of 476
![](asset-6d.png)
Moneris Gateway API- Integration Guide
Category code Merchant type/name
6530 Remote stored value load—merchant
6531 Payment service provider—money transfer for a purchase
6533 Payment service provider—merchant—payment transaction
5.4 Transaction Flow for INTERAC® Online Payment
Figure 2: INTERAC® Online Payment transaction flow diagram
1. Customer selects the INTERAC® Online Payment option on the merchant's web store.
2. Merchant redirects the customer to the IOP gateway to select a financial institution (issuer) of
choice. This step involves form-posting the following required variables over the HTTPS protocol:
lIDEBIT_MERCHNUM
lIDEBIT_AMOUNT1
lIDEBIT_CURRENCY
lIDEBIT_FUNDEDURL
lIDEBIT_NOTFUNDEDURL
lIDEBIT_MERCHLANG
lIDEBIT_VERSIONIDEBIT_TERMID - optional
lIDEBIT_INVOICE - optional
lIDEBIT_MERCHDATA - optional
3. Customer selects an issuer, and is directed to the online banking site. Customer completes the
online banking process and guarantees the funds for the purchase.
1This value is expressed in cents. Therefore, $1 is input as 100
Page 109 of 476 Canada Only November 2018
![](asset-6e.png)
5 INTERAC® Online Payment
4. Depending on the results of step 5.4, the issuer re-directs the customer through the IOP Gate-
way to either the merchant's non-funded URL (4a) or funded URL (4b). Both URLs can appear on
the same page. The funded/non-funded URLs must validate the variables posted back according
to 5.8 (page 116) before continuing.
5.4 shows the variables that are posted back in the re-direction.
If the customer is directed to the non-funded URL, return to step 5.4 and ask for another means
of payment.
If the customer is directed to the funded URL, continue to the next step.
5. Merchant sends an INTERAC® Online Payment purchase request to Moneris Gateway while dis-
playing the "Please wait...." message to the customer. This should be done within 30 minutes of
receiving the response in step 5.4.
6. Moneris' processing host sends a request for payment confirmation to the issuer.
7. The issuer sends a response (either approved or declined) to Moneris host.
8. Moneris Gateway relays the response back to the merchant. If the payment was approved, the
merchant fulfills the order.
To funded URL only To funded and non-funded URL
IDEBIT_TRACK2 IDEBIT_VERSION
IDEBIT_ISSCONF IDEBIT_ISSLANG
IDEBIT_ISSNAME IDEBIT_TERMID (optional)
IDEBIT_INVOICE (optional)
IDEBIT_MERCHDATA (optional)
Table 47: Funded and non-funded URL variables
5.5 Sending an INTERAC® Online Payment Purchase Transaction
5.5.1 Fund-Guarantee Request
After choosing to pay by INTERAC® Online Payment, the customer is redirected using an HTML form post
to the INTERAC® Online PaymentGateway page. Below is a sample code that is used to post the request
to the Gateway.
<form action='from Section 9' method='post'>
<input type='text' name='IDEBIT_INVOICE' value=’your unique invoice number'>
<input type='text' name='IDEBIT_AMOUNT' value='100'> <!— ($1.00) use cent values instead of
dollar.cent format ->
<input type='text' name='IDEBIT_MERCHNUM' value='from Moneris Solutions’>
<input type='text' name='IDEBIT_CURRENCY' value='CA'>
<input type='text' name='IDEBIT_FUNDEDURL' value='your funded url'>
<input type='text' name='IDEBIT_NOTFUNDEDURL' value='your not funded url'>
<input type='text' name='IDEBIT_ISSLANG' value='en'>
<input type='text' name='IDEBIT_VERSION' value='1'>
<input type="submit" name="Submit" value="Submit to Gateway">
</form>
November 2018 CanadaOnly Page 110 of 476
![](asset-6f.png)
Moneris Gateway API- Integration Guide
5.5.2 Online Banking Response and Fund-Confirmation Request
The response variables are posted back in an HTML form to either the funded or non-funded URL that
was provided to INTERAC®.
The following variables must be validated (5.8, page 116):
lIDEBIT_TRACK2
lIDEBIT_ISSCONF
lIDEBIT_ISSNAME
lIDEBIT_VERSION
lIDEBIT_ISSLANG
lIDEBIT_INVOICE
Note that IDEBIT_ISSCONF and IDEBIT_ISSNAME must be displayed on the client’s receipt that is gen-
erated by the merchant.
After validation, IDEBIT_TRACK2 is used to form an IDebitPurchase transaction that is sent to Moneris
Gateway to confirm the fund.
If the validation fails, redirect the client to the main page and ask for a different means of payment.
If the validation passes, an IDebitPurchase transaction can be sent to Moneris Gateway.
5.6 INTERAC® Online Payment Purchase
INTERAC® Online Payment Purchase transaction object definition
IDebitPurchase IOP_Txn = new IDebitPurchase();
HttpsPostRequest object for INTERAC® Online Payment Purchase transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(IOP_Txn);
INTERAC® Online Payment Purchase transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
IOP_Txn.SetOrderId(order_
id);
Amount String 9-character decimal IOP_Txn.SetAmount(amount);
Track2 data String 40-character alpha- IOP_Txn.SetTrack2(track2);
Table 48: INTERAC® Online Payment transaction object mandatory values
Page 111 of 476 Canada Only November 2018
![](asset-70.png)
5 INTERAC® Online Payment
Value Type Limits Set method
numeric
Table 48: INTERAC® Online Payment transaction object mandatory values
Value Type Limits Set method
Customer ID String 50-character alphanumeric IOP_Txn.SetCustId(cust_id);
Dynamic
descriptor
String 20-character alphanumeric IOP_Txn.SetDynamicDescriptor
(dynamic_descriptor);
Customer
information
Object Not applicable. Click hereSee
Section 14 (page 353).
IOP_Txn.SetCustInfo(customer);
Table 49: INTERAC® Online Payment Purchase transaction optional values
Sample INTERAC® Online Payment Purchase
namespace Moneris
{
using System;
public class TestCanadaIDebitPurchase
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "Lance_Briggs_55";
string amount = "5.00";
string track2 = "5268051119993326=0609AAAAAAAAAAAAA000";
string processing_country_code = "CA";
bool status_check = false;
/********************* Billing/Shipping Variables ****************************/
string first_name = "Bob";
string last_name = "Smith";
string company_name = "ProLine Inc.";
string address = "623 Bears Ave";
string city = "Chicago";
string province = "Illinois";
string postal_code = "M1M2M1";
string country = "Canada";
string phone = "777-999-7777";
string fax = "777-999-7778";
string tax1 = "10.00";
string tax2 = "5.78";
string tax3 = "4.56";
string shipping_cost = "10.00";
/********************* Order Line Item Variables *****************************/
string[] item_description = new string[] { "Chicago Bears Helmet", "Soldier Field Poster" };
string[] item_quantity = new string[] { "1", "1" };
string[] item_product_code = new string[] { "CB3450", "SF998S" };
string[] item_extended_amount = new string[] { "150.00", "19.79" };
/********************** Customer Information Object **************************/
November 2018 CanadaOnly Page 112 of 476
![](asset-71.png)
Moneris Gateway API- Integration Guide
Sample INTERAC® Online Payment Purchase
CustInfo customer = new CustInfo();
/********************** Set Customer Billing Information **********************/
customer.SetBilling(first_name, last_name, company_name, address, city,
province, postal_code, country, phone, fax, tax1, tax2,
tax3, shipping_cost);
/******************** Set Customer Shipping Information ***********************/
customer.SetShipping(first_name, last_name, company_name, address, city,
province, postal_code, country, phone, fax, tax1, tax2,
tax3, shipping_cost);
/***************************** Order Line Items ******************************/
customer.SetItem(item_description[0], item_quantity[0],
item_product_code[0], item_extended_amount[0]);
customer.SetItem(item_description[1], item_quantity[1],
item_product_code[1], item_extended_amount[1]);
/************************** Request *************************/
IDebitPurchase IOP_Txn = new IDebitPurchase();
IOP_Txn.SetOrderId(order_id);
IOP_Txn.SetCustId(cust_id);
IOP_Txn.SetAmount(amount);
IOP_Txn.SetIdebitTrack2(track2);
IOP_Txn.SetCustInfo(customer);
//IOP_Txn.SetDynamicDescriptor("dynamicdescriptor1");
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(IOP_Txn);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Page 113 of 476 Canada Only November 2018
![](asset-72.png)
5 INTERAC® Online Payment
5.7 INTERAC® Online Payment Refund
To process this transaction, you need the order ID and transaction number from the original INTERAC®
Online Payment Purchase transaction.
INTERAC® Online Payment Refund transaction object definition
IDebitRefund refund = new IDebitRefund();
HttpsPostRequest object for INTERAC® Online Payment Refund transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(refund);
INTERAC® Online Payment Refund transaction object values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
refund.SetOrderId(order_id);
Amount String 9-character decimal refund.SetAmount(amount);
Transaction number String 255-character alpha-
numeric
refund.SetTxnNumber(txn_
number);
Table 50: INTERAC® Online PaymentRefund transaction object mandatory variables
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
refund.SetCustId(cust_id);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Table 51: INTERAC® Online Payment Refund transaction optional values
Sample code
Sample INTERAC® Online Payment Refund
namespace Moneris
{
using System;
public class TestCanadaIDebitRefund
{
public static void Main(string[] args)
November 2018 CanadaOnly Page 114 of 476
![](asset-73.png)
Moneris Gateway API- Integration Guide
Sample INTERAC® Online Payment Refund
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test20150625014816";
string amount = "5.00";
string txn_number = "113524-0_10";
string processing_country_code = "CA";
bool status_check = false;
IDebitRefund refund = new IDebitRefund();
refund.SetOrderId(order_id);
refund.SetAmount(amount);
refund.SetTxnNumber(txn_number);
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(refund);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Page 115 of 476 Canada Only November 2018
![](asset-74.png)
5 INTERAC® Online Payment
5.8 INTERAC® Online Payment Field Definitions
Value
Characters Limits
Description
IDEBIT_
MERCHNUM
5-14 Numbers and uppercase letters
This field is provided by Moneris. For example, 0003MONMPGXXXX.
IDEBIT_TERMID 8 Numbers and uppercase letters
Optional field
IDEBIT_
AMOUNT
1-12 Numbers
Amount expressed in cents (for example, 1245 for $12.45) to charge to the card.
IDEBIT_
CURRENCY
3 "CAD" or "USD"
National currency of the transaction.
IDEBIT_INVOICE 1-20 ISO-8859-1 encoded characters restricted to:
lUppercase and lowercase
lNumbers
lÀ Á Â Ä È É Ê Ë Î Ï Ô Ù Û Ü Ç à á â ä è é ê ë î ï ô ù û ü ÿ ç
lSpaces
l# $. , - / = ? @ '
Optional field
Can be the Order ID when used with Moneris Gateway fund confirmation trans-
actions.
IDEBIT_
MERCHDATA
1024 ISO-8859-1 restricted to single-byte codes, hex 20 to 7E (consistent with
US-ASCII and ISO-8859-1 Latin-1).
Note that the following character combinations may not be accepted in
the IDEBIT_MERCHDATA field:
l"/..", "/%2E.", "/.%2E", "/%2E%2E", "\\%2E%2E", "\\%2E.",
"\\.%2E", "\\%2E%2E", "&#", "<", "%3C", ">", "%3E"
Free form data provided by the merchant that will be passed back unchanged to the
merchant once the payment has been guaranteed in online banking.
This may be used to identify the customer, session or both.
Table 52: Field Definitions
November 2018 CanadaOnly Page 116 of 476
![](asset-75.png)
Moneris Gateway API- Integration Guide
Value
Characters Limits
Description
IDEBIT_
FUNDEDURL
1024 ISO-8859-1 restricted to single-byte codes, restricted to:
lUppercase and lowercase letters
lNumbers
l; / ? : @ & = + $, - _ . ! ~ * ‘() %
Https address to which the issuer will redirect cardholders after guaranteeing the
fund through online banking.
IDEBIT_
NOTFUNDEDURL
1024 ISO-8859-1, restricted to single-byte codes, restricted to:
lUppercase and lowercase letters
lNumbers
l; / ? : @ & = + $, - _ . ! ~ * ‘() %
Https address to which the issuer redirects cardholders after failing or canceling the
online banking process.
IDEBIT_
MERCHLANG
2 “en” or “fr”
Customer's current language at merchant.
IDEBIT_VERSION 3 Numbers
Initially, the value is 1.
IDEBIT_ISSLANG 2 “en” or “fr”
Customer’s current language at issuer.
IDEBIT_TRACK2 37 ISO-8859-1 (restricted to single-byte codes), hex 20 to 7E (consistent with
US-ASCII and ISO-8859-1 Latin-1)
Value returned by the issuer. It includes the PAN, expiry date, and transaction ID.
IDEBIT_ISSCONF 15 ISO-8859-1 encoded characters restricted to:
lUppercase and lowercase letters
lNumbers
lÀ Á Â Ä È É Ê Ë Î Ï Ô Ù Û Ü Ç à á â ä è é ê ë î ï ô ù û ü ÿ ç
lSpaces
l# $. , - / = ? @ '
Confirmation number returned from the issuer to be displayed on the merchant’s
confirmation page and on the receipt.
Table 52: Field Definitions (continued)
Page 117 of 476 Canada Only November 2018
![](asset-76.png)
5 INTERAC® Online Payment
Value
Characters Limits
Description
IDEBIT_
ISSNAME
30 ISO-8859-1 encoded characters restricted to:
lUppercase and lowercase letters
lNumbers
lÀ Á Â Ä È É Ê Ë Î Ï Ô Ù Û Ü Ç à á â ä è é ê ë î ï ô ù û ü ÿ ç
lSpaces
l# $. , - / = ? @ • '
Issuer name to be displayed on the merchant’s confirmation page and on the
receipt.
Table 52: Field Definitions (continued)
November 2018 CanadaOnly Page 118 of 476
![](asset-77.png)
6 Mag Swipe Transaction Set
l6.1 Mag Swipe Transaction Type Definitions
l6.2 Mag Swipe Purchase
l6.2.1 Encrypted Mag Swipe Purchase
l6.3 Mag Swipe Pre-Authorization
l6.3.1 Encrypted Mag Swipe Pre-Authorization
l6.4 Mag Swipe Completion
l6.5 Mag Swipe Force Post
l6.5.1 Encrypted Mag Swipe Force Post
l6.6 Mag Swipe Purchase Correction
l6.7 Mag Swipe Refund
l6.8 Mag Swipe Independent Refund
l6.8.1 Encrypted Mag Swipe Independent Refund
Mag Swipe transactions allow customers to swipe a credit card and submit the Track2 details.
These transactions support the submission of Track2 as well as a manual entry of the credit card number
and expiry date. If all three fields are submitted, the Track2 details are used to process the transaction.
6.1 Mag Swipe Transaction Type Definitions
Purchase
Verifies funds on the customer’s card, removes the funds and prepares them for deposit into
the merchant’s account.
Pre-Authorization
Verifies and locks funds on the customer’s credit card. The funds are locked for a specified
amount of time based on the card issuer.
To retrieve the funds that have been locked by a Pre-Authorization transaction so that they
may be settled in the merchant’s account, a Completion transaction must be performed. A
Pre-Authorization may only be "completed" once.
Completion
Retrieves funds that have been locked (by a Mag Swipe Pre-Authorization transaction), and
prepares them for settlement into the merchant’s account.
Force Post
Retrieves the locked funds and prepares them for settlement into the merchant’s account.
This is used when a merchant obtains the authorization number directly from the issuer by a
third-party authorization method (such as by phone).
Purchase Correction
Restores the full amount of a previous Mag Swipe Purchase or Mag Swipe Completion trans-
action to the cardholder's card, and removes any record of it from the cardholder's state-
ment. The order ID and transaction number from the original transaction are required, but
the credit card does not need to be re-swiped.
This transaction can be used against a Purchase or Completion transaction that occurred
same day provided that the batch containing the original transaction remains open. When
using the automated closing feature, Batch Close occurs daily between 10 and 11 pm Eastern
Time.
November 2018 Page 119 of 476
![](asset-78.png)
Moneris Gateway API- Integration Guide
This transaction is sometimes referred to as "void".
Refund
Restores all or part of the funds from a Mag Swipe Purchase or Mag Swipe Completion trans-
action to the cardholder's card. Unlike a Purchase Correction, there is a record of the refund.
Independent Refund
Credits a specified amount to the cardholder’s credit card.
This does not require a previous transaction (such as Mag Swipe Purchase) to be logged in the
Moneris Gateway. However, a credit card must be swiped to provide the Track2 data.
6.1.1 Encrypted Mag Swipe Transactions
Encrypted Mag Swipe transactions allow the customer to swipe or key in a credit card using a Moneris-
provided encrypted mag swipe reader, and submit the encrypted Track2 details.
The encrypted mag swipe reader can be used for processing:
lSwiped card-present transactions
lManually keyed card-present transactions
lManually keyed card-not-present transactions.
Encrypted Mag Swipe transactions are identical to the regular Mag Swipe transactions from the cus-
tomer's perspective. However, the card data must be swiped or keyed in via a Moneris-provided encryp-
ted mag swipe reader. Contact Moneris for more details.
Only Mag Swipe Purchase and Mag Swipe Pre-Authorization have encrypted versions. Their explanations
appear in this document as subsections of the regular (unencrypted) Mag Swipe Purchase and Mag
Swipe Pre-Authorization transactions respectively.
6.2 Mag Swipe Purchase
Mag Swipe Purchase transaction object definition
Track2Purchase track2purchase = new Track2Purchase();
HttpsPostRequest object for Mag Swipe Purchase transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(track2purchase);
Mag Swipe Purchase transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Page 120 of 476 November 2018
![](asset-79.png)
6 Mag Swipe Transaction Set
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
track2purchase.SetOrderId
(order_id);
Amount String 9-character decimal track2purchase.SetAmount
(amount);
Credit card number
OR
Track2 data
String 20-character numeric
OR
40-character numeric
track2purchase.SetPan(pan);
OR
track2purchase.SetTrack2
(track2);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
track2purchase.SetExpdate
(expiry_date);
POS code String 2-character numeric track2purchase.SetPosCode
(pos_code);
Table 53: Mag Swipe Purchase transaction object mandatory values
Value Type Limits Set method
AVS information Object N/A track2purchase.SetAvsInfo
(avsCheck);
Customer ID String 50-character alpha-
numeric
track2purchase.SetCustId
(cust_id);
CVD information Object N/A track2purchase.SetCvdInfo
(cvdCheck);
Dynamic descriptor String 20-character alpha-
numeric
track2purchase
.SetDynamicDescriptor
(dynamic_descriptor);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Table 54: Mag Swipe Purchase transaction optional values
Sample Mag Swipe Purchase
namespace Moneris
{
November 2018 Page 121 of 476
![](asset-7a.png)
Moneris Gateway API- Integration Guide
Sample Mag Swipe Purchase
using System;
using System.Text.RegularExpressions;
public class TestCanadaTrack2Purchase
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "LBriggs";
string amount = "1.00";
string track2 = "";
//string track2 = ";5258968987035454=06061015454001060101?";
string pan = "4242424242424242";
string exp_date = "1903"; //must send '0000' if swiped
string pos_code = "00";
string processing_country_code = "CA";
bool status_check = false;
Track2Purchase track2purchase = new Track2Purchase();
track2purchase.SetOrderId(order_id);
track2purchase.SetCustId(cust_id);
track2purchase.SetAmount(amount);
track2purchase.SetTrack2(track2);
track2purchase.SetPan(pan);
track2purchase.SetExpdate(exp_date);
track2purchase.SetPosCode(pos_code);
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(track2purchase);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
//Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
//Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
Page 122 of 476 November 2018
![](asset-7b.png)
6 Mag Swipe Transaction Set
Sample Mag Swipe Purchase
}
}
}
}
6.2.1 Encrypted Mag Swipe Purchase
Encrypted Mag Swipe Purchase transaction object definition
EncTrack2Purchase encpurchase = new EncTrack2Purchase();
HttpsPostRequest object for Encrypted Mag Swipe Purchase transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(encpurchase);
Encrypted Mag Swipe Purchase transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
encpurchase.SetOrderId
(order_id);
Amount String 9-character decimal encpurchase.SetAmount
(amount);
Encrypted Track2 data String n/a encpurchase.SetEncTrack2
(enc_track2);
POS code String 2-character numeric encpurchase.SetPosCode(pos_
code);
Device type String 30-character alpha-
numeric
encpurchase.SetDeviceType
(device_type);
Table 55: Encrypted Mag Swipe Purchase transaction object mandatory values
November 2018 Page 123 of 476
![](asset-7c.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
encpurchase.SetCustId(cust_
id);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
AVS information Object Not applicable. Click
hereSee 9.1 (page
283).
encpurchase.SetAvsInfo
(avsCheck);
Dynamic descriptor String 20-character alpha-
numeric
encpurchase
.SetDynamicDescriptor
(dynamic_descriptor);
Table 56: Encrypted Mag Swipe Purchase transaction optional values
Sample Encrypted Mag Swipe Purchase
namespace Moneris
{
using System;
using System.Text.RegularExpressions;
public class TestCanadaEncTrack2Purchase
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "LBriggs";
string amount = "1.00";
string pos_code = "00";
string device_type = "idtech_bdk";
string processing_country_code = "CA";
bool status_check = false;
string dynamic_descriptor = "my descriptor";
string enc_track2 = "ENCRYPTEDTRACK2DATA";
EncTrack2Purchase encpurchase = new EncTrack2Purchase();
encpurchase.SetOrderId(order_id);
encpurchase.SetCustId(cust_id);
encpurchase.SetAmount(amount);
encpurchase.SetEncTrack2(enc_track2);
encpurchase.SetPosCode(pos_code);
encpurchase.SetDeviceType(device_type);
encpurchase.SetDynamicDescriptor(dynamic_descriptor);
AvsInfo avsCheck = new AvsInfo();
avsCheck.SetAvsStreetNumber("212");
avsCheck.SetAvsStreetName("Payton Street");
avsCheck.SetAvsZipCode("M1M1M1");
encpurchase.SetAvsInfo(avsCheck);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
Page 124 of 476 November 2018
![](asset-7d.png)
6 Mag Swipe Transaction Set
Sample Encrypted Mag Swipe Purchase
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(encpurchase);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("MaskedPan = " + receipt.GetMaskedPan());
Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
Console.WriteLine("AVS Response = " + receipt.GetAvsResultCode());
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
6.3 Mag Swipe Pre-Authorization
Mag Swipe Pre-Authorization transaction object definition
Track2PreAuth track2preauth = new Track2PreAuth();
HttpsPostRequest object for Mag Swipe Pre-Authorization transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(track2preauth);
Mag Swipe Pre-Authorization transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
November 2018 Page 125 of 476
![](asset-7e.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
track2preauth.SetOrderId
(order_id);
Amount String 9-character decimal track2preauth.SetAmount
(amount);
Credit card number
OR
Track2 data
String 20-character numeric
OR
40-character numeric
track2preauth.SetPan(pan);
OR
track2preauth.SetPan(pan);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
track2preauth.SetExpdate
(expiry_date);
POS code String 2-character numeric track2preauth.SetPosCode(pos_
code);
Table 57: Mag Swipe Pre-Authorization transaction object mandatory values
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
track2preauth.SetCustId
(cust_id);
Dynamic descriptor String 20-character alpha-
numeric
track2preauth
.SetDynamicDescriptor
(dynamic_descriptor);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Table 58: Mag Swipe Pre-Authorization transaction optional values
Sample Mag Swipe Pre-Authorization
namespace Moneris
{
using System;
using System.Text.RegularExpressions;
public class TestCanadaTrack2Preauth
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "LBriggs";
string amount = "5.00";
Page 126 of 476 November 2018
![](asset-7f.png)
6 Mag Swipe Transaction Set
Sample Mag Swipe Pre-Authorization
//string track2 = ";5258968987035454=06061015454001060101?";
string track2 = "";
string pan = "4242424242424242";
string exp = "1906"; //must send '0000' if swiped
string pos_code = "00";
string processing_country_code = "CA";
bool status_check = false;
Track2PreAuth track2preauth = new Track2PreAuth();
track2preauth.SetOrderId(order_id);
track2preauth.SetCustId(cust_id);
track2preauth.SetAmount(amount);
track2preauth.SetTrack2(track2);
track2preauth.SetPan(pan);
track2preauth.SetExpdate(exp);
track2preauth.SetPosCode(pos_code);
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(track2preauth);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
//Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
//Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
6.3.1 Encrypted Mag Swipe Pre-Authorization
Encrypted Mag Swipe Pre-Authorization transaction object definition
EncTrack2PreAuth enctrack2preauth = new EncTrack2PreAuth();
November 2018 Page 127 of 476
![](asset-80.png)
Moneris Gateway API- Integration Guide
HttpsPostRequest object for Encrypted Mag Swipe Pre-Authorization transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(enctrack2preauth);
Encrypted Mag Swipe Pre-Authorization transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
enctrack2preauth.SetOrderId
(order_id);
Amount String 9-character decimal enctrack2preauth.SetAmount
(amount);
Credit card number
OR
Encrypted Track2
String 20-character numeric
OR
n/a
enctrack2preauth.SetPan
(pan);
OR
enctrack2preauth
.SetEncTrack2(enc_track2);
POS code String 2-character numeric enctrack2preauth.SetPosCode
(pos_code);
Device type String 30-character alpha-
numeric
enctrack2preauth
.SetDeviceType(device_type);
Table 59: Encrypted Mag Swipe Pre-Authorization transaction object mandatory values
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
enctrack2preauth.SetCustId
(cust_id);
Status Check Boolean true/false mpgReq.SetStatusCheck(status_
check);
Table 60: Encrypted Mag Swipe Pre-Authorization transaction optional values
Sample Encrypted Mag Swipe Pre-Authorization
namespace Moneris
{
using System;
using System.Text.RegularExpressions;
public class TestCanadaEncTrack2Preauth
Page 128 of 476 November 2018
![](asset-81.png)
6 Mag Swipe Transaction Set
Sample Encrypted Mag Swipe Pre-Authorization
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "LBriggs";
string amount = "5.00";
string pos_code = "00";
string device_type = "idtech_bdk";
string processing_country_code = "CA";
bool status_check = false;
string enc_track2 = "ENCRYPTEDTRACK2DATA";
string descriptor = "nqa";
EncTrack2PreAuth enctrack2preauth = new EncTrack2PreAuth();
enctrack2preauth.SetOrderId(order_id);
enctrack2preauth.SetCustId(cust_id);
enctrack2preauth.SetAmount(amount);
enctrack2preauth.SetEncTrack2(enc_track2);
enctrack2preauth.SetPosCode(pos_code);
enctrack2preauth.SetDeviceType(device_type);
enctrack2preauth.SetDynamicDescriptor(descriptor);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(enctrack2preauth);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("MaskedPan = " + receipt.GetMaskedPan());
Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
November 2018 Page 129 of 476
![](asset-82.png)
Moneris Gateway API- Integration Guide
6.4 Mag Swipe Completion
Mag Swipe Completion transaction object definition
Track2Completion track2completion = new Track2Completion();
HttpsPostRequest object for Mag Swipe Completion transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(track2completion);
Mag Swipe Completion transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
track2completion.SetOrderId
(order_id);
Transaction number String 255-character variable
character
track2completion.SetTxnNumber
(txn_number);
Completion Amount String 9-character decimal track2completion.SetCompAmount
(comp_amount);
POS code String 2-character numeric track2completion.SetPosCode
(pos_code);
Table 61: Mag Swipe Completion transaction object mandatory values
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
track2completion.SetCustId
(cust_id);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Dynamic descriptor String 20-character alpha-
numeric
track2completion
.SetDynamicDescriptor
(dynamic_descriptor);
Table 62: Mag Swipe Completion transaction optional values
Sample Mag SwipeCompletion
namespace Moneris
{
using System;
Page 130 of 476 November 2018
![](asset-83.png)
6 Mag Swipe Transaction Set
Sample Mag SwipeCompletion
public class TestCanadaTrack2Completion
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
string order_id = "Test20150625035422";
string txn_number = "87028-0_10";
string amount = "1.00";
string pos_code = "00";
string dynamic_descriptor = "123456";
string processing_country_code = "CA";
bool status_check = false;
Track2Completion track2completion = new Track2Completion();
track2completion.SetOrderId(order_id);
track2completion.SetTxnNumber(txn_number);
track2completion.SetAmount(amount);
track2completion.SetPosCode(pos_code);
track2completion.SetDynamicDescriptor(dynamic_descriptor);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(track2completion);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
//Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
//Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
November 2018 Page 131 of 476
![](asset-84.png)
Moneris Gateway API- Integration Guide
6.5 Mag Swipe Force Post
Mag Swipe Force Post transaction object definition
Track2ForcePost track2forcePost = new Track2ForcePost();
HttpsPostRequest object for Mag Swipe Force Post transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(track2forcePost);
Mag Swipe Force Post transaction mandatory arguments
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
track2forcePost.SetOrderId
(order_id);
Amount String 9-character decimal track2forcePost.SetAmount
(amount);
Credit card number
OR
Track2 data
String 20-character numeric
OR
40-character numeric
track2forcePost.SetPan(pan);
OR
track2forcePost.SetTrack2
(track2);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
track2forcePost.SetExpdate
(expiry_date);
POS code String 2-character numeric track2forcePost.SetPosCode
(pos_code);
Authorization code String 8-character alpha-
numeric
track2forcePost.SetAuthCode
(auth_code);
Table 63: Mag Swipe Force Post transaction object mandatory values
Page 132 of 476 November 2018
![](asset-85.png)
6 Mag Swipe Transaction Set
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
track2forcePost.SetCustId
(cust_id);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Dynamic descriptor String 20-character alpha-
numeric
track2forcePost
.SetDynamicDescriptor
(dynamic_descriptor);
Table 64: Mag Swipe Force Post transaction optional values
Sample MagSwipe Force Post
namespace Moneris
{
using System;
public class TestCanadaTrack2ForcePost
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string amount = "10.00";
string track2 = "";
string pan = "4242424242424242";
string expiry_date = "1212";
string pos_code = "00";
string auth_code = "AU4R6";
string processing_country_code = "CA";
bool status_check = false;
Track2ForcePost track2forcePost = new Track2ForcePost();
track2forcePost.SetOrderId(order_id);
track2forcePost.SetAmount(amount);
track2forcePost.SetTrack2(track2);
track2forcePost.SetPan(pan);
track2forcePost.SetExpdate(expiry_date);
track2forcePost.SetPosCode(pos_code);
track2forcePost.SetAuthCode(auth_code);
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(track2forcePost);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
November 2018 Page 133 of 476
![](asset-86.png)
Moneris Gateway API- Integration Guide
Sample MagSwipe Force Post
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
//Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
//Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
6.5.1 Encrypted Mag Swipe Force Post
The Encrypted Mag Swipe Force Post is used when a merchant obtains the authorization number directly
from the issuer using a phone or any third-party authorization method. This transaction does not
require that an existing order be logged in the MonerisGateway. However, the credit card must be
swiped or keyed in using a Moneris-provided encrypted mag swipe reader, and the encrypted Track2
details must be submitted. There are also optional fields that may be submitted such as cust_id and
dynamic_descriptor.
To complete the transaction, the authorization number obtained from the issuer must be entered.
Encrypted Mag Swipe Force Post transaction object definition
EncTrack2Forcepost enctrack2fp = new EncTrack2Forcepost();
HttpsPostRequest object for Encrypted Mag Swipe Force Post transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(enctrack2fp);
Page 134 of 476 November 2018
![](asset-87.png)
6 Mag Swipe Transaction Set
Encrypted Mag Swipe Force Post transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
enctrack2fp.SetOrderId
(order_id);
Amount String 9-character decimal enctrack2fp.SetAmount
(amount);
Encrypted Track2 data String n/a enctrack2fp.SetEncTrack2
(enc_track2);
POS Code String 2-character numeric enctrack2fp.SetPosCode(pos_
code);
Device type String 30-character alpha-
numeric
enctrack2fp.SetDeviceType
(device_type);
Authorization Code String 8-character alpha-
numeric
enctrack2fp.SetAuthCode
(auth_code);
Table 1 Encrypted Mag Swipe Force Post transaction object mandatory values
Value Type Limits Set Method
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Customer ID String 50-character alpha-
numeric
enctrack2fp.SetCustId(cust_
id);
Dynamic descriptor String 20-character alpha-
numeric
enctrack2fp
.SetDynamicDescriptor
(dynamic_descriptor);
Table 2 Encrypted Mag Swipe Force Post transaction object optional values
Sample Encrypted Mag Swipe ForcePost
namespace Moneris
{
using System;
public class TestCanadaEncTrack2Forcepost
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
November 2018 Page 135 of 476
![](asset-88.png)
Moneris Gateway API- Integration Guide
Sample Encrypted Mag Swipe ForcePost
string cust_id = "my customer id";
string amount = "5.00";
string pos_code = "00";
string device_type = "idtech_bdk";
string auth_code = "123456";
string processing_country_code = "CA";
bool status_check = false;
string descriptor = "my descriptor";
string enc_track2 = "ENCRYPTEDTRACK2DATA";
EncTrack2Forcepost enctrack2fp = new EncTrack2Forcepost();
enctrack2fp.SetOrderId(order_id);
enctrack2fp.SetCustId(cust_id);
enctrack2fp.SetAmount(amount);
enctrack2fp.SetEncTrack2(enc_track2);
enctrack2fp.SetPosCode(pos_code);
enctrack2fp.SetDeviceType(device_type);
enctrack2fp.SetAuthCode(auth_code);
enctrack2fp.SetDynamicDescriptor(descriptor);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(enctrack2fp);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("MaskedPan = " + receipt.GetMaskedPan());
Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Page 136 of 476 November 2018
![](asset-89.png)
6 Mag Swipe Transaction Set
6.6 Mag Swipe Purchase Correction
Mag Swipe Purchase Correction transaction object definition
Track2PurchaseCorrection track2void = new Track2PurchaseCorrection();
HttpsPostRequest object for Mag Swipe Purchase Correction transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(track2void);
Mag Swipe Purchase Correction transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
track2purchasecorrection
.SetOrderId(order_id);
Transaction number String 255-character alpha-
numeric
track2purchasecorrection
.SetTxnNumber(txn_number);
Table 65: Mag Swipe Purchase Correction transaction object mandatory values
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
track2purchasecorrection
.SetCustId(cust_id);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Table 66: Mag Swipe Purchase Correction transaction optional values
Sample Mag Swipe Purchase Correction
namespace Moneris
{
using System;
public class TestCanadaTrack2PurchaseCorrection
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
string order_id = "Test20150625030621";
string txn_number = "86949-0_10";
string dynamic_descriptor = "123456";
string cust_id = "my customer id";
string processing_country_code = "CA";
November 2018 Page 137 of 476
![](asset-8a.png)
Moneris Gateway API- Integration Guide
Sample Mag Swipe Purchase Correction
bool status_check = false;
Track2PurchaseCorrection track2void = new Track2PurchaseCorrection();
track2void.SetOrderId(order_id);
track2void.SetCustId(cust_id);
track2void.SetTxnNumber(txn_number);
track2void.SetDynamicDescriptor(dynamic_descriptor);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(track2void);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
//Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
//Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
6.7 Mag Swipe Refund
Mag Swipe Refund transaction object definition
Track2Refund track2refund = new Track2Refund();
HttpsPostRequest object for Mag Swipe Refund transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(track2refund);
Page 138 of 476 November 2018
![](asset-8b.png)
6 Mag Swipe Transaction Set
Mag Swipe Refund transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
track2refund.SetOrderId
(order_id);
Amount String 9-character decimal track2refund.SetAmount
(amount);
Transaction number String 255-character alpha-
numeric
track2refund.SetTxnNumber
(txn_number);
Table 67: Mag Swipe Refund transaction object mandatory values
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
track2refund.SetCustId(cust_
id);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Dynamic descriptor String 20-character alpha-
numeric
track2refund
.SetDynamicDescriptor
(dynamic_descriptor);
Table 68: Mag Swipe Refund transaction optional values
Sample Mag Swipe Refund
namespace Moneris
{
using System;
public class TestCanadaTrack2Refund
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
string order_id = "Test20150625035152"; //will prompt user for input
string txn_number = "87017-0_10";
string amount = "1.00";
string dynamic_descriptor = "123456";
string cust_id = "customer id";
string processing_country_code = "CA";
bool status_check = false;
Track2Refund track2refund = new Track2Refund();
track2refund.SetOrderId(order_id);
track2refund.SetAmount(amount);
track2refund.SetCustId(cust_id);
November 2018 Page 139 of 476
![](asset-8c.png)
Moneris Gateway API- Integration Guide
Sample Mag Swipe Refund
track2refund.SetTxnNumber(txn_number);
track2refund.SetDynamicDescriptor(dynamic_descriptor);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(track2refund);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
//Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
//Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
6.8 Mag Swipe Independent Refund
NOTE: If you receive a TRANSACTION NOT ALLOWED error, it may mean the Mag
Swipe Independent Refund transaction is not supported on your account. Contact Moneris
to have it temporarily (re-)enabled.
Mag Swipe Independent Refund transaction object definition
Track2IndependentRefund track2indrefund = new Track2IndependentRefund();
Page 140 of 476 November 2018
![](asset-8d.png)
6 Mag Swipe Transaction Set
HttpsPostRequest object for Mag Swipe Independent Refund transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(track2indrefund);
Mag Swipe Independent Refund transaction values
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
track2indrefund
.SetOrderId(order_
id);
Amount String 9-character decimal track2indrefund
.SetAmount
(amount);
Credit card number String 20-character numeric track2indrefund
.SetPan(pan);
Track2 data String 40-character numeric track2indrefund
.SetTrack2
(track2);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
track2indrefund
.SetExpdate
(expiry_date);
POS code String 2-character numeric track2indrefund
.SetPosCode(pos_
code);
Table 69: Mag Swipe Independent Refund transaction object mandatory values
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
track2indrefund
.SetCustId(cust_id);
Dynamic descriptor String 20-character alpha-
numeric
track2indrefund
.SetDynamicDescriptor
(dynamic_descriptor);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Table 70: Mag Swipe Independent Refund transaction optional values
Sample MagSwipe Independent Refund
namespace Moneris
{
using System;
public class TestCanadaTrack2IndependentRefund
November 2018 Page 141 of 476
![](asset-8e.png)
Moneris Gateway API- Integration Guide
Sample MagSwipe Independent Refund
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "Ced_Benson32";
string amount = "5.00";
string track2 = "";
string pan = "4242424242424242";
string exp = "1903"; //must send '0000' if swiped
string pos_code = "00";
string processing_country_code = "CA";
bool status_check = false;
Track2IndependentRefund track2indrefund = new Track2IndependentRefund();
track2indrefund.SetOrderId(order_id);
track2indrefund.SetCustId(cust_id);
track2indrefund.SetAmount(amount);
track2indrefund.SetTrack2(track2);
track2indrefund.SetPan(pan);
track2indrefund.SetExpdate(exp);
track2indrefund.SetPosCode(pos_code);
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(track2indrefund);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
//Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
//Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Page 142 of 476 November 2018
![](asset-8f.png)
6 Mag Swipe Transaction Set
6.8.1 Encrypted Mag Swipe Independent Refund
The Encrypted Mag Swipe Independent Refund credits a specified amount to the cardholder’s credit
card. The Encrypted Mag Swipe Independent Refund does not require an existing order to be logged in
the Moneris Gateway. However, the credit card must be swiped using the Moneris-provided encrypted
mag swipe reader to provide the encrypted track2 details.
There are also optional fields that may be submitted such as cust_id and dynamic_descriptor. The
transaction format is almost identical to Encrypted Mag Swipe Purchase and Encrypted Mag Swipe
PreAuth.
NOTE:
The Encrypted Mag Swipe Independent Refund transaction may not be supported on
your account. This may yield a TRANSACTION NOT ALLOWED error when attempting the
transaction.
To temporarily enable (or re-enable) the Independent Refund transaction type, contact
Moneris
Encrypted Mag Swipe Independent Refund transaction object definition
EncTrack2IndependentRefund encindrefund = new EncTrack2IndependentRefund();
HttpsPostRequest object for Encrypted Mag Swipe Independent Refund transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(encindrefund);
Encrypted Mag Swipe Independent Refund transaction object values
Value Type Limits Set Method
OrderID String 50-character alpha-
numeric
encindrefund.SetOrderId
(order_id);
Amount String 9-character decimal encindrefund.SetAmount
(amount);
Encrypted Track 2 data String n/a encindrefund.SetEncTrack2
(enc_track2);
Table 1 Encrypted Mag Swipe Independent Refund transaction object mandatory values
November 2018 Page 143 of 476
![](asset-90.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set Method
Device Type String 30-character alpha-
numeric
encindrefund.SetDeviceType
(device_type);
POSCode String 2-character numeric encindrefund.SetPosCode(pos_
code);
Value Type Limits Set Method
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Customer ID String 50-character alpha-
numeric
encindrefund.SetCustId(cust_
id);
Table 2 Encrypted Mag Swipe Independent Refund transaction object optional values
Sample Encrypted MagSwipe Independent Refund
namespace Moneris
{
using System;
public class TestCanadaEncTrack2IndependentRefund
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "my customer id";
string amount = "5.00";
string pos_code = "00";
string device_type = "idtech_bdk";
string processing_country_code = "CA";
string enc_track2 = "ENCRYPTEDTRACK2DATA";
string descriptor = "nqa";
EncTrack2IndependentRefund encindrefund = new EncTrack2IndependentRefund();
encindrefund.SetOrderId(order_id);
encindrefund.SetCustId(cust_id);
encindrefund.SetAmount(amount);
encindrefund.SetEncTrack2(enc_track2);
encindrefund.SetPosCode(pos_code);
encindrefund.SetDeviceType(device_type);
encindrefund.SetDynamicDescriptor(descriptor);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(encindrefund);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Page 144 of 476 November 2018
![](asset-91.png)
6 Mag Swipe Transaction Set
Sample Encrypted MagSwipe Independent Refund
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("MaskedPan = " + receipt.GetMaskedPan());
Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
November 2018 Page 145 of 476
![](asset-92.png)
7 Level 2/3 Transactions
l7.1 About Level 2/3 Transactions
l7.2 Level 2/3 Visa Transactions
l7.3 Level 2/3 MasterCard Transactions
l7.4 Level 2/3 American Express Transactions
7.1 About Level 2/3 Transactions
The Moneris Gateway API supports passing Level 2/3 purchasing card transaction data for
Visa,MasterCard and AmericanExpress corporate cards.
All Level 2/3 transactions use the same Pre-Authorization transaction as described in the topic Pre-
Authorization (page 19).
7.2 Level 2/3 Visa Transactions
l7.2.1 Level 2/3 Transaction Types for Visa
l7.2.2 Level 2/3 Transaction Flow for Visa
l7.2.3 VS Completion
l7.2.5 VS Force Post
l7.2.4 VS Purchase Correction
l7.2.6 VS Refund
l7.2.7 VS Independent Refund
l7.2.8 VS Corpais
7.2.1 Level 2/3 Transaction Types for Visa
This transaction set includes a suite of corporate card financial transactions as well as a transaction that
allows for the passing of Level 2/3 data. Please ensure that Visa Level 2/3 support is enabled on your mer-
chant account. Batch Close, Open Totals and Pre-authorization are identical to the transactions outlined
in the section Basic Transaction Set (page 12).
lWhen the Pre-authorization response contains CorporateCard equal to true then you can submit
the Visa transactions.
lIf CorporateCard is false then the card does not support Level 2/3 data and non Level 2/3 trans-
action are to be used. If the card is not a corporate card, please refer to the section 2 Basic Trans-
action Set for the appropriate non-corporate card transactions.
NOTE: This transaction set is intended for transactions where Corporate Card is true and
Level 2/3 data will be submitted. If the credit card is found to be a corporate card but you do
November 2018 Page 146 of 476
![](asset-93.png)
Moneris Gateway API- Integration Guide
not wish to send any Level 2/3 data then you may submit Visa transactions using the basic
transaction set outlined in 2 Basic Transaction Set.
Pre-authorization– (authorization/pre-authorization)
Pre-authorization verifies and locks funds on the customer’s credit card. The funds are locked
for a specified amount of time, based on the card issuer. To retrieve the funds from a preauth
so that they may be settled in the merchant account a capture must be performed. Cor-
porateCard will return as true if the card supports Level 2/3.
VS Completion – (Capture/Pre-authorization Completion)
Once a Pre-authorization is obtained the funds that are locked need to be retrieved from the
customer’s credit card. The capture retrieves the locked funds and readies them for set-
tlement into the merchant account. Prior to performing a VS Completion, a Pre-authorization
must be performed. Once the transaction is completed, VSCorpais must be used to process
the Level 2/3 data.
VS Force Post – (Force Capture/Pre-authorization Completion)
This transaction is an alternative to VS Completion to obtain the funds locked on Pre-auth
obtained from IVR or equivalent terminal. The VSForcePost retrieves the locked funds and
readies them for settlement in to the merchant account. Once the transaction is completed,
VSCorpais must be used to process the Level 2/3 data.
VS Purchase Correction (Void, Correction)
VS Completion and VSForce Post can be voided the same day* that they occur. A
VSPurchase Correction must be for the full amount of the transaction and will remove any
record of it from the cardholder statement.
VS Refund – (Credit)
A VSRefund can be performed against a VS Completion to refund any part or all of the trans-
action. Once the transaction is completed, VSCorpais must be used to process the Level 2/3
data.
VS Independent Refund – (Credit)
A VSIndependent Refund can be performed against a purchase or a capture to refund any
part, or all of the transaction. Independent refund is used when the originating transaction
was not performed through Moneris Gateway. Once the transaction is completed, VSCorpais
must be used to process the Level 2/3 data.
NOTE:the Independent Refund transaction may or may not be supported on your
account. If you receive a transaction not allowed error when attempting an inde-
pendent refund, it may mean the transaction is not supported on your account. If you
wish to have the Independent Refund transaction type temporarily enabled (or re-
enabled), please contact the Service Centre at 1-866-319-7450.
VS Corpais – (Level 2/3 Data)
VSCorpais will contain all the required and optional data fields for Level 2/3 Business to Busi-
ness data. VSCorpais data can be sent when the card has been identified in the Pre-author-
ization transaction request as being a corporate card.
Page 147 of 476 November 2018
![](asset-94.png)
7 Level 2/3 Transactions
* A VS Purchase Correction can be performed against a transaction as long as the batch that contains the
original transaction remains open. When using the automated closing feature, the batch close occurs
daily between 10 – 11 pm EST.
7.2.2 Level 2/3 Transaction Flow for Visa
Pre-authorization/Completion Transaction Flow
Purchase Correction TransactionFlow
7.2.3 VS Completion
Once a Pre-authorization is obtained, the funds that are locked need to be retrieved from the customer’s
credit card. This VSCompletion transaction is used to secure the funds locked by a pre-authorization
transaction and readies them for settlement into the merchant account.
NOTE: Once you have completed this transaction successfully, to submit the complete sup-
plemental level 2/3 data, please proceed to VS Corpais.
VSCompletion transaction object definition
VsCompletion vsCompletion = new VsCompletion();
HttpsPostRequest object for VSCompletion transaction object
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(vsCompletion);
November 2018 Page 148 of 476
![](asset-95.png)
Moneris Gateway API- Integration Guide
VSCompletion transaction object values
Value Type Limits Set Method
OrderID String 50-character alpha-
numeric
vsCompletion.SetOrderId
(order_id);
Completion amount String 9-character decimal vsCompletion.SetCompAmount
(comp_amount);
Transaction number String 255-character alpha-
numeric
vsCompletion.SetTxnNumber
(txn_number);
E-CommerceIndicator String 1-character alpha-
numeric
vsCompletion.SetCryptType
(crypt);
Table 1 VSCompletion transaction object mandatory values
Req* Value Limits Set Method Description
Y NationalTax 12-character decimal vsCompletion
.SetNationalTax
(national_tax);
Must reflect
the amount of
National Tax
(GST or HST)
appearing on
the invoice.
Minimum - 0.01
Maximum -
999999.99.
Must have 2
decimal places.
Y Merchant
VATRegistration/Single
Business Reference
20-character alpha-
numeric
vsCompletion
.SetMerchantVatNo
(merchant_vat_no);
Merchant’s Tax
Registration
Number
must be
provided if tax
is included on
the invoice
NOTE: Must
not be all
spaces or all
zeroes
Table 2 Visa - Corporate Card CommonData - Level 2 Request Fields
Page 149 of 476 November 2018
![](asset-96.png)
7 Level 2/3 Transactions
Req* Value Limits Set Method Description
C Local Tax 12-character decimal vsCompletion
.SetLocalTax
(local_tax);
Must reflect
the amount of
Local Tax (PST
or QST) appear-
ing on the
invoice
If Local Tax
included then
must not be all
spaces or all zer-
oes; Must be
provided if
Local Tax (PST
or QST) applies
Minimum =
0.01
Maximum =
999999.99
Must have 2
decimal places
C Local Tax (PST or QST)
Registration Number
15-character alpha-
numeric
vsCompletion
.SetLocalTaxNo
(local_tax_no);
Merchant's
Local Tax
(PST/QST) Regis-
tration Number
Must be
provided if tax
is included on
the invoice; If
Local Tax
included then
must not be all
spaces or all zer-
oes
Must be
provided if
Local Tax (PST
or QST) applies
C Customer
VATRegistration Num-
ber
13-character alpha-
numeric
vsCompletion
.SetCustomerVatNo
(customer_vat_no);
If the Cus-
tomer’s Tax
Registration
November 2018 Page 150 of 476
![](asset-97.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Set Method Description
Number
appears on the
invoice to sup-
port tax
exempt trans-
actions it must
be provided
here
C Customer Code/Cus-
tomer Reference Iden-
tifier (CRI)
16-character alpha-
numeric
vsCompletion
.SetCri(cri); Value which the
customer may
choose to
provide to the
supplier at the
point of sale –
must be
provided if
given by the
customer
N Customer Code 17-character alpha-
numeric
vsCompletion
.SetCustomerCode
(customer_code);
Optional cus-
tomer code
field that will
not be passed
along to Visa,
but will be
included on
Moneris report-
ing
N Invoice Number 17-character alpha-
numeric
vsCompletion
.SetInvoiceNumber
(invoice_number);
Optional
invoice number
field that will
not be passed
along to Visa,
but will be
included on
Moneris report-
ing
*Y = Required, N= Optional, C = Conditional
Sample VS Completion
namespace Moneris
{
using System;
Page 151 of 476 November 2018
![](asset-98.png)
7 Level 2/3 Transactions
Sample VS Completion
using System.Collections;
using System.Text;
public class TestVsCompletion
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id="ord-210916-15:14:46";
string comp_amount="5.00";
string txn_number = "19002-0_11";
string crypt="7";
string national_tax = "1.23";
string merchant_vat_no = "gstno111";
string local_tax = "2.34";
string customer_vat_no = "gstno999";
string cri = "CUST-REF-002";
string customer_code="ccvsfp";
string invoice_number="invsfp";
string local_tax_no="ltaxno";
VsCompletion vsCompletion = new VsCompletion();
vsCompletion.SetOrderId(order_id);
vsCompletion.SetCompAmount(comp_amount);
vsCompletion.SetTxnNumber(txn_number);
vsCompletion.SetCryptType(crypt);
vsCompletion.SetNationalTax(national_tax);
vsCompletion.SetMerchantVatNo(merchant_vat_no);
vsCompletion.SetLocalTax(local_tax);
vsCompletion.SetCustomerVatNo(customer_vat_no);
vsCompletion.SetCri(cri);
vsCompletion.SetCustomerCode(customer_code);
vsCompletion.SetInvoiceNumber(invoice_number);
vsCompletion.SetLocalTaxNo(local_tax_no);
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(vsCompletion);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
November 2018 Page 152 of 476
![](asset-99.png)
Moneris Gateway API- Integration Guide
Sample VS Completion
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
7.2.4 VS Purchase Correction
The VSPurchase Correction (also known as a "void") transaction is used to cancel a transaction that was
performed in the current batch. No amount is required because a void is always for 100% of the original
transaction. The only transaction that can be voided using VS Purchase Correction is a VS Completion or
VS Force Post. To send a void the order_id and txn_number from the VS Completion/VS Force Post are
required.
VS Purchase Correction transaction object definition
VsPurchaseCorrection vsPurchaseCorrection = new VsPurchaseCorrection();
HttpsPostRequest object for VS Purchase Correction transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(vsPurchaseCorrection);
VS Purchase Correction transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
vsPurchaseCorrection
.SetOrderId(order_id);
Transaction number String 255-character alpha-
numeric
vsPurchaseCorrection
.SetTxnNumber(txn_number);
E-Commerce Indicator String 1-character alpha-
numeric
vsPurchaseCorrection
.SetCryptType(crypt);
Table 1 VS Purchase Correction transaction object mandatory values
Page 153 of 476 November 2018
![](asset-9a.png)
7 Level 2/3 Transactions
Sample VS Purchase Correction
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestVsPurchaseCorrection
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id="Test20170116050230";
string txn_number = "39016-0_11";
string crypt="7";
VsPurchaseCorrection vsPurchaseCorrection = new VsPurchaseCorrection();
vsPurchaseCorrection.SetOrderId(order_id);
vsPurchaseCorrection.SetTxnNumber(txn_number);
vsPurchaseCorrection.SetCryptType(crypt);
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(vsPurchaseCorrection);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
November 2018 Page 154 of 476
![](asset-9b.png)
Moneris Gateway API- Integration Guide
7.2.5 VS Force Post
The VS Force Post transaction is used to secure the funds locked by a pre-authorization transaction per-
formed over IVR or equivalent terminal. When sending a force post request, you will need Order ID,
Amount,Credit Card Number, ExpiryDate, E-commerce Indicator and the Authorization Code received in
the pre-authorization response.
NOTE: Once you have completed this transaction successfully, to submit the complete sup-
plemental level 2/3 data, please proceed to VS Corpais.
VSForce Post transaction object definition
VsForcePost vsForcePost = new VsForcePost();
HttpsPostRequest object for VSForce Post transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(vsForcePost);
VSForce Post transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
vsForcePost.SetOrderId
(order_id);
Amount String 9-character decimal vsForcePost.SetAmount
(amount);
Credit card number String 20-character numeric vsForcePost.SetPan(pan);
Expiry Date String 4-character numeric
YYMM format
vsForcePost.SetExpdate
(expiry_date);
Authorizationcode String 8-character alpha-
numeric
vsForcePost.SetAuthCode
(auth_code);
E-commerce Indicator String 1-character alpha-
numeric
vsForcePost.SetCryptType
(crypt);
Table 1 VSForce Post transaction object mandatory values
Page 155 of 476 November 2018
![](asset-9c.png)
7 Level 2/3 Transactions
Value Type Limits Set Method
Customer ID String 50-character alpha-
numeric
vsForcePost.SetCustId(cust_
id);
Table 2 VSForce Post transaction object optional values
Req* Value Limits Set Method Description
Y NationalTax 12-character decimal vsForcePost
.SetNationalTax
(national_tax);
Must reflect
the amount of
National Tax
(GST or HST)
appearing on
the invoice.
Minimum -
0.01 Maximum
- 999999.99.
Must have 2
decimal places.
Y Merchant
VATRegistration/Single
Business Reference
20-character alpha-
numeric
vsForcePost
.SetMerchantVatNo
(merchant_vat_no);
Merchant’s Tax
Registration
Number
must be
provided if tax
is included on
the invoice
NOTE: Must
not be all
spaces or all
zeroes
C Local Tax 12-character decimal vsForcePost
.SetLocalTax
(local_tax);
Must reflect
the amount of
Local Tax (PST
or QST) appear-
ing on the
invoice
If Local Tax
included then
Table 3 Visa - Corporate Card CommonData - Level 2 Request Fields
November 2018 Page 156 of 476
![](asset-9d.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Set Method Description
must not be all
spaces or all zer-
oes; Must be
provided if
Local Tax (PST
or QST) applies
Minimum =
0.01
Maximum =
999999.99
Must have 2
decimal places
C Local Tax (PST or QST)
Registration Number
15-character alpha-
numeric
vsForcePost
.SetLocalTaxNo
(local_tax_no);
Merchant's
Local Tax
(PST/QST)
Registration
Number
Must be
provided if tax
is included on
the invoice; If
Local Tax
included then
must not be all
spaces or all zer-
oes
Must be
provided if
Local Tax (PST
or QST) applies
C Customer
VATRegistration Num-
ber
13-character alpha-
numeric
vsForcePost
.SetCustomerVatNo
(customer_vat_no);
If the Cus-
tomer’s Tax
Registration
Number
appears on the
invoice to sup-
port tax
exempt trans-
actions it must
be provided
here
Page 157 of 476 November 2018
![](asset-9e.png)
7 Level 2/3 Transactions
Req* Value Limits Set Method Description
C Customer Code/Cus-
tomer Reference Iden-
tifier (CRI)
16-character alpha-
numeric
vsForcePost
.SetCri(cri); Value which
the customer
may choose to
provide to the
supplier at the
point of sale –
must be
provided if
given by the
customer
N Customer Code 17-character alpha-
numeric
vsForcePost
.SetCustomerCode
(customer_code);
Optional cus-
tomer code
field that will
not be passed
along to Visa,
but will be
included on
Moneris report-
ing
N Invoice Number 17-character alpha-
numeric
vsForcePost
.SetInvoiceNumber
(invoice_number);
Optional
invoice number
field that will
not be passed
along to Visa,
but will be
included on
Moneris report-
ing
*Y = Required, N= Optional, C = Conditional
Sample VS Force Post
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestVsForcePost
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id="Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
November 2018 Page 158 of 476
![](asset-9f.png)
Moneris Gateway API- Integration Guide
Sample VS Force Post
string cust_id="CUST13343";
string amount="5.00";
string pan="4242424254545454";
string expiry_date="2012"; //YYMM
string auth_code="123456";
string crypt="7";
string national_tax = "1.23";
string merchant_vat_no = "gstno111";
string local_tax = "2.34";
string customer_vat_no = "gstno999";
string cri = "CUST-REF-002";
string customer_code="ccvsfp";
string invoice_number="invsfp";
string local_tax_no="ltaxno";
VsForcePost vsForcePost = new VsForcePost();
vsForcePost.SetOrderId(order_id);
vsForcePost.SetCustId(cust_id);
vsForcePost.SetAmount(amount);
vsForcePost.SetPan(pan);
vsForcePost.SetExpDate(expiry_date);
vsForcePost.SetAuthCode(auth_code);
vsForcePost.SetCryptType(crypt);
vsForcePost.SetNationalTax(national_tax);
vsForcePost.SetMerchantVatNo(merchant_vat_no);
vsForcePost.SetLocalTax(local_tax);
vsForcePost.SetCustomerVatNo(customer_vat_no);
vsForcePost.SetCri(cri);
vsForcePost.SetCustomerCode(customer_code);
vsForcePost.SetInvoiceNumber(invoice_number);
vsForcePost.SetLocalTaxNo(local_tax_no);
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(vsForcePost);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
Page 159 of 476 November 2018
![](asset-a0.png)
7 Level 2/3 Transactions
Sample VS Force Post
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
7.2.6 VS Refund
VSRefund will credit a specified amount to the cardholder’s credit card. A refund can be sent up to the
full value of the original VS Completion or VS Force Post. To send a VSRefund you will require the Order
ID and Transaction Number from the original VS Completion or VS Force Post.
NOTE: Once you have completed this transaction successfully, to submit the complete sup-
plemental level 2/3 data, please proceed to VS Corpais.
VS Refund transaction object definition
VsRefund vsRefund = new VsRefund();
HttpsPostRequest object for VS Refund transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(vsRefund);
VS Refund transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
vsRefund.SetOrderId(order_
id);
Transaction number String 255-character alpha-
numeric
vsRefund.SetTxnNumber(txn_
number);
Amount String 9-character decimal vsRefund.SetAmount(amount);
E-CommerceIndicator String 1-character alpha-
numeric
vsRefund.SetCryptType
(crypt);
Table 1 VSRefund transaction object mandatory values
November 2018 Page 160 of 476
![](asset-a1.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Set Method Description
Y NationalTax 12-character decimal vsRefund
.SetNationalTax
(national_tax);
Must reflect
the amount of
National Tax
(GST or HST)
appearing on
the invoice.
Minimum -
0.01 Maximum
- 999999.99.
Must have 2
decimal places.
Y Merchant
VATRegistration/Single
Business Reference
20-character alpha-
numeric
vsRefund
.SetMerchantVatNo
(merchant_vat_no);
Merchant’s Tax
Registration
Number
must be
provided if tax
is included on
the invoice
NOTE: Must
not be all
spaces or all
zeroes
C Local Tax 12-character decimal vsRefund
.SetLocalTax
(local_tax);
Must reflect
the amount of
Local Tax (PST
or QST) appear-
ing on the
invoice
If Local Tax
included then
must not be all
spaces or all zer-
oes; Must be
provided if
Local Tax (PST
or QST) applies
Minimum =
0.01
Table 2 Visa - Corporate Card CommonData - Level 2 Request Fields
Page 161 of 476 November 2018
![](asset-a2.png)
7 Level 2/3 Transactions
Req* Value Limits Set Method Description
Maximum =
999999.99
Must have 2
decimal places
C Local Tax (PST or QST)
Registration Number
15-character alpha-
numeric
vsRefund
.SetLocalTaxNo
(local_tax_no);
Merchant's
Local Tax
(PST/QST)
Registration
Number
Must be
provided if tax
is included on
the invoice; If
Local Tax
included then
must not be all
spaces or all zer-
oes
Must be
provided if
Local Tax (PST
or QST) applies
C Customer
VATRegistration Num-
ber
13-character alpha-
numeric
vsRefund
.SetCustomerVatNo
(customer_vat_no);
If the Cus-
tomer’s Tax
Registration
Number
appears on the
invoice to sup-
port tax
exempt trans-
actions it must
be provided
here
C Customer Code/Cus-
tomer Reference Iden-
tifier (CRI)
16-character alpha-
numeric
vsRefund
.SetCri(cri); Value which
the customer
may choose to
provide to the
supplier at the
point of sale –
must be
provided if
given by the
November 2018 Page 162 of 476
![](asset-a3.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Set Method Description
customer
N Customer Code 17-character alpha-
numeric
vsRefund
.SetCustomerCode
(customer_code);
Optional cus-
tomer code
field that will
not be passed
along to Visa,
but will be
included on
Moneris report-
ing
N Invoice Number 17-character alpha-
numeric
vsRefund
.SetInvoiceNumber
(invoice_number);
Optional
invoice number
field that will
not be passed
along to Visa,
but will be
included on
Moneris report-
ing
*Y = Required, N= Optional, C = Conditional
Sample VS Refund
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestVsRefund
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id="Test20170116043144";
string amount="5.00";
string txn_number = "39011-0_11";
string crypt="7";
string national_tax = "1.23";
string merchant_vat_no = "gstno111";
string local_tax = "2.34";
string customer_vat_no = "gstno999";
string cri = "CUST-REF-002";
string customer_code="ccvsfp";
string invoice_number="invsfp";
string local_tax_no="ltaxno";
Page 163 of 476 November 2018
![](asset-a4.png)
7 Level 2/3 Transactions
Sample VS Refund
VsRefund vsRefund = new VsRefund();
vsRefund.SetOrderId(order_id);
vsRefund.SetAmount(amount);
vsRefund.SetTxnNumber(txn_number);
vsRefund.SetCryptType(crypt);
vsRefund.SetNationalTax(national_tax);
vsRefund.SetMerchantVatNo(merchant_vat_no);
vsRefund.SetLocalTax(local_tax);
vsRefund.SetCustomerVatNo(customer_vat_no);
vsRefund.SetCri(cri);
vsRefund.SetCustomerCode(customer_code);
vsRefund.SetInvoiceNumber(invoice_number);
vsRefund.SetLocalTaxNo(local_tax_no);
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(vsRefund);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
7.2.7 VS Independent Refund
VSIndependent Refund will credit a specified amount to the cardholder’s credit card. The independent
refund does not require an existing order to be logged in the Moneris Gateway; however, the credit card
number and expiry date will need to be passed. The transaction format is almost identical to a pre-author-
ization.
November 2018 Page 164 of 476
![](asset-a5.png)
Moneris Gateway API- Integration Guide
NOTE: Once you have completed this transaction successfully, to submit the complete sup-
plemental level 2/3 data, please proceed to VS Corpais.
VS Independent Refund transaction object definition
VsIndependentRefund vsIndependentRefund = new VsIndependentRefund();
HttpsPostRequest object for VS Independent Refund transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(vsIndependentRefund);
VS Independent Refund transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
vsIndependentRefund
.SetOrderId(order_id);
Amount String 9-character decimal vsIndependentRefund
.SetAmount(amount);
Credit card number String 20-character numeric vsIndependentRefund.SetPan
(pan);
Expiry date String 4-character numeric
YYMM format
vsIndependentRefund
.SetExpdate(expiry_date);
E-commerce indicator String 1-character alpha-
numeric
vsIndependentRefund
.SetCryptType(crypt);
Table 1 VS Independent Refund transaction object mandatory values
Value Type Limits Set Method
Customer ID String 50-character alpha-
numeric
vsIndependentRefund
.SetCustId(cust_id);
Table 2 VS Independent Refund transaction object optional values
Req* Value Limits Set Method Description
Y NationalTax 12-character decimal vsIndependentRefund
.SetNationalTax
(national_tax);
Must reflect
the amount of
Table 3 Visa - Corporate Card CommonData - Level 2 Request Fields
Page 165 of 476 November 2018
![](asset-a6.png)
7 Level 2/3 Transactions
Req* Value Limits Set Method Description
National Tax
(GST or HST)
appearing on
the invoice.
Minimum -
0.01 Maximum
- 999999.99.
Must have 2
decimal places.
Y Merchant
VATRegistration/Single
Business Reference
20-character alpha-
numeric
vsIndependentRefund
.SetMerchantVatNo
(merchant_vat_no);
Merchant’s
Tax Regis-
tration Num-
ber
must be
provided if tax
is included on
the invoice
NOTE: Must
not be all
spaces or all
zeroes
C Local Tax 12-character decimal vsIndependentRefund
.SetLocalTax(local_
tax);
Must reflect
the amount of
Local Tax (PST
or QST) appear-
ing on the
invoice
If Local Tax
included then
must not be all
spaces or all
zeroes; Must
be provided if
Local Tax (PST
or QST) applies
Minimum =
0.01
Maximum =
999999.99
November 2018 Page 166 of 476
![](asset-a7.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Set Method Description
Must have 2
decimal places
C Local Tax (PST or QST)
Registration Number
15-character alpha-
numeric
vsIndependentRefund
.SetLocalTaxNo
(local_tax_no);
Merchant's
Local Tax
(PST/QST)
Registration
Number
Must be
provided if tax
is included on
the invoice; If
Local Tax
included then
must not be all
spaces or all
zeroes
Must be
provided if
Local Tax (PST
or QST) applies
C Customer
VATRegistration Num-
ber
13-character alpha-
numeric
vsIndependentRefund
.SetCustomerVatNo
(customer_vat_no);
If the Cus-
tomer’s Tax
Registration
Number
appears on the
invoice to sup-
port tax
exempt trans-
actions it must
be provided
here
C Customer Code/Cus-
tomer Reference Iden-
tifier (CRI)
16-character alpha-
numeric
vsIndependentRefund
.SetCri(cri); Value which
the customer
may choose to
provide to the
supplier at the
point of sale –
must be
provided if
given by the
customer
Page 167 of 476 November 2018
![](asset-a8.png)
7 Level 2/3 Transactions
Req* Value Limits Set Method Description
N Customer Code 17-character alpha-
numeric
vsIndependentRefund
.SetCustomerCode
(customer_code);
Optional cus-
tomer code
field that will
not be passed
along to Visa,
but will be
included on
Moneris
reporting
N Invoice Number 17-character alpha-
numeric
vsIndependentRefund
.SetInvoiceNumber
(invoice_number);
Optional
invoice num-
ber field that
will not be
passed along
to Visa, but will
be included on
Moneris
reporting
*Y = Required, N= Optional, C = Conditional
Sample VS Independent Refund
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestVsIndependentRefund
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id="Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id="CUST13343";
string amount="5.00";
string pan="4242424254545454";
string expiry_date="2012"; //YYMM
string crypt="7";
string national_tax = "1.23";
string merchant_vat_no = "gstno111";
string local_tax = "2.34";
string customer_vat_no = "gstno999";
string cri = "CUST-REF-002";
string customer_code="ccvsfp";
string invoice_number="invsfp";
string local_tax_no="ltaxno";
VsIndependentRefund vsIndependentRefund = new VsIndependentRefund();
November 2018 Page 168 of 476
![](asset-a9.png)
Moneris Gateway API- Integration Guide
Sample VS Independent Refund
vsIndependentRefund.SetOrderId(order_id);
vsIndependentRefund.SetCustId(cust_id);
vsIndependentRefund.SetAmount(amount);
vsIndependentRefund.SetPan(pan);
vsIndependentRefund.SetExpDate(expiry_date);
vsIndependentRefund.SetCryptType(crypt);
vsIndependentRefund.SetNationalTax(national_tax);
vsIndependentRefund.SetMerchantVatNo(merchant_vat_no);
vsIndependentRefund.SetLocalTax(local_tax);
vsIndependentRefund.SetCustomerVatNo(customer_vat_no);
vsIndependentRefund.SetCri(cri);
vsIndependentRefund.SetCustomerCode(customer_code);
vsIndependentRefund.SetInvoiceNumber(invoice_number);
vsIndependentRefund.SetLocalTaxNo(local_tax_no);
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(vsIndependentRefund);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
7.2.8 VS Corpais
VS Corpais will contain all the required and optional data fields for Level 2/3 Purchasing Card Addendum
data. VS Corpais data can be sent when the card has been identified in the Pre-authorization transaction
request as being a corporate card.
In addition to the Order ID and Transaction number, this transaction also contains two objects:
Page 169 of 476 November 2018
![](asset-aa.png)
7 Level 2/3 Transactions
lVS Purcha – Corporate Card CommonData
lVSPurchl – Line ItemDetails
VS Corpais request must be preceded by a financial transaction (VS Completion, VS Force Post, VS
Refund, VS Independent Refund) and the Corporate Card flag must be set to “true” in the Pre-author-
ization response.
VS Corpais transaction object definition
VsCorpais vsCorpais = new VsCorpais();
HttpsPostRequest object for VS Corpais transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(vsCorpais);
VS Corpais transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
vsCorpais.SetOrderId(order_
id);
Transaction number String 255-character alpha-
numeric
vsCorpais.SetTxnNumber(txn_
number);
vsPurcha
For a list of the vari-
ables that appear in
this object, see the
table below
Object n/a VsPurcha vsPurcha = new
VsPurcha();
vsCorpais.SetVsPurch
(vsPurcha,vsPurchl);
vsPurchl
For a list of the vari-
ables that appear in
this object, see the
table below
Object n/a VsPurchl vsPurchl = new
VsPurchl();
vsCorpais.SetVsPurch
(vsPurcha,vsPurchl);
Table 1 VS Corpais transaction object mandatory values
*Y = Required, N= Optional, C = Conditional
7.2.8.1 VS Purcha - Corporate Card CommonData
VSCorpais transactions use the VSPurcha object to contain Level 2 data.
November 2018 Page 170 of 476
![](asset-ab.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Set Method Description
C Buyer Name 30-character
alphanumeric
vsPurcha.SetBuyerName
(buyer_name);
Buyer/Recipient
Name
NOTE: Name
required by CRA on
transactions >$150
C Local Tax Rate 4-character
decimal
vsPurchaSetLocalTaxRate
(local_tax_rate);
Indicates the
detailed tax rate
applied in rela-
tionship to a local
tax amount
EXAMPLE: 8% PST
should be 8.0
Minimum = 0.01
Maximum = 99.99
NOTE: Must be
provided if Local
Tax (PST or QST)
applies.
N Duty Amount 9-character
decimal
vsPurchaSetDutyAmount
(duty_amount);
Duty on total pur-
chase amount
A minus sign
means 'amount is a
credit', plus sign or
no sign means
'amount is a debit'
maximum without
sign is 999999.99
N Invoice Discount
Treatment
1-character
numeric
vsPurcha
.SetDiscountTreatment
(discount_treatment);
Indicates how the
merchant is man-
aging discounts
Must be one of the
following values:
0 - if no invoice level
discounts apply for this
Table 1 Corporate Card Common Data - Level 2 Request Fields - VSPurcha
Page 171 of 476 November 2018
![](asset-ac.png)
7 Level 2/3 Transactions
Req* Value Limits Set Method Description
invoice
1 - if Tax was cal-
culated on Post-Dis-
count totals
2 - if Tax was cal-
culated on Pre-Discount
totals
N Invoice Level Dis-
count Amount
9-character
decimal
vsPurcha.SetDiscountAmt
(discount_amt);
Amount of dis-
count (if provided
at the invoice level
according to the
Invoice Discount
Treatment)
Must be non-zero
if Invoice Discount
Treatment is 1 or 2
Minimum amount
is 0.00 and max-
imum is 999999.99
C Ship To Postal
Code / Zip Code
10-character
alphanumeric
vsPurcha
.SetShipToPostalCode
(ship_to_pos_code);
The postal code or
zip code for the
destination where
goods will be
delivered
NOTE: Required if
shipment is
involved
Full alpha postal
code - Valid
ANA<space>NAN
format required if
shipping to an
address within
Canada
C Ship From Postal
Code / Zip Code
10-character
alphanumeric
vsPurcha
.SetShipFromPostalCode
(ship_from_pos_code);
The postal code or
zip code from
which items were
shipped
For Canadian
November 2018 Page 172 of 476
![](asset-ad.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Set Method Description
addresses,requires
full alpha postal
code for the mer-
chant with Valid
ANA<space>NAN
format
C Destination
Country Code
2-character alpha-
numeric
vsPurcha.SetDesCouCode
(des_cou_code);
Code of country
where purchased
goods will be
delivered
Use ISO 3166-1
alpha-2 format
NOTE: Required if
it appears on the
invoice for an inter-
national trans-
action
Y Unique VAT
Invoice Refer-
ence Number
25-character
alphanumeric
vsPurcha.SetVatRefNum
(vat_ref_num);
Unique Value
Added Tax Invoice
Reference Number
Must be populated
with the invoice
number and this
cannot be all
spaces or zeroes
Y Tax Treatment 1-character alpha-
numeric
vsPurcha
.SetTaxTreatment(tax_
treatment);
Must be one of the
following values:
0 = Net Prices with tax
calculated at line item
level;
1 = Net Prices with tax
calculated at invoice
level;
2 = Gross prices given
with tax information
provided at line item
level;
3 = Gross prices given
with tax information
provided at invoice
level;
Page 173 of 476 November 2018
![](asset-ae.png)
7 Level 2/3 Transactions
Req* Value Limits Set Method Description
4 = No tax applies
(small merchant) on
the invoice for the
transaction
N Freight/Shipping
Amount (Ship
Amount)
9-character
decimal
vsPurcha
.SetFreightAmount
(freight_amount);
Freight charges on
total purchase
If shipping is not
provided as a line
item it must be
provided here, if
applicable
Signed monetary
amount:
Minus (-) sign
means 'amount is a
credit',
Plus (+) sign or no
sign means
'amount is a debit'
Maximum without
sign is 999999.99
C GST HST Freight
Rate
4-character
decimal
vsPurcha
.SetGstHstFreightRate
(gst_hst_freight_rate);
Rate of GST
(excludes PST) or
HST charged on the
shipping amount
(in accordance with
the Tax Treatment)
If Freight/Shipping
Amount is
provided then this
(National GST or
HST) tax rate must
be provided.
Monetary amount,
maximum is 99.99.
Such as 13% HST is
13.00
C GST HST Freight
Amount
9-character
decimal
vsPurcha
.SetGstHstFreightAmount
(gst_hst_freight_
Amount of GST
(excludes PST) or
HST charged on the
November 2018 Page 174 of 476
![](asset-af.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Set Method Description
amount); shipping amount
If Freight/Shipping
Amount is
provided then this
(National GST or
HST) tax amount
must be provided if
taxTreatment is 0
or 2
Signed monetary
amount: maximum
without sign is
999999.99.
7.2.8.2 VS Purchl - Line Item Details
VSCorpais transactions use the VSPurchl object to contain Level 3 data.
Line Item Details for VSPurchl
string[] item_com_code = {"X3101", "X84802"};
string[] product_code = {"CHR123", "DDSK200"};
string[] item_description = {"Office Chair", "Disk Drive"};
string[] item_quantity = {"3", "1"};
string[] item_uom = {"EA", "EA"};
string[] unit_cost = {"0.20", "0.40"};
string[] vat_tax_amt = {"0.00", "0.00"};
string[] vat_tax_rate = {"13.00", "13.00"};
string[] discount_treatmentL = {"0", "0"};
string[] discount_amtL = {"0.00", "0.00"};
Setting VSPurchl Line Item Details
vsPurchl.SetVsPurchl(item_com_code[0], product_code[0], item_description[0],
item_quantity[0], item_uom[0], unit_cost[0], vat_tax_amt[0], vat_tax_rate[0],
discount_treatmentL[0], discount_amtL[0]);
vsPurchl.SetVsPurchl(item_com_code[1], product_code[1], item_description[1],
item_quantity[1], item_uom[1], unit_cost[1], vat_tax_amt[1], vat_tax_rate[1],
discount_treatmentL[1], discount_amtL[1]);
Page 175 of 476 November 2018
![](asset-b0.png)
7 Level 2/3 Transactions
Req* Value Limits Variable/Field Description
C Item Commodity
Code
12-character alpha-
numeric
item_com_code Line item Comod-
ity Code (if this
field is not sent,
then Product Code
must be sent)
Y Product Code 12-character alpha-
numeric
product_code Product code for
this line item – mer-
chant’s product
code, man-
ufacturer’s
product code or
buyer’s product
code
Typically this will
be the SKU or iden-
tifier by which the
merchant tracks
and prices the item
or service
This should always
be provided for
every line item
Y Item Description 35-character alpha-
numeric
item_description Line item descrip-
tion
Y Item Quantity 12-character decimal item_quantity Quantity invoiced
for this line item
Up to 4 decimal
places supported,
whole numbers
are accepted
Minimum = 0.0001
Maximum =
999999999999
Y Item Unit of
Measure
2-character alpha-
numeric
item_uom Unit of measure
Use ANSI X-12 EDI
Allowable Units of
Measure and
Table 1 Corporate Card Common Data - Level 3 Request Fields - VSPurchl
November 2018 Page 176 of 476
![](asset-b1.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Variable/Field Description
Codes
Y Item Unit Cost 12-character decimal unit_cost Line item cost per
unit
2-4 decimal places
accepted
Minimum = 0.0001
Maximum =
999999.9999
N VAT Tax Amount 12-character decimal vat_tax_amt Any value-added
tax or other sales
tax amount
Must have 2
decimal places
Minimum = 0.01
Maximum =
999999.99
N VAT Tax Rate 4-character decimal vat_tax_rate Sales tax rate
EXAMPLE: 8% PST
should be 8.0
maximum 99.99
Y Discount Treat-
ment
1-character numeric discount_treatmentL Must be one of the
following values:
0 if no invoice level dis-
counts apply for this
invoice
1 if Tax was calculated
on Post-Discount totals
2 if Tax was calculated
on Pre-Discount totals
C Discount
Amount
12-character decimal discount_amtL Amount of dis-
count, if provided
for this line item
according to the
Line Item Discount
Page 177 of 476 November 2018
![](asset-b2.png)
7 Level 2/3 Transactions
Req* Value Limits Variable/Field Description
Treatment
Must be non-zero
if Line Item Dis-
count Treatment is
1 or 2
Must have 2
decimal places
Minimum = 0.01
Maximum =
999999.99
7.2.8.3 Sample Code for VS Corpais
Sample VS Corpais
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestVsCorpais
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id="ord-160916-15:31:39";
string txn_number="18306-0_11";
string buyer_name = "Buyer Manager";
string local_tax_rate = "13.00";
string duty_amount = "0.00";
string discount_treatment = "0";
string discount_amt = "0.00";
string freight_amount = "0.20";
string ship_to_pos_code = "M8X 2W8";
string ship_from_pos_code = "M1K 2Y7";
string des_cou_code = "CAN";
string vat_ref_num = "VAT12345";
string tax_treatment = "3";//3 = Gross prices given with tax information provided at invoice level
string gst_hst_freight_amount = "0.00";
string gst_hst_freight_rate = "13.00";
string[] item_com_code = {"X3101", "X84802"};
string[] product_code = {"CHR123", "DDSK200"};
string[] item_description = {"Office Chair", "Disk Drive"};
string[] item_quantity = {"3", "1"};
string[] item_uom = {"EA", "EA"};
string[] unit_cost = {"0.20", "0.40"};
November 2018 Page 178 of 476
![](asset-b3.png)
Moneris Gateway API- Integration Guide
Sample VS Corpais
string[] vat_tax_amt = {"0.00", "0.00"};
string[] vat_tax_rate = {"13.00", "13.00"};
string[] discount_treatmentL = {"0", "0"};
string[] discount_amtL = {"0.00", "0.00"};
//Create and set VsPurcha
VsPurcha vsPurcha = new VsPurcha();
vsPurcha.SetBuyerName(buyer_name);
vsPurcha.SetLocalTaxRate(local_tax_rate);
vsPurcha.SetDutyAmount(duty_amount);
vsPurcha.SetDiscountTreatment(discount_treatment);
vsPurcha.SetDiscountAmt(discount_amt);
vsPurcha.SetFreightAmount(freight_amount);
vsPurcha.SetShipToPostalCode(ship_to_pos_code);
vsPurcha.SetShipFromPostalCode(ship_from_pos_code);
vsPurcha.SetDesCouCode(des_cou_code);
vsPurcha.SetVatRefNum(vat_ref_num);
vsPurcha.SetTaxTreatment(tax_treatment);
vsPurcha.SetGstHstFreightAmount(gst_hst_freight_amount);
vsPurcha.SetGstHstFreightRate(gst_hst_freight_rate);
//Create and set VsPurchl
VsPurchl vsPurchl = new VsPurchl();
vsPurchl.SetVsPurchl(item_com_code[0], product_code[0], item_description[0], item_quantity[0],
item_uom[0], unit_cost[0], vat_tax_amt[0], vat_tax_rate[0], discount_treatmentL[0], discount_amtL
[0]);
vsPurchl.SetVsPurchl(item_com_code[1], product_code[1], item_description[1], item_quantity[1],
item_uom[1], unit_cost[1], vat_tax_amt[1], vat_tax_rate[1], discount_treatmentL[1], discount_amtL
[1]);
VsCorpais vsCorpais = new VsCorpais();
vsCorpais.SetOrderId(order_id);
vsCorpais.SetTxnNumber(txn_number);
vsCorpais.SetVsPurch(vsPurcha, vsPurchl);
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(vsCorpais);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Page 179 of 476 November 2018
![](asset-b4.png)
7 Level 2/3 Transactions
Sample VS Corpais
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
7.3 Level 2/3 MasterCard Transactions
l7.3.1 Level 2/3 Transaction Types for MasterCard
l7.3.2 Level 2/3 Transaction Flow for MasterCard
l7.3.3 MC Completion
l7.3.4 MC Force Post
l7.3.5 MC Purchase Correction
l7.3.6 MC Refund
l7.3.7 MC Independent Refund
l7.3.8 MC Corpais - Corporate Card Common Data with Line Item Details
7.3.1 Level 2/3 Transaction Types for MasterCard
This transaction set includes a suite of corporate card financial transactions as well as a transaction that
allows for the passing of Level 2/3 data. Please ensure MC Level 2/3 processing support is enabled on
your merchant account. Batch Close, Open Totals and Pre-authorization are identical to the transactions
outlined in the section Basic Transaction Set (page 12).
When the Preauth response contains CorporateCard equal to true then you can submit the MC trans-
actions.
If CorporateCard is false then the card does not support Level 2/3 data and non Level 2/3 transaction are
to be used. If the card is not a corporate card, please refer to section 4 for the appropriate non-corporate
card transactions.
NOTE: This transaction set is intended for transactions where Corporate Card is true and
Level 2/3 data will be submitted. If the credit card is found to be a corporate card but you do
not wish to send any Level 2/3 data then you may submit MC transactions using the trans-
action set outlined in Basic Transaction Set (page 12).
November 2018 Page 180 of 476
![](asset-b5.png)
Moneris Gateway API- Integration Guide
Pre-auth – (authorization/pre-authorization)
The pre-auth verifies and locks funds on the customer’s credit card. The funds are locked for a
specified amount of time, based on the card issuer. To retrieve the funds from a pre-auth so
that they may be settled in the merchant account a capture must be performed. Level 2/3
data submission is not supported as part of a pre-auth as a pre-auth is not settled. When Cor-
porateCard is returned true then Level 2/3 data may be submitted.
MC Completion – (Capture/Preauth Completion)
Once a Pre-authorization is obtained the funds that are locked need to be retrieved from the
customer’s credit card. The capture retrieves the locked funds and readies them for set-
tlement in to the merchant account. Prior to performing an MCCompletion a Pre-auth must
be performed.
MC Force Post – (Force Capture/Preauth Completion)
This transaction is an alternative to MC Completion to obtain the funds locked on Preauth
obtained from IVR or equivalent terminal. The MC ForcePost requires that the original Pre-
authorization’s auth code is provided and it retrieves the locked funds and readies them for
settlement in to the merchant account.
MC Purchase Correction – (Void, Correction)
MC Completions can be voided the same day* that they occur. A void must be for the full
amount of the transaction and will remove any record of it from the cardholder statement. *
An MC Purchase Correction can be performed against a transaction as long as the batch that
contains the original transaction remains open. When using the automated closing feature
batch close occurs daily between 10 – 11 pm EST.
MC Refund – (Credit)
A MCRefund can be performed against an MC Completion or MC Force Post to refund an
amount less than or equal to the amount of the original transaction.
MC Independent Refund – (Credit)
A MCIndpendent Refund can be performed against an completion to refund any part, or all
of the transaction. Independent refund is used when the originating transaction was not per-
formed through Moneris Gateway. Please note, the MCIndependent Refund transaction
may or may not be supported on your account. If you receive a transaction not allowed error
when attempting an MCIndependent Refund, it may mean the transaction is not supported
on your account. If you wish to have the MCIndependent Refund transaction type tem-
porarily enabled (or re-enabled), please contact the Service Centre at 1-866-319-7450.
MC Corpais Common Line Item – (Level 2/3 Data)
MC Corpais Common Line Item will contain the entire required and optional data field for
Level 2/3 data. MCCorpais Common Line Item data can be sent when the card has been iden-
tified in the transaction request as being a corporate card. This transaction supports multiple
data types and combinations:
lPurchasing Card Data:
lCorporate card common data with Line Item Details
Page 181 of 476 November 2018
![](asset-b6.png)
7 Level 2/3 Transactions
7.3.2 Level 2/3 Transaction Flow for MasterCard
Pre-authorization/Completion Transaction Flow
Purchase CorrectionTransactionFlow
7.3.3 MC Completion
The MC Completion transaction is used to secure the funds locked by a pre-authorization transaction.
When sending a capture request you will need two pieces of information from the original pre-author-
ization– theOrder IDand the transaction number from the returned response.
Once you have completed this transaction successfully, to submit the complete sup-
plemental level 2/3 data, please proceed to MCCorpais.
MC Completion transaction object definition
McCompletion mcCompletion = new McCompletion();
HttpsPostRequest object for MC Completion transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(mcCompletion);
MC Completion transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
mcCompletion.SetOrderId
(order_id);
Completion amount String 9-character decimal mcCompletion.SetCompAmount
(comp_amount);
Transaction number String 255-character alpha-
numeric
mcCompletion.SetTxnNumber
(txn_number);
Table 1 MC Completion transaction object mandatory values
November 2018 Page 182 of 476
![](asset-b7.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set Method
Merchant reference
number
String 19-character alpha-
numeric
mcCompletion
.SetMerchantRefNo(merchant_
ref_no);
E-commerce indicator String 1-character alpha-
numeric
mcCompletion.SetCryptType
(crypt);
SampleMC Completion
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestMcCompletion
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id="Test20170112020548";
string comp_amount="5.00";
string txn_number="660117311792017012140548199-0_11";
string crypt="7";
string merchant_ref_no = "319038";
McCompletion mcCompletion = new McCompletion();
mcCompletion.SetOrderId(order_id);
mcCompletion.SetCompAmount(comp_amount);
mcCompletion.SetTxnNumber(txn_number);
mcCompletion.SetCryptType(crypt);
mcCompletion.SetMerchantRefNo(merchant_ref_no);
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(mcCompletion);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Page 183 of 476 November 2018
![](asset-b8.png)
7 Level 2/3 Transactions
SampleMC Completion
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
7.3.4 MC Force Post
MC Force Post transaction is used to secure the funds locked by a pre-authorization transaction per-
formed over IVR or equivalent terminal`. When sending a force post request, you will need order_id,
amount, pan (card number), expiry date, crypt type and the authorization code received in the pre-
authorization response.
MC Force Post transaction object definition
McForcePost mcforcepost= new McForcePost();
HttpsPostRequest object for MC Force Post transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(mcforcepost);
MC Force Post transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
mcforcepost.SetOrderId
(order_id);
Amount String 9-character decimal mcforcepost.SetAmount
(amount);
Credit card number String 20-character alpha- mcforcepost.SetPan(pan);
Table 1 MC Force Post transaction object mandatory values
November 2018 Page 184 of 476
![](asset-b9.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set Method
numeric
Expiry date String 4-character alpha-
numeric
(YYMMformat)
mcforcepost.SetExpdate
(expiry_date);
Authorizationcode String 8-character alpha-
numeric
mcforcepost.SetAuthCode
(auth_code);
E-commerce indicator String 1-character alpha-
numeric
mcforcepost.SetCryptType
(crypt);
Merchant reference
number
String 19-character alpha-
numeric
mcforcepost.SetMerchantRefNo
(merchant_ref_no);
Value Type Limits Set Method
Customer ID String 50-character alpha-
numeric
mcforcepost.SetCustId(cust_
id);
Table 2 MC Force Post transaction object optional values
SampleMC Force Post
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestMcForcePost
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "CUST13343";
string amount = "5.00";
string pan = "5454545442424242";
string expiry_date = "1912"; //YYMM
string auth_code = "123456";
string crypt = "7";
string merchant_ref_no = "319038";
McForcePost mcforcepost = new McForcePost();
mcforcepost.SetOrderId(order_id);
Page 185 of 476 November 2018
![](asset-ba.png)
7 Level 2/3 Transactions
SampleMC Force Post
mcforcepost.SetCustId(cust_id);
mcforcepost.SetAmount(amount);
mcforcepost.SetPan(pan);
mcforcepost.SetExpDate(expiry_date);
mcforcepost.SetAuthCode(auth_code);
mcforcepost.SetCryptType(crypt);
mcforcepost.SetMerchantRefNo(merchant_ref_no);
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(mcforcepost);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
7.3.5 MC Purchase Correction
The MC Purchase Correction (void) transaction is used to cancel a transaction that was performed in the
current batch. No amount is required because a void is always for 100% of the original transaction. The
only transaction that can be voided is completion. To send a void, the OrderID and Transaction Number
from the MC Completion or MC Force Post are required.
MC Purchase Correction transaction object definition
McPurchaseCorrection mcpurchasecorrection = new McPurchaseCorrection();
November 2018 Page 186 of 476
![](asset-bb.png)
Moneris Gateway API- Integration Guide
HttpsPostRequest object for MC Purchase Correction transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(mcpurchasecorrection);
MC Purchase Correction transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
mcpurchasecorrection
.SetOrderId(order_id);
Transaction number String 255-character alpha-
numeric
mcpurchasecorrection
.SetTxnNumber(txn_number);
E-commerce indicator String 1-character alpha-
numeric
mcpurchasecorrection
.SetCryptType(crypt);
Table 1 MC Purchase Correction transaction object mandatory values
Sample MC Purchase Correction
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestMcPurchaseCorrection
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id="Test20170112020548";
string txn_number="660117311792017012140548199-0_11";
string crypt="7";
McPurchaseCorrection mcpurchasecorrection = new McPurchaseCorrection();
mcpurchasecorrection.SetOrderId(order_id);
mcpurchasecorrection.SetTxnNumber(txn_number);
mcpurchasecorrection.SetCryptType(crypt);
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(mcpurchasecorrection);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
Page 187 of 476 November 2018
![](asset-bc.png)
7 Level 2/3 Transactions
Sample MC Purchase Correction
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
7.3.6 MC Refund
The MC Refund will credit a specified amount to the cardholder’s credit card. A refund can be sent up to
the full value of the original capture. To send a refund you will require the Order ID and Transaction Num-
ber from the original MC Completion or MC Force Post.
MC Refund transaction object definition
McRefund mcRefund = new McRefund();
HttpsPostRequest object for MC Refund transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(mcRefund);
November 2018 Page 188 of 476
![](asset-bd.png)
Moneris Gateway API- Integration Guide
MC Refund transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
mcRefund.SetOrderId(order_
id);
Amount String 9-character decimal mcRefund.SetAmount(amount);
Transaction number String 255-character alpha-
numeric
mcRefund.SetTxnNumber(txn_
number);
E-commerce indicator String 1-character alpha-
numeric
mcRefund.SetCryptType
(crypt);
Merchant reference
number
String 19-character alpha-
numeric
mcRefund.SetMerchantRefNo
(merchant_ref_no);
Table 1 MC Refund transaction object mandatory values
Sample MC Refund
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestMcRefund
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id="Test20170112020548";
string amount="5.00";
string txn_number="660117311792017012140548199-0_11";
string crypt="7";
string merchant_ref_no = "319038";
McRefund mcRefund = new McRefund();
mcRefund.SetOrderId(order_id);
mcRefund.SetAmount(amount);
mcRefund.SetTxnNumber(txn_number);
mcRefund.SetCryptType(crypt);
mcRefund.SetMerchantRefNo(merchant_ref_no);
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);
Page 189 of 476 November 2018
![](asset-be.png)
7 Level 2/3 Transactions
Sample MC Refund
mpgReq.SetTransaction(mcRefund);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
7.3.7 MC Independent Refund
MC Independent Refund is used when the originating transaction was not performed through Moneris
Gateway and does not require an existing order to be logged in the Moneris Gateway; however, the
credit card number and the expiry date will need to be passed. The transaction format is almost identical
to a purchase or a pre-authorization.
NOTE: Independent refund transactions are not supported on all accounts. If you receive a
transaction not allowed error when attempting an independent refund transaction, it may
mean the feature is not supported on your account. To have Independent Refund trans-
action functionality temporarily enabled (or re-enabled), please contact the Mon-
erisCustomer Service Centre at 1-866-319-7450.
Once you have completed this transaction successfully, to submit the complete sup-
plemental level 2/3 data, please proceed to MCCorpais.
November 2018 Page 190 of 476
![](asset-bf.png)
Moneris Gateway API- Integration Guide
MC Independent Refund transaction object definition
McIndependentRefund mcindrefund = new McIndependentRefund();
HttpsPostRequest object for MC Independent Refund transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(mcindrefund);
MC Independent Refund transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
mcindrefund.SetOrderId
(order_id);
Amount String 9-character decimal mcindrefund.SetAmount
(amount);
E-commerce indicator String 1-character alpha-
numeric
mcindrefund.SetCryptType
(crypt);
Credit card number String 20-character numeric mcindrefund.SetPan(pan);
Expiry date String 4-character numeric
(YYMMformat)
mcindrefund.SetExpdate
(expiry_date);
Merchant reference
number
String 19-character alpha-
numeric
mcindrefund.SetMerchantRefNo
(merchant_ref_no);
Table 1 MC Independent Refund transaction object mandatory values
Value Type Limits Set Method
Customer ID String 50-character alpha-
numeric
mcindrefund.SetCustId(cust_
id);
Table 2 MC Independent Refund transaction object optional values
Sample MC Independent Refund
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
Page 191 of 476 November 2018
![](asset-c0.png)
7 Level 2/3 Transactions
Sample MC Independent Refund
public class TestMcIndependentRefund
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "CUST13343";
string amount = "5.00";
string pan = "5454545442424242";
string expiry_date = "1912"; //YYMM
string crypt = "7";
string merchant_ref_no = "319038";
McIndependentRefund mcindrefund = new McIndependentRefund();
mcindrefund.SetOrderId(order_id);
mcindrefund.SetCustId(cust_id);
mcindrefund.SetAmount(amount);
mcindrefund.SetPan(pan);
mcindrefund.SetExpDate(expiry_date);
mcindrefund.SetCryptType(crypt);
mcindrefund.SetMerchantRefNo(merchant_ref_no);
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(mcindrefund);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
November 2018 Page 192 of 476
![](asset-c1.png)
Moneris Gateway API- Integration Guide
7.3.8 MC Corpais - Corporate Card Common Data with Line Item Details
This transaction example includes the following elements for Level 2 and 3 purchasing card corporate
card data processing:
lCorporate Card Common Data (MC Corpac)
lonly 1 set of MC Corpac fields can be submitted
lthis data set includes data elements that apply to the overall order, e.g., the total overall
taxes
lLine Item Details (MC Corpal)
l1-998 counts of MC Corpal line items can be submitted
lThis data set includes the details about each individual item or service purchased
The MCCorpais request must be preceded by a financial transaction (MC Completion, MC Force Post,
MC Refund, MC Independent Refund) and the Corporate Card flag must be set to “true” in the Preau-
thorization response. The MC Corpais request will need to contain the OrderID of the financial trans-
action as well as the TransactionNumber.
In addition, MCCorpais has a tax array object that can be sent via theTax fields in MCCorpac and
MCCorpal. For more about the tax array object, see 7.3.8.3 Tax Array Object - MC Corpais.
For descriptions of the Level 2/3 fields, please see Definition of Request Fields for Level 2/3 - MasterCard
(page 416).
MC Corpais transaction object definition
McCorpais mcCorpais = new McCorpais();
HttpsPostRequest object for MC Corpais transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(mcCorpais);
MC Corpais transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
mcCorpais.SetOrderId(order_
id);
Transaction number String 255-character alpha-
numeric
mcCorpais.SetTxnNumber(txn_
number);
MCCorpac Object n/a mcCorpac.SetMcCorpac
Table 1 MC Corpais transaction object mandatory values
Page 193 of 476 November 2018
![](asset-c2.png)
7 Level 2/3 Transactions
Value Type Limits Set Method
(mcCorpac);
MCCorpal Object n/a mcCorpais.SetMcCorpal
(mcCorpal);
*Y = Required, N= Optional, C = Conditional
7.3.8.1 MC Corpac - Corporate Card Common Data
Re-
q* Value Limits Set Method Description
N Austin-
Tetra
Number
15-char-
acter alpha-
numeric
mcCorpac
.SetAustinTetraNumber
(austin_tetra_number);
The Austin-Tetra Number
assigned to the card
acceptor
N NAICS
Code
15-char-
acter alpha-
numeric
mcCorpac.SetNaicsCode
(naics_code);
North American Industry
Classification System
(NAICS) code assigned to
the card acceptor
N Customer
Code
25-char-
acter alpha-
numeric
mcCorpac.SetCustomerCode1
(customer_code1_c);
A control number, such as
purchase order number,
project number, depart-
ment allocation number or
name that the purchaser
supplied the merchant
Left-justified; may be
spaces
N Unique
Invoice
Number
17-char-
acter alpha-
numeric
mcCorpac
.SetUniqueInvoiceNumber
(unique_invoice_number_c);
Unique number associated
with the individual trans-
action provided by the mer-
chant
N Com-
modity
Code
15-char-
acter alpha-
numeric
mcCorpac.SetCommodityCode
(commodity_code);
Code assigned by the mer-
chant that best categorizes
the item(s) being pur-
chased
N Order
Date
6-character
numeric
mcCorpac.SetOrderDate
(order_date_c);
The date the item was
ordered
Table 1 Corporate Card Common Data - Level 2 Request Fields - MCCorpac
November 2018 Page 194 of 476
![](asset-c3.png)
Moneris Gateway API- Integration Guide
Re-
q* Value Limits Set Method Description
YYMMDD
format NOTE: If present, must con-
tain a valid date
N Cor-
poration
VAT Num-
ber
20-char-
acter alpha-
numeric
mcCorpac
.SetCorporationVatNumber
(corporation_vat_number_c);
Contains a corporation’s
value added tax (VAT) num-
ber
N Customer
VAT Num-
ber
20-char-
acter alpha-
numeric
mcCorpac
.SetCustomerVatNumber
(customer_vat_number_c);
Contains the VAT number
for the customer / card-
holder used to identify the
customer when purchasing
goods and services from
the merchant
N Freight
Amount
12-char-
acter
decimal
mcCorpac.SetFreightAmount1
(freight_amount_c);
The freight on the total pur-
chase
Must have 2 decimals
Minimum = 0.00 Maximum
= 999999.99
N Duty
Amount
12-char-
acter
decimal
mcCorpac.SetDutyAmount1
(duty_amount_c);
The duty on the total pur-
chase
Must have 2 decimals
Minimum = 0.00
Maximum = 999999.99
N Destin-
ation
State /
Province
Code
3-character
alpha-
numeric
mcCorpac
.SetDestinationProvinceCode
(destination_province_
code);
State or Province of the
country where the goods
will be delivered
Left justified with trailing
spaces
EXAMPLE: ONT = Ontario
N Destin-
ation
Country
Code
3-character
alpha-
numeric
mcCorpac
.SetDestinationCountryCode
(destination_country_code);
The country code where
goods will be delivered
Left justified with trailing
spaces
Page 195 of 476 November 2018
![](asset-c4.png)
7 Level 2/3 Transactions
Re-
q* Value Limits Set Method Description
ISO 3166-1
alpha-3
format
ISO 3166-1 alpha-3 format
EXAMPLE: CAN=Canada
N Ship From
Postal
Code
10-char-
acter alpha-
numeric
ANANAN
format
mcCorpac.SetShipFromPosCode
(ship_from_pos_code);
The postal code or zip code
from which items were
shipped
Full alpha postal code -
Valid ANA<space>NAN
format
N Destin-
ation
Postal
Code
10-char-
acter alpha-
numeric
mcCorpac.SetShipToPosCode
(ship_to_pos_code_c);
The postal code or zip code
where goods will be
delivered
Full alpha postal code -
Valid ANA<space>NAN
format if shipping to an
address within Canada
N Author-
ized
Contact
Name
36-char-
acter alpha-
numeric
mcCorpac
.SetAuthorizedContactName
(authorized_contact_name_
c);
Name of an individual or
company contacted for
company authorized pur-
chases
N Author-
ized
Contact
Phone
17-char-
acter alpha-
numeric
mcCorpac
.SetAuthorizedContactPhone
(authorized_contact_phone);
Phone number of an indi-
vidual or company con-
tacted for company
authorized purchases
N Additional
Card
Acceptor
Data
40-char-
acter alpha-
numeric
mcCorpac
.SetAdditionalCardAcceptorD
ata(additional_card_
acceptor_data);
Information pertaining to
the card acceptor
N Card
Acceptor
Type
8-character
alpha-
numeric
mcCorpac
.SetCardAcceptorType(card_
acceptor_type);
Various classifications of
business ownership char-
acteristics
This field takes 8 char-
acters. Each character rep-
resents a different
component, as follows:
November 2018 Page 196 of 476
![](asset-c5.png)
Moneris Gateway API- Integration Guide
Re-
q* Value Limits Set Method Description
1st character represents
‘Business Type’ and con-
tains a code to identify the
specific classification or
type of business:
1. Corporation
2. Not known
3. Individual/Sole Pro-
prietorship
4. Partnership
5. Asso-
ciation/Estate/Trust
6. Tax Exempt Organ-
izations (501C)
7. International Organ-
ization
8. Limited Liability Com-
pany (LLC)
9. Government Agency
2nd character represents
'Business Owner Type'.
Contains a code to identify
specific characteristics
about the business owner.
1 - No application
classification
2 - Female business
owner
3 - Physically han-
dicapped female
business owner
4 - Physically han-
dicapped male busi-
ness owner
0 - Unknown
3rd character represents
'Business Certification
Type'. Contains a code to
identify specific char-
acteristics about the busi-
Page 197 of 476 November 2018
![](asset-c6.png)
7 Level 2/3 Transactions
Re-
q* Value Limits Set Method Description
ness certification type,
such as small business, dis-
advantaged, or other cer-
tification type:
1 - Not certified
2 - Small Business
Administration (SBA)
certification small
business
3 - SBA certification
as small dis-
advantaged busi-
ness
4 - Other gov-
ernment or agency-
recognized cer-
tification (such as
Minority Supplier
Development Coun-
cil)
5 - Self-certified small
business
6 - SBA certification
as small and other
government or
agency-recognized
certification
7 - SBA certification
as small dis-
advantaged busi-
ness and other
government or
agency-recognized
certification
8 - Other gov-
ernment or agency-
recognized cer-
tification and self-cer-
tified small business
A - SBA certification
November 2018 Page 198 of 476
![](asset-c7.png)
Moneris Gateway API- Integration Guide
Re-
q* Value Limits Set Method Description
as 8(a)
B - Self-certified
small disadvantaged
business (SDB)
C - SBA certification
as HUBZone
0 - Unknown
4th character represents
'Business Racial/Ethnic
Type'. Contains a code
identifying the racial or eth-
nic type of the majority
owner of the business.
1 - African American
2 - Asian Pacific
American
3 - Subcontinent
Asian American
4 - Hispanic Amer-
ican
5 - Native American
Indian
6 - Native Hawaiian
7 - Native Alaskan
8 - Caucasian
9 - Other
0 - Unknown
5th character represents
'Business Type Provided
Code'
Y - Business type is
provided.
N - Business type
was not provided.
R - Card acceptor
refused to provide
business type
6th character represents
'Business Owner Type
Page 199 of 476 November 2018
![](asset-c8.png)
7 Level 2/3 Transactions
Re-
q* Value Limits Set Method Description
Provided Code'
Y - Business owner
type is provided.
N - Business owner
type was not
provided.
R - Card acceptor
refused to provide
business type
7th character represents
'Business Certification Type
Provided Code'
Y - Business cer-
tification type is
provided.
N - Business cer-
tification type was
not provided.
R - Card acceptor
refused to provide
business type
8th character represents
'Business Racial/Ethnic
Type’
Y - Business
racial/ethnic type is
provided.
N - Business
racial/ethnic type
was not provided.
R - Card acceptor
refused to provide
business racial/eth-
nic type
N Card
Acceptor
20-char-
acter alpha-
mcCorpac
.SetCardAcceptorTaxTd(card_
US federal tax ID number or
value-added tax (VAT) ID
November 2018 Page 200 of 476
![](asset-c9.png)
Moneris Gateway API- Integration Guide
Re-
q* Value Limits Set Method Description
Tax ID numeric acceptor_tax_id_c);
N Card
Acceptor
Reference
Number
25-char-
acter alpha-
numeric
mcCorpac
.SetCardAcceptorReferenceNu
mber(card_acceptor_
reference_number);
Code that facilitates card
acceptor/corporation com-
munication and record
keeping
N Card
Acceptor
VAT Num-
ber
20-char-
acter alpha-
numeric
mcCorpac
.SetCardAcceptorVatNumber
(card_acceptor_vat_number_
c);
Value added tax (VAT) num-
ber for the card acceptor
location
Used to identify the card
acceptor when collecting
and reporting taxes
C Tax Up to 6
arrays
mcCorpac.SetTax(tax_c); Can have up to 6 arrays
containing different tax
details
NOTE: If you use this vari-
able, you must fill in all the
fields of tax array mentioned
below.
7.3.8.2 MC Corpal - Line Item Details
MCCorpal Object - Line Item Details
mcCorpal.SetMcCorpal(customer_code1_l[0], line_item_date_l[0], ship_date_l[0],
order_date1_l[0], medical_services_ship_to_health_industry_number_l[0], con-
tract_number_l[0],medical_services_adjustment_l[0], medical_services_product_
number_qualifier_l[0], product_code1_l[0], item_description_l[0], item_quant-
ity_l[0], unit_cost_l[0], item_unit_measure_l[0], ext_item_amount_l[0], dis-
count_amount_l[0], commodity_code_l[0], type_of_supply_l[0], vat_ref_num_l[0],
tax_l[0]);
Req* Value Limits Variable Description
N Customer Code 25-character alpha-
numeric
customer_code1_l A control number,
such as purchase
order number, pro-
ject number,
department alloc-
Table 1 Line Item Details - Level 3 Request Fields - MC Corpal
Page 201 of 476 November 2018
![](asset-ca.png)
7 Level 2/3 Transactions
Req* Value Limits Variable Description
ation number or
name that the pur-
chaser supplied
the merchant
N Line ItemDate 6-character numeric
YYMMDDformat
line_item_date_l The purchase date
of the line item ref-
erenced in the
associated Cor-
porate Card Line
Item Detail
Fixed length 6
Numeric, in
YYMMDD format
N Ship Date 6-character numeric
YYMMDDformat
ship_date_l The date the mer-
chandise was
shipped to the des-
tination
Fixed length 6
Numeric, in
YYMMDD format
N Order Date 6-character numeric
YYMMDDformat
order_date1_ll The date the item
was ordered
Fixed length 6-char-
acter numeric, in
YYMMDD format
Y Product Code 12-character alpha-
numeric
product_code1_ll Line item Product
Code
Contains the non-
fuel related
product code of
the individual item
purchased
Y Item Description 35-character alpha-
numeric
item_description_ll Line Item descrip-
tion
Contains the
November 2018 Page 202 of 476
![](asset-cb.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Variable Description
description of the
individual item pur-
chased
Y Item Quantity 12-character alpha-
numeric
item_quantity_ll Quantity of line
item
Up to 5 decimal
places supported
Minimum amount
is 0.0 and max-
imum is
9999999.99999
Y Unit Cost 12-character decimal unit_cost_ll Line item cost per
unit.
Must contain a
minimum of 2
decimal places, up
to 5 decimal places
supported.
Minimum amount
is 0.00001 and max-
imum is
999999.99999
Y Item Unit Meas-
ure
12-character alpha-
numeric
item_unit_measure_
ll
The line item unit
of measurement
code
ANSI X-12 EDI
Allowable Units of
Measure and
Codes
Y Extended Item
Amount
9-character decimal ext_item_amount_ll Contains the indi-
vidual item
amount that is nor-
mally calculated as
price multiplied by
quantity
Must contain 2
decimal places
Minimum amount
Page 203 of 476 November 2018
![](asset-cc.png)
7 Level 2/3 Transactions
Req* Value Limits Variable Description
is 0.00 and max-
imum is 999999.99
N Discount
Amount
9-character decimal discount_amount_ll Contains the item
discount amount
Must contain 2
decimal places
Minimum amount
is 0.00 and max-
imum is 999999.99
N Commodity
Code
15-character alpha-
numeric
commodity_code_ll Code assigned to
the merchant that
best categorizes
the item(s) being
purchased
C Tax Up to 6 arrays tax_l Can have up to 6
arrays containing
different tax details
–see Tax Array
Request Fields
table below for
each field descrip-
tion
NOTE: If you use
this variable, you
must fill in all the
fields of tax array
mentioned below.
7.3.8.3 Tax Array Object - MC Corpais
The tax array object is used when you use the Tax field of both MC Corpac and MC Corpal. If you use the
tax array object, all of the array fields must be sent.
Setting the tax array differs slightly between the two objects.
Setting tax array for MCCorpac
string[] tax_amount_c = { "1.19", "1.29"};
string[] tax_rate_c = { "6.0", "7.0"};
string[] tax_type_c = { "GST", "PST"};
November 2018 Page 204 of 476
![](asset-cd.png)
Moneris Gateway API- Integration Guide
string[] tax_id_c = { "gst1298", "pst1298"};
string[] tax_included_in_sales_c = { "Y", "N"};
McTax tax_c = new McTax();
tax_c.SetTax(tax_amount_c[0], tax_rate_c[0], tax_type_c[0], tax_id_c[0], tax_
included_in_sales_c[0]);
Setting tax array for MCCorpal
//Tax Details for Items
string[] tax_amount_l = {"0.52", "1.48"};
string[] tax_rate_l = {"13.0", "13.0"};
string[] tax_type_l = {"HST", "HST"};
string[] tax_id_l = {"hst1298", "hst1298"};
string[] tax_included_in_sales_l = {"Y", "Y"};
McTax[] tax_l = new McTax[2];
tax_l[1].SetTax(tax_amount_l[1], tax_rate_l[1], tax_type_l[1], tax_id_l[1],
tax_included_in_sales_l[1]);
Req* Value Limits Variable Description
Y Tax Amount 12-character decimal tax_amount_c/tax_
amount_l
Contains detail tax
amount for pur-
chase of goods or
services
Must be 2 decimal
places. Minimum
amount is 0.00 and
maximum is
999999.99
Y Tax Rate 5-character decimal tax_rate_c/tax_
rate_l
Contains the
detailed tax rate
applied in rela-
tionship to a spe-
cific tax amount
EXAMPLE: 5% GST
should be ‘5.0’ or
or 9.975% QST
should be ‘9.975’
Table 1 MC Corpais Tax Array Request Fields
Page 205 of 476 November 2018
![](asset-ce.png)
7 Level 2/3 Transactions
Req* Value Limits Variable Description
May contain up to
3 decimals, min-
imum 0.001, max-
imum up to 9999.9
Y Tax Type 4-character alpha-
numeric
tax_type_c/tax_
type_l
Contains tax type,
such as
GST,QST,PST,HST
Y Tax ID 20-character alpha-
numeric
tax_id_c/tax_id_l Provides an iden-
tification number
used by the card
acceptor with the
tax authority in
relationship to a
specific tax
amount, such as
GST/HST number
Y Tax included in
sales indicator
1-character alpha-
numeric
tax_included_in_
sales_c/tax_
included_in_sales_l
This is the indicator
used to reflect addi-
tional tax capture
and reporting
Valid values are:
Y = Tax included in
total purchase amount
N = Tax not included in
total purchase amount
7.3.8.4 Sample Code for MC Corpais
Sample MC Corpais - Corporate Card CommonData with Line Item Details
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestMcCorpaisCommonLineItem
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
November 2018 Page 206 of 476
![](asset-cf.png)
Moneris Gateway API- Integration Guide
Sample MC Corpais - Corporate Card CommonData with Line Item Details
string order_id="ord-200916-13:29:27";
string txn_number="66011731632016264132927986-0_11";
string customer_code1_c ="CustomerCode123";
string card_acceptor_tax_id_c ="UrTaxId";//Merchant tax id which is mandatory
string corporation_vat_number_c ="cvn123";
string freight_amount_c ="1.23";
string duty_amount_c ="2.34";
string ship_to_pos_code_c ="M1R 1W5";
string order_date_c ="141211";
string customer_vat_number_c ="customervn231";
string unique_invoice_number_c ="uin567";
string authorized_contact_name_c ="John Walker";
//Tax Details
string[] tax_amount_c = { "1.19", "1.29"};
string[] tax_rate_c = { "6.0", "7.0"};
string[] tax_type_c = { "GST", "PST"};
string[] tax_id_c = { "gst1298", "pst1298"};
string[] tax_included_in_sales_c = { "Y", "N"};
//Item Details
string[] customer_code1_l = {"customer code", "customer code2"};
string[] line_item_date_l = {"150114", "150114"};
string[] ship_date_l = {"150120", "150122"};
string[] order_date1_l = {"150114", "150114"};
string[] medical_services_ship_to_health_industry_number_l = {null, null};
string[] contract_number_l = {null, null};
string[] medical_services_adjustment_l = {null, null};
string[] medical_services_product_number_qualifier_l = {null, null};
string[] product_code1_l = {"pc11", "pc12"};
string[] item_description_l = {"Good item", "Better item"};
string[] item_quantity_l = {"4", "5"};
string[] unit_cost_l ={"1.25", "10.00"};
string[] item_unit_measure_l = {"EA", "EA"};
string[] ext_item_amount_l ={"5.00", "50.00"};
string[] discount_amount_l ={"1.00", "50.00"};
string[] commodity_code_l ={"cCode11", "cCode12"};
string[] type_of_supply_l = {null, null};
string[] vat_ref_num_l = {null, null};
//Tax Details for Items
string[] tax_amount_l = {"0.52", "1.48"};
string[] tax_rate_l = {"13.0", "13.0"};
string[] tax_type_l = {"HST", "HST"};
string[] tax_id_l = {"hst1298", "hst1298"};
string[] tax_included_in_sales_l = {"Y", "Y"};
//Create and set Tax for McCorpac
McTax tax_c = new McTax();
tax_c.SetTax(tax_amount_c[0], tax_rate_c[0], tax_type_c[0], tax_id_c[0], tax_included_in_sales_c
[0]);
tax_c.SetTax(tax_amount_c[1], tax_rate_c[1], tax_type_c[1], tax_id_c[1], tax_included_in_sales_c
[1]);
//Create and set McCorpac for common data - only set values that you know
McCorpac mcCorpac = new McCorpac();
mcCorpac.SetCustomerCode1(customer_code1_c);
mcCorpac.SetCardAcceptorTaxTd(card_acceptor_tax_id_c);
mcCorpac.SetCorporationVatNumber(corporation_vat_number_c);
mcCorpac.SetFreightAmount1(freight_amount_c);
mcCorpac.SetDutyAmount1(duty_amount_c);
mcCorpac.SetShipToPosCode(ship_to_pos_code_c);
mcCorpac.SetOrderDate(order_date_c);
Page 207 of 476 November 2018
![](asset-d0.png)
7 Level 2/3 Transactions
Sample MC Corpais - Corporate Card CommonData with Line Item Details
mcCorpac.SetCustomerVatNumber(customer_vat_number_c);
mcCorpac.SetUniqueInvoiceNumber(unique_invoice_number_c);
mcCorpac.SetAuthorizedContactName(authorized_contact_name_c);
mcCorpac.SetTax(tax_c);
//Create and set Tax for McCorpal
McTax[] tax_l = new McTax[2];
tax_l[0] = new McTax();
tax_l[0].SetTax(tax_amount_l[0], tax_rate_l[0], tax_type_l[0], tax_id_l[0], tax_included_in_sales_
l[0]);
tax_l[1] = new McTax();
tax_l[1].SetTax(tax_amount_l[1], tax_rate_l[1], tax_type_l[1], tax_id_l[1], tax_included_in_sales_
l[1]);
//Create and set McCorpal for each item
McCorpal mcCorpal = new McCorpal();
mcCorpal.SetMcCorpal(customer_code1_l[0], line_item_date_l[0], ship_date_l[0], order_date1_l[0],
medical_services_ship_to_health_industry_number_l[0], contract_number_l[0],
medical_services_adjustment_l[0], medical_services_product_number_qualifier_l[0], product_code1_l
[0], item_description_l[0], item_quantity_l[0],
unit_cost_l[0], item_unit_measure_l[0], ext_item_amount_l[0], discount_amount_l[0], commodity_
code_l[0], type_of_supply_l[0], vat_ref_num_l[0], tax_l[0]);
mcCorpal.SetMcCorpal(customer_code1_l[1], line_item_date_l[1], ship_date_l[1], order_date1_l[1],
medical_services_ship_to_health_industry_number_l[1], contract_number_l[1],
medical_services_adjustment_l[1], medical_services_product_number_qualifier_l[1], product_code1_l
[1], item_description_l[1], item_quantity_l[1],
unit_cost_l[1], item_unit_measure_l[1], ext_item_amount_l[1], discount_amount_l[1], commodity_
code_l[1], type_of_supply_l[1], vat_ref_num_l[1], tax_l[1]);
McCorpais mcCorpais = new McCorpais();
mcCorpais.SetOrderId(order_id);
mcCorpais.SetTxnNumber(txn_number);
mcCorpais.SetMcCorpac(mcCorpac);
mcCorpais.SetMcCorpal(mcCorpal);
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(mcCorpais);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
November 2018 Page 208 of 476
![](asset-d1.png)
Moneris Gateway API- Integration Guide
Sample MC Corpais - Corporate Card CommonData with Line Item Details
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
7.4 Level 2/3 American Express Transactions
l7.4.1 Level 2/3 Transaction Types for Amex
l7.4.2 Level 2/3 Transaction Flow for Amex
l7.4.4 AX Completion
l7.4.5 AX Force Post
l7.4.6 AX Purchase Correction
l7.4.7 AX Refund
l7.4.8 AX Independent Refund
7.4.1 Level 2/3 Transaction Types for Amex
This transaction set includes a suite of corporate card financial transactions as well as a transaction that
allows for the passing of Level 2/3 data. Please ensure American Express Level 2/3 processing support is
enabled on your merchant account. Batch Close, Open Totals and Pre-authorization are identical to the
transactions outlined in the section Basic Transaction Set (page 12).
lWhen the Pre-authorization response contains CorporateCard equal to true then you can submit
the AX transactions.
lIf CorporateCard is false then the card does not support Level 2/3 data and non Level 2/3 trans-
action are to be used. If the card is not a corporate card, please refer to 2 Basic Transaction Set for
the appropriate non-corporate card transactions.
NOTE: This transaction set is intended for transactions where Corporate Card is true and
Level 2/3 data will be submitted. If the credit card is found to be a corporate card but you do
not wish to send any Level 2/3 data then you may submit AX transactions using the trans-
action set outlined in the section Basic Transaction Set (page 12).
Page 209 of 476 November 2018
![](asset-d2.png)
7 Level 2/3 Transactions
Pre-authorization – (authorization)
The preauth verifies and locks funds on the customer’s credit card. The funds are locked for a
specified amount of time, based on the card issuer. To retrieve the funds from a pre-auth so
that they may be settled in the merchant account a capture must be performed. Cor-
porateCard will return as true if the card supports Level 2/3.
AX Completion – (Capture/Pre-authorization Completion)
Once a Pre-authorization is obtained the funds that are locked need to be retrieved from the
customer’s credit card. The capture retrieves the locked funds and readies them for set-
tlement in to the merchant account. Prior to performing an AXCompletion a Preauth must be
performed.
AX Force Post – (Force Capture/Pre-authorization Completion)
This transaction is an alternative to AX Completion to obtain the funds locked on a Pre-author-
ization obtained from IVR or equivalent terminal. The capture retrieves the locked funds and
readies them for settlement in to the merchant account.
AX Purchase Correction – (Void, Correction)
AX Completion and AX Force Post can be voided the same day* that they occur. A void must
be for the full amount of the transaction and will remove any record of it from the cardholder
statement. * An AX Purchase Correction can be performed against a transaction as long as
the batch that contains the original transaction remains open. When using the automated
closing feature, the batch close occurs daily between 10 – 11 pm EST.
AX Refund – (Credit)
An AXRefund can be performed against an AX Completion and AX Force Post to refund any
part, or all of the transaction.
AX Independent Refund – (Credit)
AnAXIndependent Refund can be performed against a purchase or a capture to refund any
part, or all of the transaction. Independent refund is used when the originating transaction
was not performed through Moneris Gateway. Please note, the Independent Refund trans-
action may or may not be supported on your account. If you receive a transaction not
allowed error when attempting an independent refund, it may mean the transaction is not
supported on your account. If you wish to have theAX Independent Refund transaction type
temporarily enabled (or re-enabled), please contact the Service Centre at 1-866-319-7450.
November 2018 Page 210 of 476
![](asset-d3.png)
Moneris Gateway API- Integration Guide
7.4.2 Level 2/3 Transaction Flow for Amex
Page 211 of 476 November 2018
![](asset-d4.png)
7 Level 2/3 Transactions
7.4.3 Level 2/3 Data Objects in Amex
l7.4.3.1 About the Level 2/3 Data Objects for Amex
l7.4.3.2 Defining the AxLevel23 Object
lTable 1 Object
lTable 2 Object
lTable 3 Object
7.4.3.1 About the Level 2/3 Data Objects for Amex
Many of the Level 2/3 transaction requests using American Express also include a mandatory data object
called AxLevel23. AxLevel23 is also comprised of other objects, also described in this section.
The Level 2/3 data objects within this section apply to all of the following transactions and are passed as
part of the transaction request for:
lAX Completion
lAXForce Post
lAXRefund
lAXIndependent Refund
Things to Consider:
lPlease ensure the addendum data below is complete and accurate.
lPlease ensure the math on quantities calculations, amounts, discounts, taxes, etc. prop-
erly adds up to the overall transaction amount. Incorrect amounts will cause the trans-
action to be rejected.
7.4.3.2 Defining the AxLevel23 Object
AxLevel23 object definition
AxLevel23 level23 = new AxLevel23();
The AXLevel23 object itself has three objects, Table1, Table2 and Table3, all of which are mandatory.
Req* Value Limits Set Method Description
Y Table1 Object AxTable1 table1 =
new AxTable1();
level23.SetTable1
Refer below for fur-
ther breakdown
and definition of
table1
Table 1 AxLevel23 Object
November 2018 Page 212 of 476
![](asset-d5.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Set Method Description
(table1);
Y Table2 Object AxTable2 table2 =
new AxTable2();
level23.SetTable2
(table2);
Refer below for fur-
ther breakdown
and definition of
table2
Y Table3 Object AxTable3 table3 =
new AxTable3();
level23.SetTable3
(table3);
Refer below for fur-
ther breakdown
and definition of
table3
*Y = Required, N= Optional, C = Conditional
Table 1 Object
Table 1 contains the addendum data heading information. Contains information such as identification
elements that uniquely identify an invoice (transaction), the customer name and shipping address.
Table 1 object definition
AxTable1 table1 = new AxTable1();
Req* Value Limits Set Method Description
C Purchase Order
Number
22-character alpha-
numeric
table1.SetBig04
(big04);
The cardholder sup-
plied Purchase Order
Number, which is
entered by the mer-
chant at the point-of-
sale
This entry is used in
the State-
ment/Reporting pro-
cess and may include
accounting inform-
ation specific to the
client
NOTE: This element
is mandatory, if the
merchant’s customer
provides a Purchase
Order Number.
Table 1 AxLevel23 object - Table 1 object fields
Page 213 of 476 November 2018
![](asset-d6.png)
7 Level 2/3 Transactions
Req* Value Limits Set Method Description
N Release Number 30-character alpha-
numeric
table1.SetBig05
(big05);
A number that iden-
tifies a release
against a Purchase
Order previously
placed by the parties
involved in the trans-
action
N Invoice Number 8-character alpha-
numeric
table1.SetBig10
(big10);
Contains the Amex
invoice/reference
number
N N1Loop Object table1.SetN1Loop
(n1Loop)
Refer below for fur-
ther breakdown and
definition of N1Loop
object
*Y = Required, N= Optional, C = Conditional
Table 1 also has its own objects:
lN1Loop object
lAxRef object
Table 1 - Setting the N1Loop Object
The N1Loop data set contains the Requester names. It can also optionally contain the buying group, ship
from, ship to and receiver details.
A minimum of at least 1 n1Loop must be set. Up to 5 n1Loop can be set.
N1Loop object definition
n1Loop.SetN1Loop(n101, n102, n301, n401, n402, n403, axRef1);
Req* Value Limits Variable or Set Method Description
Y Entity Identifier
Code
2-character alpha-
numeric
n101 Supported values:
R6 - Requester
(required)
BG - Buying Group
(optional)
SF - Ship From
(optional)
ST - Ship To (optional)
Table 1 AxLevel23 object - Table 1 object - N1Loop object fields
November 2018 Page 214 of 476
![](asset-d7.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Variable or Set Method Description
40 - Receiver (optional)
Y Name 40-character alpha-
numeric
n102 n101
code
n102
meaning
R6 Requester
Name
BG Buying Group
Name
SF Ship
FromName
ST Ship To Name
40 ReceiverName
N Address 40-character alpha-
numeric
n301 Address
N City 30-character alpha-
numeric
n401 City
N State or Province 2-character alpha-
numeric
n402 State or province
N Postal Code 15-character alpha-
numeric
n403 Postal Code
N AxRef Object AxRef axRef1 = new
AxRef();
Refer below for fur-
ther breakdown
and definition of
AxRef object.
This object con-
tains the customer
postal code (man-
datory) and cus-
tomer reference
number (optional)
A minimum of 1
axRef1 must be
set; maximum of 2
axRef1’s may be
set
*Y = Required, N= Optional, C = Conditional
Page 215 of 476 November 2018
![](asset-d8.png)
7 Level 2/3 Transactions
Table 1 - Setting the AxRef Object
Setting AXRef object
AxRef axRef1 = new AxRef();
string[] ref01 = {"4C", "CR"}; //Reference ID Qualifier
string[] ref02 = {"M5T3A5", "16802309004"}; //Reference ID
axRef1.SetRef(ref01[0], ref02[0]);
axRef1.SetRef(ref01[1], ref02[1]);
Req* Value Limits Variable Description
Y Reference
Identification
Qualifier
2-character alpha-
numeric
ref01 This element may con-
tain the following qual-
ifiers for the
corresponding occur-
rences of the N1Loop:
n101
value
ref01
denotation
R6 Supported val-
ues:
4C - Shipment
Destination
Code (man-
datory)
CR - Customer
Reference
Number (con-
ditional)
BG n/a
SF n/a
ST n/a
40 n/a
Y Reference
Identification
15-character alpha-
numeric
ref02 This field must be pop-
ulated for each ref01
provided
Table 1 AxLevel23 object - Table 1 object - AxRef object fields
November 2018 Page 216 of 476
![](asset-d9.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Variable Description
ref01
value
ref02 denota-
tion
4C
(n101
value =
R6)
This element must
contain the Amex
Ship-to Postal Code
of the destination
where the com-
modity was shipped.
If the Ship-to Postal
Code is unavailable,
the postal code of
the merchant loc-
ation where the
transaction took
place may be sub-
stituted.
CR
(n101
value =
R6):
This element must
contain the Amex
Card member Refer-
ence Number (e.g.,
purchase order, cost
center, project num-
ber, etc.) that cor-
responds to this
transaction, if
provided by the
Cardholder.
This information
may be displayed in
the state-
ment/reporting pro-
cess and may include
client-specific
accounting inform-
ation.
*Y = Required, N= Optional, C = Conditional
Table 2 Object
Table 2 includes the transaction’s addendum detail. It contains transaction data including reference
codes, debit or credit and tax amounts, line item detail descriptions, shipping information and much
more. All transaction data in an invoice relate to a single transaction and cardholder account number.
Table 2 object definition
AxTable2 table2 = new AxTable2();
Page 217 of 476 November 2018
![](asset-da.png)
7 Level 2/3 Transactions
Req* Value Limits Set Method Description
N It1loop Object table2.SetIt1Loop
(it1Loop);
Refer below for fur-
ther breakdown
and definition of
object details.
Table 1 AxLevel23 object - Table 2 object fields
*Y = Required, N= Optional, C = Conditional
Table 2 - Setting the AxIt1Loop Object
The AxIt1Loop data defines the baseline item data for the invoice. This data is defined for each item/ser-
vice purchased and included within this invoice. This data set contains basic transaction data, including
quantity, unit of measure, unit price and goods/services reference information.
lA minimum of 1 it1Loop required
lA maximum of 999 it1Loop’s supported
AxIt1Loop object definition
AxIt1Loop it1Loop = new AxIt1Loop();
it1Loop.SetIt1Loop(it102[0], it103[0], it104[0], it105[0], it106s[0], txi[0],
pam05[0], pid05[0]);
it1Loop.SetIt1Loop(it102[1], it103[1], it104[1], it105[1], it106s[1], txi[1],
pam05[1], pid05[1]);
Req* Value Limits Variable Description
Y Line Item Quant-
ity Invoiced
10-character decimal it102 Quantity of line
item
Up to 2 decimal
places supported
Minimum amount
is 0.0 and max-
imum is
9999999999
Y Unit or Basis for
Measurement
Code
2-character alpha-
numeric
it103 The line item unit
of measurement
code
Must contain a
Table 1 AxLevel23 object - Table 2 object - AxIt1Loop object fields
November 2018 Page 218 of 476
![](asset-db.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Variable Description
code that specifies
the units in which
the value is
expressed or the
manner in which a
measurement is
taken
EXAMPLE: EA =
each, E5=inches
See ANSI X-12 EDI
Allowable Units of
Measure and
Codes for the list
of codes
Y Unit Price 15-character decimal it104 Line item cost per
unit
Must contain 2
decimal places
Minimum amount
is 0.00 and max-
imum is 999999.99
N Basis or Unit
Price Code
2-character alpha-
numeric
it105 Code identifying
the type of unit
price for an item
EXAMPLE: DR =
dealer, AP =
advise price
See ASC X12
004010 Element
639 for list of codes
N AxIt106s object it106s Refer below for fur-
ther breakdown
and definition of
object details.
N AxTxi object txi Refer below for fur-
ther breakdown
and definition of
Page 219 of 476 November 2018
![](asset-dc.png)
7 Level 2/3 Transactions
Req* Value Limits Variable Description
object details
A maximum of 12
AxTxi (tax inform-
ation data sets)
may be defined
NOTE: that if line
item level tax
information is pop-
ulated in AxTxi in
Table2, then tax
totals for the
entire invoice
(transaction) must
be entered in
Table3.
Y Line Item Exten-
ded Amount
8-character decimal pam05 Contains the indi-
vidual item
amount that is nor-
mally calculated as
price multiplied by
quantity
Must contain 2
decimal places
Minimum amount
is 0.00 and max-
imum is 99999.99
Y Line Item Descrip-
tion
80-character alpha-
numeric
pid05 Line Item descrip-
tion
Contains the
description of the
individual item pur-
chased
This field pertain to
each line item in
the transaction
*Y = Required, N= Optional, C = Conditional
November 2018 Page 220 of 476
![](asset-dd.png)
Moneris Gateway API- Integration Guide
Table 2 - Setting the AxIt106s Object
AxIt106s[] it106s = {new AxIt106s(), new AxIt106s(), new AxIt106s(), new
AxIt106s(), new AxIt106s()};
string[] it10618 = {"MG", "MG", "MG", "MG", "MG"}; //Product/Service ID
qualifier
string[] it10719 = {"DJFR4", "JFJ49", "FEF33", "FEE43", "DISCOUNT"};
//Product/Service ID (corresponds to it10618)
Req* Value Limits Set Method Description
N Product/Service
ID Qualifier
2-character alpha-
numeric
it106s
[0].SetIt10618
(it10618[0]);
it106s
[1].SetIt10618
(it10618[1]);
Supported values:
MG - Manufacturer’s
Part Number
VC - Supplier Catalog
Number
SK - Supplier Stock
Keeping Unit Number
UP - Universal Product
Code
VP – Vendor Part Num-
ber
PO – Purchase Order
Number
AN – Client Defined
Asset Code
N Product/Service
ID it10618 it10719 -
size/type
VC 20-character
alphanumeric
PO 22-character
alphanumeric
Other 30-character
alphanumeric
it106s
[0].SetIt10719
(it10719[0]);
it106s
[1].SetIt10719
(it10719[1]);
Product/Service ID
corresponds to the
preceding qualifier
defined by it10618
The maximum
length depends on
the qualifier
defined in it10618
Table 1 AxLevel23 object - Table 2 object - AxIt106s object fields
*Y = Required, N= Optional, C = Conditional
Table 2 - Setting the AxTxi Object
Table 2 AxiTxi object definition
//Create Table 2 with details
string[] txi01_GST = {"GS", "GS", "GS", "GS", "GS"}; //Tax type code
Page 221 of 476 November 2018
![](asset-de.png)
7 Level 2/3 Transactions
string[] txi02_GST = {"0.70", "1.75", "1.00", "0.80","0.00"}; //Monetary
amount
string[] txi03_GST = {"5.0", "5.0", "5.0", "5.0","5.0"}; //Percent
string[] txi06_GST = {"", "", "", "",""}; //Tax exempt code
string[] txi01_PST = {"PG", "PG", "PG","PG","PG"}; //Tax type code
string[] txi02_PST = {"0.80", "2.00", "1.00", "0.80","0.00"}; //Monetary
amount
string[] txi03_PST = {"7.0", "7.0", "7.0", "7.0","7.0"}; //Percent
string[] txi06_PST = {"", "", "", "",""}; //Tax exempt code
AxTxi[] txi = {new AxTxi(), new AxTxi(), new AxTxi(), new AxTxi(), new AxTxi
()};
txi[0].SetTxi(txi01_GST[0], txi02_GST[0], txi03_GST[0], txi06_GST[0]);
txi[0].SetTxi(txi01_PST[0], txi02_PST[0], txi03_PST[0], txi06_PST[0]);
txi[1].SetTxi(txi01_GST[1], txi02_GST[1], txi03_GST[1], txi06_GST[1]);
txi[1].SetTxi(txi01_PST[1], txi02_PST[1], txi03_PST[1], txi06_PST[1]);
txi[2].SetTxi(txi01_GST[2], txi02_GST[2], txi03_GST[2], txi06_GST[2]);
txi[2].SetTxi(txi01_PST[2], txi02_PST[2], txi03_PST[2], txi06_PST[2]);
txi[3].SetTxi(txi01_GST[3], txi02_GST[3], txi03_GST[3], txi06_GST[3]);
txi[3].SetTxi(txi01_PST[3], txi02_PST[3], txi03_PST[3], txi06_PST[3]);
txi[4].SetTxi(txi01_GST[4], txi02_GST[4], txi03_GST[4], txi06_GST[4]);
txi[4].SetTxi(txi01_PST[4], txi02_PST[4], txi03_PST[4], txi06_PST[4]);
Req* Value Limits Variable Description
C Tax Type code txi01 2-character alphanumeric Tax type code
applicable to
Canada and US
only
For Canada, this
field must contain
a code that spe-
cifies the type of
tax
If txi01 is used,
Table 1 AxLevel23 object - Table 2 object - AxiTxi object fields
November 2018 Page 222 of 476
![](asset-df.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Variable Description
then txi02, txi03 or
txi06 must be pop-
ulated
Valid codes include
the following:
CT – County/Tax
(optional)
CA – City Tax
(optional)
EV – Environmental
Tax (optional)
GS – Good and Ser-
vices Tax (GST)
(optional)
LS – State and Local
Sales Tax (optional)
LT – Local Sales Tax
(optional)
PG – Provincial Sales
Tax (PST) (optional)
SP – State/Provincial
Tax a.k.a. Quebec
Sales Tax (QST)
(optional)
ST – State Sales Tax
(optional)
TX – All Taxes
(required)
VA – Value-Added Tax
a.k.a. Canadian Har-
monized Sales Tax
(HST) (optional)
C Monetary
Amount
txi02 6-character decimal This element may
contain the mon-
etary tax amount
that corresponds
to the Tax Type
Code in txi01
NOTE:
If txi02 is used in
mandatory occur-
Page 223 of 476 November 2018
![](asset-e0.png)
7 Level 2/3 Transactions
Req* Value Limits Variable Description
rence txi01=TX, txi02
must contain the
total tax amount
applicable to the
entire invoice (trans-
action)
If taxes are not
applicable for the
entire invoice (trans-
action), txi02 must
be 0.00.
The maximum
value that can be
entered in this
field is “9999.99”,
which is $9,999.99
(CAD)
A debit is entered
as: 9999.99
A credit is entered
as: –9999.99
C Percent txi03 10-character decimal Contains the tax
percentage (in
decimal format)
that corresponds
to the tax type
code defined in
txi01
Up to 2 decimal
places supported
C Tax Exempt Code txi06 1-character alphanumeric This element may
contain the Tax
Exempt Code that
identifies the
exemption status
from sales and tax
that corresponds
to the Tax Type
Code in txi01
Supported values:
1 – Yes (Tax Exempt)
2 – No (Not Tax
Exempt)
November 2018 Page 224 of 476
![](asset-e1.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Variable Description
4 – Not Exempt/For
Resale
A – Labor Taxable,
Material Exempt
B – Material Taxable,
Labor Exempt
C – Not Taxable
F – Exempt (Goods /
Services Tax)
G – Exempt (Provincial
Sales Tax)
L – Exempt Local Ser-
vice
R – Recurring Exempt
U – Usage Exempt
*Y = Required, N= Optional, C = Conditional
Table 3 Object
Table 3 includes the transaction addendum summary. It contains the total invoice (transaction) amount,
sales tax, freight and/or handling charges and invoice summary information, including total line items,
number of segments in the invoice, and the transaction set control number (a.k.a., batch number).
Table 3 object definition
AxTable3 table3 = new AxTable3();
Req* Value Limits Set Method Description
C AxTxi Object table3.SetTxi
(taxTbl3);
Refer below for fur-
ther breakdown
and definition of
object details.
NOTE: if line item
level tax inform-
ation is populated
in AxTxi in Table2,
then tax totals for
the entire invoice
Table 1 AxLevel23 object - Table 3 object fields
Page 225 of 476 November 2018
![](asset-e2.png)
7 Level 2/3 Transactions
Req* Value Limits Set Method Description
(transaction) must
be entered in
Table3. A max-
imum of 10
AxTxi’s may be set
in Table3.
*Y = Required, N= Optional, C = Conditional
Table 3 - Setting the AxTxi Object
The mandatory tax information data set must contain the total tax amount applicable to the entire
invoice (transaction) which includes all line items identified in Table2. If taxes are not applicable for the
entire invoice (transaction), then txi02 must be set to 0.00.
Tax totals must be entered in this mandatory tax information segment in Table 3, even if line item detail
level tax data is reported in Table 2.
At least one occurrence of txi02, txi03 or txi06 is required.
Table 3 AxiTxi object definition
AxTxi taxTbl3 = new AxTxi();
taxTbl3.SetTxi("GS", "4.25","5.0",""); //sum of GST taxes
taxTbl3.SetTxi("PG", "4.60","7.0",""); //sum of PST taxes
taxTbl3.SetTxi("TX", "8.85","13.0",""); //sum of all taxes
Req* Value Limits Variable Description
C Tax Type code txi01 2-character alphanumeric Tax type code
applicable to
Canada and US
only
For Canada, this
field must contain
a code that spe-
cifies the type of
tax
If txi01 is used,
then txi02, txi03 or
txi06 must be pop-
ulated
Table 1 AxLevel23 object - Table 3 object - AxiTxi object fields
November 2018 Page 226 of 476
![](asset-e3.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Variable Description
Valid codes include
the following:
CT – County/Tax
(optional)
CA – City Tax
(optional)
EV – Environmental
Tax (optional)
GS – Good and Ser-
vices Tax (GST)
(optional)
LS – State and Local
Sales Tax (optional)
LT – Local Sales Tax
(optional)
PG – Provincial Sales
Tax (PST) (optional)
SP – State/Provincial
Tax a.k.a. Quebec
Sales Tax (QST)
(optional)
ST – State Sales Tax
(optional)
TX – All Taxes
(required)
VA – Value-Added Tax
a.k.a. Canadian Har-
monized Sales Tax
(HST) (optional)
C Monetary
Amount
txi02 6-character decimal This element may
contain the mon-
etary tax amount
that corresponds
to the Tax Type
Code in txi01
NOTE:
If txi02 is used in
mandatory occur-
rence txi01=TX, txi02
must contain the
total tax amount
applicable to the
entire invoice (trans-
action)
Page 227 of 476 November 2018
![](asset-e4.png)
7 Level 2/3 Transactions
Req* Value Limits Variable Description
If taxes are not
applicable for the
entire invoice (trans-
action), txi02 must
be 0.00.
The maximum
value that can be
entered in this
field is “9999.99”,
which is $9,999.99
(CAD)
A debit is entered
as: 9999.99
A credit is entered
as: –9999.99
C Percent txi03 10-character decimal Contains the tax
percentage (in
decimal format)
that corresponds
to the tax type
code defined in
txi01
Up to 2 decimal
places supported
C Tax Exempt Code txi06 1-character alphanumeric This element may
contain the Tax
Exempt Code that
identifies the
exemption status
from sales and tax
that corresponds
to the Tax Type
Code in txi01
Supported values:
1 – Yes (Tax Exempt)
2 – No (Not Tax
Exempt)
4 – Not Exempt/For
Resale
A – Labor Taxable,
Material Exempt
November 2018 Page 228 of 476
![](asset-e5.png)
Moneris Gateway API- Integration Guide
Req* Value Limits Variable Description
B – Material Taxable,
Labor Exempt
C – Not Taxable
F – Exempt (Goods /
Services Tax)
G – Exempt (Provincial
Sales Tax)
L – Exempt Local Ser-
vice
R – Recurring Exempt
U – Usage Exempt
*Y = Required, N= Optional, C = Conditional
7.4.4 AX Completion
The AX Completion transaction is used to secure the funds locked by a pre-authorization transaction.
When sending a capture request you will need two pieces of information from the original pre-author-
ization – the Order ID and the transaction number from the returned response.
AX Completion transaction object definition
AxCompletion axCompletion = new AxCompletion()
HttpsPostRequest object for AX Completion
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(axCompletion);
AX Completion transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
axCompletion.SetOrderId
(order_id);
Completion amount String 9-character decimal axCompletion.SetCompAmount
(comp_amount);
Transaction number String 255-character alpha-
numeric
axCompletion.SetTxnNumber
(txn_number);
Table 1 AX Completion transaction object mandatory values
Page 229 of 476 November 2018
![](asset-e6.png)
7 Level 2/3 Transactions
Value Type Limits Set Method
E-commerce indicator String 1-character alpha-
numeric
axCompletion.SetCryptType
(crypt);
Level 2/3 Data Object n/a axCompletion.SetAxLevel23
(level23);
Sample AX Completion
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestAxCompletion
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id="ord-210916-12:06:38";
string comp_amount="62.37";
string txn_number = "18924-0_11";
string crypt="7";
//Create Table 1 with details
string n101 = "R6"; //Entity ID Code
string n102 = "Retailing Inc. International"; //Name
string n301 = "919 Oriole Rd."; //Address Line 1
string n401 = "Toronto"; //City
string n402 = "On"; //State or Province
string n403 = "H1T6W3"; //Postal Code
string[] ref01 = {"4C", "CR"}; //Reference ID Qualifier
string[] ref02 = {"M5T3A5", "16802309004"}; //Reference ID
string big04 = "PO7758545"; //Purchase Order Number
string big05 = "RN0049858"; //Release Number
string big10 = "INV99870E"; //Invoice Number
AxRef axRef1 = new AxRef();
axRef1.SetRef(ref01[0], ref02[0]);
axRef1.SetRef(ref01[1], ref02[1]);
AxN1Loop n1Loop = new AxN1Loop();
n1Loop.SetN1Loop(n101, n102, n301, n401, n402, n403, axRef1);
AxTable1 table1 = new AxTable1();
table1.SetBig04(big04);
table1.SetBig05(big05);
table1.SetBig10(big10);
table1.SetN1Loop(n1Loop);
//Create Table 2 with details
//the sum of the extended amount field (pam05) must equal the level 1 amount field
string[] it102 = {"1", "1", "1", "1", "1"}; //Line item quantity invoiced
string[] it103 = {"EA", "EA", "EA", "EA", "EA"}; //Line item unit or basis of measurement code
November 2018 Page 230 of 476
![](asset-e7.png)
Moneris Gateway API- Integration Guide
Sample AX Completion
string[] it104 = {"10.00", "25.00", "8.62", "10.00", "-10.00"}; //Line item unit price
string[] it105 = {"", "", "", "", ""}; //Line item basis of unit price code
string[] it10618 = {"MG", "MG", "MG", "MG", "MG"}; //Product/Service ID qualifier
string[] it10719 = {"DJFR4", "JFJ49", "FEF33", "FEE43", "DISCOUNT"}; //Product/Service ID
(corresponds to it10618)
string[] txi01_GST = {"GS", "GS", "GS", "GS", "GS"}; //Tax type code
string[] txi02_GST = {"0.70", "1.75", "1.00", "0.80","0.00"}; //Monetary amount
string[] txi03_GST = {"", "", "", "",""}; //Percent
string[] txi06_GST = {"", "", "", "",""}; //Tax exempt code
string[] txi01_PST = {"PG", "PG", "PG","PG","PG"}; //Tax type code
string[] txi02_PST = {"0.80", "2.00", "1.00", "0.80","0.00"}; //Monetary amount
string[] txi03_PST = {"", "", "", "",""}; //Percent
string[] txi06_PST = {"", "", "", "",""}; //Tax exempt code
string[] pam05 = {"11.50", "28.75", "10.62", "11.50", "-10.00"}; //Extended line-item amount
string[] pid05 = {"Stapler", "Lamp", "Bottled Water", "Fountain Pen", "DISCOUNT"}; //Line item
description
AxIt106s[] it106s = {new AxIt106s(), new AxIt106s(), new AxIt106s(), new AxIt106s(), new AxIt106s
()};
it106s[0].SetIt10618(it10618[0]);
it106s[0].SetIt10719(it10719[0]);
it106s[1].SetIt10618(it10618[1]);
it106s[1].SetIt10719(it10719[1]);
it106s[2].SetIt10618(it10618[2]);
it106s[2].SetIt10719(it10719[2]);
it106s[3].SetIt10618(it10618[3]);
it106s[3].SetIt10719(it10719[3]);
it106s[4].SetIt10618(it10618[4]);
it106s[4].SetIt10719(it10719[4]);
AxTxi[] txi = {new AxTxi(), new AxTxi(), new AxTxi(), new AxTxi(), new AxTxi()};
txi[0].SetTxi(txi01_GST[0], txi02_GST[0], txi03_GST[0], txi06_GST[0]);
txi[0].SetTxi(txi01_PST[0], txi02_PST[0], txi03_PST[0], txi06_PST[0]);
txi[1].SetTxi(txi01_GST[1], txi02_GST[1], txi03_GST[1], txi06_GST[1]);
txi[1].SetTxi(txi01_PST[1], txi02_PST[1], txi03_PST[1], txi06_PST[1]);
txi[2].SetTxi(txi01_GST[2], txi02_GST[2], txi03_GST[2], txi06_GST[2]);
txi[2].SetTxi(txi01_PST[2], txi02_PST[2], txi03_PST[2], txi06_PST[2]);
txi[3].SetTxi(txi01_GST[3], txi02_GST[3], txi03_GST[3], txi06_GST[3]);
txi[3].SetTxi(txi01_PST[3], txi02_PST[3], txi03_PST[3], txi06_PST[3]);
txi[4].SetTxi(txi01_GST[4], txi02_GST[4], txi03_GST[4], txi06_GST[4]);
txi[4].SetTxi(txi01_PST[4], txi02_PST[4], txi03_PST[4], txi06_PST[4]);
AxIt1Loop it1Loop = new AxIt1Loop();
it1Loop.SetIt1Loop(it102[0], it103[0], it104[0], it105[0], it106s[0], txi[0], pam05[0], pid05[0]);
it1Loop.SetIt1Loop(it102[1], it103[1], it104[1], it105[1], it106s[1], txi[1], pam05[1], pid05[1]);
it1Loop.SetIt1Loop(it102[2], it103[2], it104[2], it105[2], it106s[2], txi[2], pam05[2], pid05[2]);
it1Loop.SetIt1Loop(it102[3], it103[3], it104[3], it105[3], it106s[3], txi[3], pam05[3], pid05[3]);
it1Loop.SetIt1Loop(it102[4], it103[4], it104[4], it105[4], it106s[4], txi[4], pam05[4], pid05[4]);
AxTable2 table2 = new AxTable2();
table2.SetIt1Loop(it1Loop);
//Create Table 3 with details
AxTxi taxTbl3 = new AxTxi();
taxTbl3.SetTxi("GS", "4.25","",""); //sum of GST taxes
taxTbl3.SetTxi("PG", "4.60","",""); //sum of PST taxes
Page 231 of 476 November 2018
![](asset-e8.png)
7 Level 2/3 Transactions
Sample AX Completion
taxTbl3.SetTxi("TX", "8.85","",""); //sum of all taxes
AxTable3 table3 = new AxTable3();
table3.SetTxi(taxTbl3);
//Create and Set Level23 Object
AxLevel23 level23 = new AxLevel23();
level23.SetTable1(table1);
level23.SetTable2(table2);
level23.SetTable3(table3);
AxCompletion axCompletion = new AxCompletion();
axCompletion.SetOrderId(order_id);
axCompletion.SetCompAmount(comp_amount);
axCompletion.SetTxnNumber(txn_number);
axCompletion.SetCryptType(crypt);
axCompletion.SetAxLevel23(level23);
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(axCompletion);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
7.4.5 AX Force Post
The AX Force Post transaction is used to secure the funds locked by a pre-authorization transaction per-
formed over IVR or equivalent terminal. When sending an AX Force Post request, you will need the order
ID, amount, credit card number, expiry date, authorization code and e-commerce indicator.
November 2018 Page 232 of 476
![](asset-e9.png)
Moneris Gateway API- Integration Guide
AX Force Post transaction object definition
AxForcePost axForcePost = new AxForcePost();
HttpsPostRequest object for AX Force Post transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(axForcePost);
AX Force Post transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
axForcePost.SetOrderId
(order_id);
Amount String 9-character decimal axForcePost.SetAmount
(amount);
Credit card number String 20-character alpha-
numeric
axForcePost.SetPan(pan);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
axForcePost.SetExpdate
(expiry_date);
Authorizationcode String 8-character alpha-
numeric
axForcePost.SetAuthCode
(auth_code);
E-commerce indicator String 1-character alpha-
numeric
axForcePost.SetCryptType
(crypt);
Level 2/3 Data Object n/a axForcePost.SetAxLevel23
(level23);
Table 1 AX Force Post transaction object mandatory values
Value Type Limits Set Method
Customer ID String 50-character alpha-
numeric
axForcePost.SetCustId(cust_
id);
Table 2 AX Force Post transaction object optional values
Page 233 of 476 November 2018
![](asset-ea.png)
7 Level 2/3 Transactions
Sample AX Force Post
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestAxForcePost
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id="Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id="CUST13343";
string amount="62.37";
string pan="373269005095005";
string expiry_date="2012"; //YYMM
string auth_code="123456";
string crypt="7";
//Create Table 1 with details
string n101 = "R6"; //Entity ID Code
string n102 = "Retailing Inc. International"; //Name
string n301 = "919 Oriole Rd."; //Address Line 1
string n401 = "Toronto"; //City
string n402 = "On"; //State or Province
string n403 = "H1T6W3"; //Postal Code
string[] ref01 = {"4C", "CR"}; //Reference ID Qualifier
string[] ref02 = {"M5T3A5", "16802309004"}; //Reference ID
string big04 = "PO7758545"; //Purchase Order Number
string big05 = "RN0049858"; //Release Number
string big10 = "INV99870E"; //Invoice Number
AxRef axRef1 = new AxRef();
axRef1.SetRef(ref01[0], ref02[0]);
axRef1.SetRef(ref01[1], ref02[1]);
AxN1Loop n1Loop = new AxN1Loop();
n1Loop.SetN1Loop(n101, n102, n301, n401, n402, n403, axRef1);
AxTable1 table1 = new AxTable1();
table1.SetBig04(big04);
table1.SetBig05(big05);
table1.SetBig10(big10);
table1.SetN1Loop(n1Loop);
//Create Table 2 with details
//the sum of the extended amount field (pam05) must equal the level 1 amount field
string[] it102 = {"1", "1", "1", "1", "1"}; //Line item quantity invoiced
string[] it103 = {"EA", "EA", "EA", "EA", "EA"}; //Line item unit or basis of measurement code
string[] it104 = {"10.00", "25.00", "8.62", "10.00", "-10.00"}; //Line item unit price
string[] it105 = {"", "", "", "", ""}; //Line item basis of unit price code
string[] it10618 = {"MG", "MG", "MG", "MG", "MG"}; //Product/Service ID qualifier
string[] it10719 = {"DJFR4", "JFJ49", "FEF33", "FEE43", "DISCOUNT"}; //Product/Service ID
(corresponds to it10618)
string[] txi01_GST = {"GS", "GS", "GS", "GS", "GS"}; //Tax type code
string[] txi02_GST = {"0.70", "1.75", "1.00", "0.80","0.00"}; //Monetary amount
November 2018 Page 234 of 476
![](asset-eb.png)
Moneris Gateway API- Integration Guide
Sample AX Force Post
string[] txi03_GST = {"", "", "", "",""}; //Percent
string[] txi06_GST = {"", "", "", "",""}; //Tax exempt code
string[] txi01_PST = {"PG", "PG", "PG","PG","PG"}; //Tax type code
string[] txi02_PST = {"0.80", "2.00", "1.00", "0.80","0.00"}; //Monetary amount
string[] txi03_PST = {"", "", "", "",""}; //Percent
string[] txi06_PST = {"", "", "", "",""}; //Tax exempt code
string[] pam05 = {"11.50", "28.75", "10.62", "11.50", "-10.00"}; //Extended line-item amount
string[] pid05 = {"Stapler", "Lamp", "Bottled Water", "Fountain Pen", "DISCOUNT"}; //Line item
description
AxIt106s[] it106s = {new AxIt106s(), new AxIt106s(), new AxIt106s(), new AxIt106s(), new AxIt106s
()};
it106s[0].SetIt10618(it10618[0]);
it106s[0].SetIt10719(it10719[0]);
it106s[1].SetIt10618(it10618[1]);
it106s[1].SetIt10719(it10719[1]);
it106s[2].SetIt10618(it10618[2]);
it106s[2].SetIt10719(it10719[2]);
it106s[3].SetIt10618(it10618[3]);
it106s[3].SetIt10719(it10719[3]);
it106s[4].SetIt10618(it10618[4]);
it106s[4].SetIt10719(it10719[4]);
AxTxi[] txi = {new AxTxi(), new AxTxi(), new AxTxi(), new AxTxi(), new AxTxi()};
txi[0].SetTxi(txi01_GST[0], txi02_GST[0], txi03_GST[0], txi06_GST[0]);
txi[0].SetTxi(txi01_PST[0], txi02_PST[0], txi03_PST[0], txi06_PST[0]);
txi[1].SetTxi(txi01_GST[1], txi02_GST[1], txi03_GST[1], txi06_GST[1]);
txi[1].SetTxi(txi01_PST[1], txi02_PST[1], txi03_PST[1], txi06_PST[1]);
txi[2].SetTxi(txi01_GST[2], txi02_GST[2], txi03_GST[2], txi06_GST[2]);
txi[2].SetTxi(txi01_PST[2], txi02_PST[2], txi03_PST[2], txi06_PST[2]);
txi[3].SetTxi(txi01_GST[3], txi02_GST[3], txi03_GST[3], txi06_GST[3]);
txi[3].SetTxi(txi01_PST[3], txi02_PST[3], txi03_PST[3], txi06_PST[3]);
txi[4].SetTxi(txi01_GST[4], txi02_GST[4], txi03_GST[4], txi06_GST[4]);
txi[4].SetTxi(txi01_PST[4], txi02_PST[4], txi03_PST[4], txi06_PST[4]);
AxIt1Loop it1Loop = new AxIt1Loop();
it1Loop.SetIt1Loop(it102[0], it103[0], it104[0], it105[0], it106s[0], txi[0], pam05[0], pid05[0]);
it1Loop.SetIt1Loop(it102[1], it103[1], it104[1], it105[1], it106s[1], txi[1], pam05[1], pid05[1]);
it1Loop.SetIt1Loop(it102[2], it103[2], it104[2], it105[2], it106s[2], txi[2], pam05[2], pid05[2]);
it1Loop.SetIt1Loop(it102[3], it103[3], it104[3], it105[3], it106s[3], txi[3], pam05[3], pid05[3]);
it1Loop.SetIt1Loop(it102[4], it103[4], it104[4], it105[4], it106s[4], txi[4], pam05[4], pid05[4]);
AxTable2 table2 = new AxTable2();
table2.SetIt1Loop(it1Loop);
//Create Table 3 with details
AxTxi taxTbl3 = new AxTxi();
taxTbl3.SetTxi("GS", "4.25","",""); //sum of GST taxes
taxTbl3.SetTxi("PG", "4.60","",""); //sum of PST taxes
taxTbl3.SetTxi("TX", "8.85","",""); //sum of all taxes
AxTable3 table3 = new AxTable3();
table3.SetTxi(taxTbl3);
AxLevel23 level23 = new AxLevel23();
level23.SetTable1(table1);
level23.SetTable2(table2);
level23.SetTable3(table3);
AxForcePost axForcePost = new AxForcePost();
Page 235 of 476 November 2018
![](asset-ec.png)
7 Level 2/3 Transactions
Sample AX Force Post
axForcePost.SetOrderId(order_id);
axForcePost.SetCustId(cust_id);
axForcePost.SetAmount(amount);
axForcePost.SetPan(pan);
axForcePost.SetExpDate(expiry_date);
axForcePost.SetAuthCode(auth_code);
axForcePost.SetCryptType(crypt);
axForcePost.SetAxLevel23(level23);
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(axForcePost);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
7.4.6 AX Purchase Correction
The AX Purchase Correction (Void) transaction is used to cancel a transaction that was performed in the
current batch. No amount is required because a void is always for 100% of the original transaction. The
only transaction that can be voided using AX Purchase Correction is AX Completion and AX Force Post.
To send an AX Purchase Correction the Order IDand transaction number from the AX Completion or AX
Force Post are required.
November 2018 Page 236 of 476
![](asset-ed.png)
Moneris Gateway API- Integration Guide
AX Purchase Correction transaction object definition
AxPurchaseCorrection axPurchaseCorrection = new AxPurchaseCorrection();
HttpsPostRequest object for AX Purchase Correction transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(axPurchaseCorrection);
AX Purchase Correction transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
axPurchaseCorrection
.SetOrderId(order_id);
Transaction number String 255-character alpha-
numeric
axPurchaseCorrection
.SetTxnNumber(txn_number);
E-commerce indicator String 1-character alpha-
numeric
axPurchaseCorrection
.SetCryptType(crypt);
Table 1 AX Purchase Correction transaction object mandatory values
AX Purchase Correction
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestAxPurchaseCorrection
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id="Test20170119104952";
string txn_number = "660117311852017019104953104-0_11";
string crypt="7";
AxPurchaseCorrection axPurchaseCorrection = new AxPurchaseCorrection();
axPurchaseCorrection.SetOrderId(order_id);
axPurchaseCorrection.SetTxnNumber(txn_number);
axPurchaseCorrection.SetCryptType(crypt);
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(axPurchaseCorrection);
Page 237 of 476 November 2018
![](asset-ee.png)
7 Level 2/3 Transactions
AX Purchase Correction
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
7.4.7 AX Refund
The AX Refund will credit a specified amount to the cardholder’s credit card. A refund can be sent up to
the full value of the original AX Completion or AX Force Post. To send an AX Refund you will require the
Order ID and transaction number from the original AX Completion or AX Force Post.
AX Refund transaction object definition
AxRefund axRefund = new AxRefund();
HttpsPostRequest object for AX Refund transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(axRefund);
November 2018 Page 238 of 476
![](asset-ef.png)
Moneris Gateway API- Integration Guide
AX Refund transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
axRefund.SetOrderId(order_
id);
Transaction number String 255-character alpha-
numeric
axRefund.SetTxnNumber(txn_
number);
Amount String 9-character decimal axRefund.SetAmount(amount);
E-commerce indicator String 1-character alpha-
numeric
axRefund.SetCryptType
(crypt);
Level 2/3 Data Object n/a axRefund.SetAxLevel23
(level23);
Table 1 AX Refund transaction object mandatory values
Sample AX Refund
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestAxRefund
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id="ord-210916-12:06:38";
string amount="62.37";
string txn_number = "18924-4_11";
string crypt="7";
//Create Table 1 with details
string n101 = "R6"; //Entity ID Code
string n102 = "Retailing Inc. International"; //Name
string n301 = "919 Oriole Rd."; //Address Line 1
string n401 = "Toronto"; //City
string n402 = "On"; //State or Province
string n403 = "H1T6W3"; //Postal Code
string[] ref01 = {"4C", "CR"}; //Reference ID Qualifier
string[] ref02 = {"M5T3A5", "16802309004"}; //Reference ID
string big04 = "PO7758545"; //Purchase Order Number
string big05 = "RN0049858"; //Release Number
string big10 = "INV99870E"; //Invoice Number
AxRef axRef1 = new AxRef();
Page 239 of 476 November 2018
![](asset-f0.png)
7 Level 2/3 Transactions
Sample AX Refund
axRef1.SetRef(ref01[0], ref02[0]);
axRef1.SetRef(ref01[1], ref02[1]);
AxN1Loop n1Loop = new AxN1Loop();
n1Loop.SetN1Loop(n101, n102, n301, n401, n402, n403, axRef1);
AxTable1 table1 = new AxTable1();
table1.SetBig04(big04);
table1.SetBig05(big05);
table1.SetBig10(big10);
table1.SetN1Loop(n1Loop);
//Create Table 2 with details
//the sum of the extended amount field (pam05) must equal the level 1 amount field
string[] it102 = {"1", "1", "1", "1", "1"}; //Line item quantity invoiced
string[] it103 = {"EA", "EA", "EA", "EA", "EA"}; //Line item unit or basis of measurement code
string[] it104 = {"10.00", "25.00", "8.62", "10.00", "-10.00"}; //Line item unit price
string[] it105 = {"", "", "", "", ""}; //Line item basis of unit price code
string[] it10618 = {"MG", "MG", "MG", "MG", "MG"}; //Product/Service ID qualifier
string[] it10719 = {"DJFR4", "JFJ49", "FEF33", "FEE43", "DISCOUNT"}; //Product/Service ID
(corresponds to it10618)
string[] txi01_GST = {"GS", "GS", "GS", "GS", "GS"}; //Tax type code
string[] txi02_GST = {"0.70", "1.75", "1.00", "0.80","0.00"}; //Monetary amount
string[] txi03_GST = {"", "", "", "",""}; //Percent
string[] txi06_GST = {"", "", "", "",""}; //Tax exempt code
string[] txi01_PST = {"PG", "PG", "PG","PG","PG"}; //Tax type code
string[] txi02_PST = {"0.80", "2.00", "1.00", "0.80","0.00"}; //Monetary amount
string[] txi03_PST = {"", "", "", "",""}; //Percent
string[] txi06_PST = {"", "", "", "",""}; //Tax exempt code
string[] pam05 = {"11.50", "28.75", "10.62", "11.50", "-10.00"}; //Extended line-item amount
string[] pid05 = {"Stapler", "Lamp", "Bottled Water", "Fountain Pen", "DISCOUNT"}; //Line item
description
AxIt106s[] it106s = {new AxIt106s(), new AxIt106s(), new AxIt106s(), new AxIt106s(), new AxIt106s
()};
it106s[0].SetIt10618(it10618[0]);
it106s[0].SetIt10719(it10719[0]);
it106s[1].SetIt10618(it10618[1]);
it106s[1].SetIt10719(it10719[1]);
it106s[2].SetIt10618(it10618[2]);
it106s[2].SetIt10719(it10719[2]);
it106s[3].SetIt10618(it10618[3]);
it106s[3].SetIt10719(it10719[3]);
it106s[4].SetIt10618(it10618[4]);
it106s[4].SetIt10719(it10719[4]);
AxTxi[] txi = {new AxTxi(), new AxTxi(), new AxTxi(), new AxTxi(), new AxTxi()};
txi[0].SetTxi(txi01_GST[0], txi02_GST[0], txi03_GST[0], txi06_GST[0]);
txi[0].SetTxi(txi01_PST[0], txi02_PST[0], txi03_PST[0], txi06_PST[0]);
txi[1].SetTxi(txi01_GST[1], txi02_GST[1], txi03_GST[1], txi06_GST[1]);
txi[1].SetTxi(txi01_PST[1], txi02_PST[1], txi03_PST[1], txi06_PST[1]);
txi[2].SetTxi(txi01_GST[2], txi02_GST[2], txi03_GST[2], txi06_GST[2]);
txi[2].SetTxi(txi01_PST[2], txi02_PST[2], txi03_PST[2], txi06_PST[2]);
txi[3].SetTxi(txi01_GST[3], txi02_GST[3], txi03_GST[3], txi06_GST[3]);
txi[3].SetTxi(txi01_PST[3], txi02_PST[3], txi03_PST[3], txi06_PST[3]);
November 2018 Page 240 of 476
![](asset-f1.png)
Moneris Gateway API- Integration Guide
Sample AX Refund
txi[4].SetTxi(txi01_GST[4], txi02_GST[4], txi03_GST[4], txi06_GST[4]);
txi[4].SetTxi(txi01_PST[4], txi02_PST[4], txi03_PST[4], txi06_PST[4]);
AxIt1Loop it1Loop = new AxIt1Loop();
it1Loop.SetIt1Loop(it102[0], it103[0], it104[0], it105[0], it106s[0], txi[0], pam05[0], pid05[0]);
it1Loop.SetIt1Loop(it102[1], it103[1], it104[1], it105[1], it106s[1], txi[1], pam05[1], pid05[1]);
it1Loop.SetIt1Loop(it102[2], it103[2], it104[2], it105[2], it106s[2], txi[2], pam05[2], pid05[2]);
it1Loop.SetIt1Loop(it102[3], it103[3], it104[3], it105[3], it106s[3], txi[3], pam05[3], pid05[3]);
it1Loop.SetIt1Loop(it102[4], it103[4], it104[4], it105[4], it106s[4], txi[4], pam05[4], pid05[4]);
AxTable2 table2 = new AxTable2();
table2.SetIt1Loop(it1Loop);
//Create Table 3 with details
AxTxi taxTbl3 = new AxTxi();
taxTbl3.SetTxi("GS", "4.25","",""); //sum of GST taxes
taxTbl3.SetTxi("PG", "4.60","",""); //sum of PST taxes
taxTbl3.SetTxi("TX", "8.85","",""); //sum of all taxes
AxTable3 table3 = new AxTable3();
table3.SetTxi(taxTbl3);
//Create and Set Level23 Object
AxLevel23 level23 = new AxLevel23();
level23.SetTable1(table1);
level23.SetTable2(table2);
level23.SetTable3(table3);
AxRefund axRefund = new AxRefund();
axRefund.SetOrderId(order_id);
axRefund.SetAmount(amount);
axRefund.SetTxnNumber(txn_number);
axRefund.SetCryptType(crypt);
axRefund.SetAxLevel23(level23);
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(axRefund);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
Page 241 of 476 November 2018
![](asset-f2.png)
7 Level 2/3 Transactions
Sample AX Refund
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
7.4.8 AX Independent Refund
The AX Independent Refund will credit a specified amount to the cardholder’s credit card. The inde-
pendent refund does not require an existing order to be logged in the Moneris Gateway; however, the
credit card number and expiry date will need to be passed.
AX Independent Refund transaction object definition
AxIndependentRefund axIndependentRefund = new AxIndependentRefund();
HttpsPostRequest object for AX Independent Refund transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(axIndependentRefund);
AX Independent Refund transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
axIndependentRefund
.SetOrderId(order_id);
Amount String 9-character decimal axIndependentRefund
.SetAmount(amount);
Credit card number String 20-character alpha-
numeric
axIndependentRefund.SetPan
(pan);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
axIndependentRefund
.SetExpdate(expiry_date);
E-commerce indicator String 1-character alpha-
numeric
axIndependentRefund
.SetCryptType(crypt);
Table 1 AX Independent Refund transaction object mandatory values
November 2018 Page 242 of 476
![](asset-f3.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set Method
Customer ID String 50-character alpha-
numeric
axIndependentRefund
.SetCustId(cust_id);
Table 2 AX Independent Refund transaction object optional values
Sample AX Independent Refund
namespace Moneris
{
using System;
using System.Collections;
using System.Text;
public class TestAxIndependentRefund
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string processing_country_code = "CA";
bool status_check = false;
string order_id="Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id="CUST13343";
string amount="62.37";
string pan="373269005095005";
string expiry_date="2012"; //YYMM
string crypt="7";
//Create Table 1 with details
string n101 = "R6"; //Entity ID Code
string n102 = "Retailing Inc. International"; //Name
string n301 = "919 Oriole Rd."; //Address Line 1
string n401 = "Toronto"; //City
string n402 = "On"; //State or Province
string n403 = "H1T6W3"; //Postal Code
string[] ref01 = {"4C", "CR"}; //Reference ID Qualifier
string[] ref02 = {"M5T3A5", "16802309004"}; //Reference ID
string big04 = "PO7758545"; //Purchase Order Number
string big05 = "RN0049858"; //Release Number
string big10 = "INV99870E"; //Invoice Number
AxRef axRef1 = new AxRef();
axRef1.SetRef(ref01[0], ref02[0]);
axRef1.SetRef(ref01[1], ref02[1]);
AxN1Loop n1Loop = new AxN1Loop();
n1Loop.SetN1Loop(n101, n102, n301, n401, n402, n403, axRef1);
AxTable1 table1 = new AxTable1();
table1.SetBig04(big04);
table1.SetBig05(big05);
table1.SetBig10(big10);
table1.SetN1Loop(n1Loop);
//Create Table 2 with details
//the sum of the extended amount field (pam05) must equal the level 1 amount field
string[] it102 = {"1", "1", "1", "1", "1"}; //Line item quantity invoiced
string[] it103 = {"EA", "EA", "EA", "EA", "EA"}; //Line item unit or basis of measurement code
string[] it104 = {"10.00", "25.00", "8.62", "10.00", "-10.00"}; //Line item unit price
Page 243 of 476 November 2018
![](asset-f4.png)
7 Level 2/3 Transactions
Sample AX Independent Refund
string[] it105 = {"", "", "", "", ""}; //Line item basis of unit price code
string[] it10618 = {"MG", "MG", "MG", "MG", "MG"}; //Product/Service ID qualifier
string[] it10719 = {"DJFR4", "JFJ49", "FEF33", "FEE43", "DISCOUNT"}; //Product/Service ID
(corresponds to it10618)
string[] txi01_GST = {"GS", "GS", "GS", "GS", "GS"}; //Tax type code
string[] txi02_GST = {"0.70", "1.75", "1.00", "0.80","0.00"}; //Monetary amount
string[] txi03_GST = {"", "", "", "",""}; //Percent
string[] txi06_GST = {"", "", "", "",""}; //Tax exempt code
string[] txi01_PST = {"PG", "PG", "PG","PG","PG"}; //Tax type code
string[] txi02_PST = {"0.80", "2.00", "1.00", "0.80","0.00"}; //Monetary amount
string[] txi03_PST = {"", "", "", "",""}; //Percent
string[] txi06_PST = {"", "", "", "",""}; //Tax exempt code
string[] pam05 = {"11.50", "28.75", "10.62", "11.50", "-10.00"}; //Extended line-item amount
string[] pid05 = {"Stapler", "Lamp", "Bottled Water", "Fountain Pen", "DISCOUNT"}; //Line item
description
AxIt106s[] it106s = {new AxIt106s(), new AxIt106s(), new AxIt106s(), new AxIt106s(), new AxIt106s
()};
it106s[0].SetIt10618(it10618[0]);
it106s[0].SetIt10719(it10719[0]);
it106s[1].SetIt10618(it10618[1]);
it106s[1].SetIt10719(it10719[1]);
it106s[2].SetIt10618(it10618[2]);
it106s[2].SetIt10719(it10719[2]);
it106s[3].SetIt10618(it10618[3]);
it106s[3].SetIt10719(it10719[3]);
it106s[4].SetIt10618(it10618[4]);
it106s[4].SetIt10719(it10719[4]);
AxTxi[] txi = {new AxTxi(), new AxTxi(), new AxTxi(), new AxTxi(), new AxTxi()};
txi[0].SetTxi(txi01_GST[0], txi02_GST[0], txi03_GST[0], txi06_GST[0]);
txi[0].SetTxi(txi01_PST[0], txi02_PST[0], txi03_PST[0], txi06_PST[0]);
txi[1].SetTxi(txi01_GST[1], txi02_GST[1], txi03_GST[1], txi06_GST[1]);
txi[1].SetTxi(txi01_PST[1], txi02_PST[1], txi03_PST[1], txi06_PST[1]);
txi[2].SetTxi(txi01_GST[2], txi02_GST[2], txi03_GST[2], txi06_GST[2]);
txi[2].SetTxi(txi01_PST[2], txi02_PST[2], txi03_PST[2], txi06_PST[2]);
txi[3].SetTxi(txi01_GST[3], txi02_GST[3], txi03_GST[3], txi06_GST[3]);
txi[3].SetTxi(txi01_PST[3], txi02_PST[3], txi03_PST[3], txi06_PST[3]);
txi[4].SetTxi(txi01_GST[4], txi02_GST[4], txi03_GST[4], txi06_GST[4]);
txi[4].SetTxi(txi01_PST[4], txi02_PST[4], txi03_PST[4], txi06_PST[4]);
AxIt1Loop it1Loop = new AxIt1Loop();
it1Loop.SetIt1Loop(it102[0], it103[0], it104[0], it105[0], it106s[0], txi[0], pam05[0], pid05[0]);
it1Loop.SetIt1Loop(it102[1], it103[1], it104[1], it105[1], it106s[1], txi[1], pam05[1], pid05[1]);
it1Loop.SetIt1Loop(it102[2], it103[2], it104[2], it105[2], it106s[2], txi[2], pam05[2], pid05[2]);
it1Loop.SetIt1Loop(it102[3], it103[3], it104[3], it105[3], it106s[3], txi[3], pam05[3], pid05[3]);
it1Loop.SetIt1Loop(it102[4], it103[4], it104[4], it105[4], it106s[4], txi[4], pam05[4], pid05[4]);
AxTable2 table2 = new AxTable2();
table2.SetIt1Loop(it1Loop);
//Create Table 3 with details
AxTxi taxTbl3 = new AxTxi();
taxTbl3.SetTxi("GS", "4.25","",""); //sum of GST taxes
taxTbl3.SetTxi("PG", "4.60","",""); //sum of PST taxes
taxTbl3.SetTxi("TX", "8.85","",""); //sum of all taxes
November 2018 Page 244 of 476
![](asset-f5.png)
Moneris Gateway API- Integration Guide
Sample AX Independent Refund
AxTable3 table3 = new AxTable3();
table3.SetTxi(taxTbl3);
//Create and Set Level23 Object
AxLevel23 level23 = new AxLevel23();
level23.SetTable1(table1);
level23.SetTable2(table2);
level23.SetTable3(table3);
AxIndependentRefund axIndependentRefund = new AxIndependentRefund();
axIndependentRefund.SetOrderId(order_id);
axIndependentRefund.SetCustId(cust_id);
axIndependentRefund.SetAmount(amount);
axIndependentRefund.SetPan(pan);
axIndependentRefund.SetExpDate(expiry_date);
axIndependentRefund.SetCryptType(crypt);
axIndependentRefund.SetAxLevel23(level23);
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(axIndependentRefund);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Page 245 of 476 November 2018
![](asset-f6.png)
8 MPI
l8.1 About MPI Transactions
l8.2 3-D Secure Implementations (VbV, MCSC, SafeKey)
l8.3 Activating VbV and MCSC
l8.4 Activating Amex SafeKey
l8.5 Transaction Flow for MPI
l8.6 MPI Transactions
8.1 About MPI Transactions
The Moneris Gateway can enable transactions using the 3-D Secure protocol via Merchant Plug-In (MPI)
and Access Control Server(ACS) .
Moneris Gateway supports the following 3-D Secure implementations:
lVerified by Visa (VbV)
lMastercard Secure Code (MCSC)
lAmericanExpress SafeKey (applies to Canadian integrations only)
8.2 3-D Secure Implementations (VbV, MCSC, SafeKey)
Verified by Visa (VbV), MasterCard Secure Code (MCSC) and American Express SafeKey are programs
based on the 3-D Secure Protocol to improve the security of online transactions.
These programs involve authentication of the cardholder during an online e-commerce transaction.
Authentication is based on the issuer’s selected method of authentication.
The following are examples of authentication methods:
lRisk-based authentication
lDynamic passwords
lStatic passwords.
Some benefits of these programs are reduced risk of fraudulent transactions and protection against
chargebacks for certain fraudulent transactions.
Additional eFraud features
To further decrease fraudulent activity, Moneris also recommends implementing the following features:
lAVS: Address Verification Service (page 283)
lCVD: Card Validation Digits ().
November 2018 Page 246 of 476
![](asset-f7.png)
Moneris Gateway API- Integration Guide
8.3 Activating VbV and MCSC
To integrate Verified by Visa and/or MasterCard Secure Code transaction functionality in your system,
call Moneris Sales Support to have Moneris enroll you in the program(s) and enable the functionality on
your account.
8.4 Activating Amex SafeKey
To Activate Amex SafeKey transaction functionality with your system via the Moneris GatewayAPI:
1. Enroll in the SafeKey program with American Express
at:https://network.americanexpress.com/ca/en/safekey/index.aspx
2. Call your Moneris sales centre at 1-855-465-4980 to get AmexSafeKey functionality enabled on
your account.
8.5 Transaction Flow for MPI
Figure 3: Transaction flow diagram
1. Cardholder enters the credit card number and submits the transaction information to the mer-
chant.
2. Upon receiving the transaction request, the merchant calls the MonerisMPI API and passes a
TXN type request. For sample code please refer to MpiTxn Request Transaction (page 251).
3. The Moneris MPI receives the request, authenticates the merchant and sends the transaction
information to Visa, MasterCard or American Express.
4. Visa/MasterCard/Amex verifies that the card is enrolled and returns the issuer URL.
5. Moneris MPI receives the response from Visa, MasterCard or Amex and forwards the inform-
ation to the merchant.
6. The MonerisMPI API installed at the merchant receives the response from the Moneris MPI.
If the response is "Y" for enrolled, the merchant makes a call to the API, which opens a popup/in-
line window in the cardholder browser.
If the response is “N” for not enrolled, a transaction could be sent to the processor identifying it
as VBV/MCSC/SafeKey attempted with an ECI value of 6.
Page 247 of 476 November 2018
![](asset-f8.png)
8 MPI
If the response is “U” for unable to authenticate or the response times out, the transaction can
be sent to the processor with an ECI value of 7. The merchant can then choose to continue with
the transaction and be liable for a chargeback, or the merchant can choose to end the trans-
action.
7. The cardholder browser uses the URL that was returned from Visa/MasterCard/Amex via the mer-
chant to communicate directly to the bank. The contents of the popup are loaded and the card-
holder enters the PIN.
8. The information is submitted to the bank and authenticated. A response is then returned to the
client browser.
9. The client browser receives the response from the bank, and forwards it to the merchant.
10. The merchant receives the response information from the cardholder browser, and passes an
ACS request type to the Moneris MPI API.
11. Moneris MPI receives the ACS request and authenticates the information. The Moneris MPI then
provides a CAVV value (getCavv()) and a crypt type (getMpiEciO) to the merchant.
If the getSuccess() of the response is “true”, the merchant may proceed with the cavv purchase
or cavv preauth.
If the getSuccess() of the response is “false” and the getMessage() is “N”, the transaction must be
cancelled because the cardholder failed to authenticate.
If the getSuccess() of the response is “false” and the getMessage is “U”, the transaction can be
processed as a normal purchase or PreAuth; however in this case the merchant assumes liability
of a chargeback.
If the response times out, the transaction can be processed as a normal purchase or PreAuth;
however in this case the merchant assumes liability of a chargeback.
12. The merchant retrieves the CAVV value, and formats a cavv purchase or a cavv preauth request
using the method that is normally used. As part of this transaction method, the merchant must
pass the CAVV value and the crypt type.
8.6 MPI Transactions
Any of the transaction objects that are defined in this section can be passed to the HttpsPostRequest
connection object defined in Section 17.5 (page 381)here.
TXN
Sends the initial transaction data to the Moneris MPI to verify whether the card is enrolled.
The browser returns a PARes as well as a success field.
ACS
Passes the PARes (received in the response to the TXN transaction) to the Moneris MPI API.
Cavv Purchase
After receiving confirmation from the ACS transaction, this verifies funds on the customer’s
card, removes the funds and prepares them for deposit into the merchant’s account.
Cavv Pre-Authorization
After receiving confirmation from the ACS transaction, this verifies and locks funds on the cus-
tomer’s credit card. The funds are locked for a specified amount of time based on the card
issuer.
November 2018 Page 248 of 476
![](asset-f9.png)
Moneris Gateway API- Integration Guide
To retrieve the funds that have been locked by a Pre-Authorization transaction so that they
may be settled in the merchant’s account, a basic Completion transaction (page 25) must be
performed. A PreAuthorization transaction may only be "completed" once.
NOTE: Cavv Purchase and Cavv Pre-Authorization transactions are also used to process
Apple Pay and Android Pay transactions. For further details on how to process these wallet
transactions, please refer to 10 Apple Pay In-App and on the Web Integration.
8.6.1 VbV, MCSC and SafeKey Responses
For each transaction, a crypt type is sent to identify whether it is a VbV-, MCSC- or SafeKey-authenticated
transaction. Below are the tables defining the possible crypt types as well as the possible VARes and
PARes responses.
Crypt
type Visa definition MasterCard definition AmericanExpress Definition
5lFully authenticated
lThere is a liability shift,
and the merchant is pro-
tected from chargebacks
lFully authenticated
lThere is a liability shift,
and the merchant is pro-
tected from chargebacks.
lFully authenticated
lThere is a liability shift,
and the merchant is pro-
tected from chargebacks.
6lVbV has been attempted
lThere is a liability shift,
and the merchant is pro-
tected from certain
chargebacks on fraud-
ulent transactions
lMCSC has been attemp-
ted
lThere is a liability shift,
and the merchant is pro-
tected from certain
chargebacks on fraud-
ulent transactions
lSafeKey has been attemp-
ted
lThere is a liability shift,
and the merchant is pro-
tected from certain
chargebacks on fraud-
ulent transactions
7lNon-VbV transaction
lNo liability shift
lMerchant is not pro-
tected from chargebacks
lNon-MCSC transaction
lNo liability shift
lMerchant is not pro-
tected from chargebacks
lNon-SafeKey transaction
lNo liability shift
lMerchant is not pro-
tected from chargebacks
Table 71: Crypt type definitions
Page 249 of 476 November 2018
![](asset-fa.png)
8 MPI
VERes Response Response Definition
N The card/issuer is not enrolled.
Sent as a normal Purchase/PreAuth transaction with a crypt type of 6.
U The card type is not participating in VbV/MCSC/SafeKey. It could be corporate
card or another card plan that Visa/MasterCard/Amex excludes.
Proceed with a regular transaction with a crypt type of 7 or cancel the transaction.
Y The card is enrolled.
Proceed to create the VbV/MCSC/SafeKey inline window for cardholder authen-
tication. Proceed to PARes for crypt type.
Table 72: VERes response definitions
PARes response Response definition
A Attempted to verify PIN, and will receive a CAVV.
Send as a cavv_purchase/cavv_preAuth, which returns a crypt type of 6.
Y Fully authenticated, and will receive a CAVV.
Send as a cavv_purchase/cavv_preAuth which will return a crypt type of 5.
N Failed to authenticate. No CAVV is returned.
Cancel transaction.
Merchant may proceed with a crypt type of 7 although this is strongly dis-
couraged.
Table 73: PARes response definitions
Step 1: VERes
Cardholder/issuer
enrolled?
Step 2: PARes
VbV/MCSC InLine
window response
Step 3: Transaction
Are you protected?
Y Y Send a CAVV transaction
Y N Cancel transaction. Authentication failed or high-risk
transaction.
Y A Send a CAVV transaction
U n/a Send a regular transaction with a crypt type of 7
N n/a Send a regular transaction with a crypt type of 6
Table 74: 3-DSecure/CAVVtransaction handling
November 2018 Page 250 of 476
![](asset-fb.png)
Moneris Gateway API- Integration Guide
8.6.2 MpiTxn Request Transaction
MpiTxntransaction object definition
MpiTxn mpiTxn = new MpiTxn();
HttpsPostRequest object for MpiTxn transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(mpiTxn);
MpiTxntransaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
XID String 20-character alpha-
numeric
mpiTxn.SetXid(xid);
Credit card number String 20-character numeric mpiTxn.SetPan(pan);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
mpiTxn.SetExpdate(expiry_
date);
Amount String 9-character decimal
Must contain at least 3
digits including two
penny values.
mpiTxn.SetAmount(amount);
MD String 1024-character alpha-
numeric
mpiTxn.SetMD(MD);
Merchant URL String N/A mpiTxn.SetMerchantUrl
(merchantUrl);
Accept String N/A mpiTxn.SetAccept(accept);
User Agent String N/A mpiTxn.SetUserAgent
(userAgent);
Table 75: MpiTxn transaction object mandatory values
Page 251 of 476 November 2018
![](asset-fc.png)
8 MPI
Sample MpiTxn Request
namespace Moneris
{
using System;
using System.Text;
public class TestCanadaMpiTxn
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string amount = "1.00";
Random r = new Random();
StringBuilder sb = new StringBuilder();
for(int i=0; i< 20; i++)
{
sb.Append(r.Next(0,9));
}
string xid = sb.ToString();
//string MD = xid + "mycardinfo" + amount;
string MD = "xid=99999999999999992464&pan=4242424242424242&expiry=1511&amount=1.00";
string merchantUrl = "https://YOUR_MPI_RESPONSE_URL";
string accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8";
string userAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/43.0.2357.130 Safari/537.36";
string processing_country_code = "CA";
string pan = "4242424242424242";
string expdate = "1511";
bool status_check = false;
MpiTxn mpiTxn = new MpiTxn();
mpiTxn.SetXid(xid);
mpiTxn.SetPan(pan);
mpiTxn.SetExpDate(expdate);
mpiTxn.SetAmount(amount);
mpiTxn.SetMD(MD);
mpiTxn.SetMerchantUrl(merchantUrl);
mpiTxn.SetAccept(accept);
mpiTxn.SetUserAgent(userAgent);
//************************OPTIONAL VARIABLES***************************
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(mpiTxn);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
/********************** REQUEST ************************/
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("MpiMessage = " + receipt.GetMpiMessage());
Console.WriteLine("MpiSuccess = " + receipt.GetMpiSuccess());
if (receipt.GetMpiSuccess() == "true")
{
Console.WriteLine(receipt.GetInLineForm());
}
Console.ReadLine();
}
catch (Exception e)
November 2018 Page 252 of 476
![](asset-fd.png)
Moneris Gateway API- Integration Guide
Sample MpiTxn Request
{
Console.WriteLine(e);
}
}
} // end TestResMpiTxn
}
8.6.2.1 TXN Response and Creating the Popup
The TXN request returns a response with one of several possible values. The get Message method of the
response object returns “Y”, “U”, or “N”.
N
Purchase or Pre-Authorization can be sent as a crypt type of 6 (attempted authentication).
Y
A call to the API to create the VBV form is made.
U
(Returned for non-participating cards such as corporate cards)
Merchant can send the transaction with crypt_type 7. However, the merchant is liable for
chargebacks.
8.6.3 Vault MPITransaction – ResMpiTxn
Vault MPITransaction transaction object definition
ResMpiTxn resMpiTxn = new ResMpiTxn();
HttpsPostRequest object for Vault MPITransaction transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resMpiTxn);
Vault MPITransaction transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Data key String 25-character alpha-
numeric
resMpiTxn.SetData(data_key);
XID String 20-character alpha-
numeric
resMpiTxn.SetXid(xid);
Amount String 9-character decimal resMpiTxn.SetAmount(amount);
Table 76: Vault MPITransaction transaction object mandatory values
Page 253 of 476 November 2018
![](asset-fe.png)
8 MPI
Value Type Limits Set method
MD String 1024-character alpha-
numeric
resMpiTxn.SetMD(MD);
Merchant URL String n/a resMpiTxn.SetMerchantUrl
(merchantUrl);
Accept String n/a resMpiTxn.SetAccept(accept);
User Agent String n/a resMpiTxn.SetUserAgent
(userAgent);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
resMpiTxn.SetExpdate(expiry_
date);
Table 76: Vault MPITransaction transaction object mandatory values (continued)
Sample Vault MPITransaction
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResMpiTxn
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string data_key = "SzSrdoy0bt8UFXOtgS88wFAy7";
string amount = "1.00";
Random r = new Random();
StringBuilder sb = new StringBuilder();
for(int i=0; i< 20; i++)
{
sb.Append(r.Next(0,9));
}
string xid = sb.ToString();
string MD = xid + "mycardinfo" + amount;
string merchantUrl = "www.mystoreurl.com";
string accept = "true";
string userAgent = "Mozilla";
string processing_country_code = "CA";
bool status_check = false;
ResMpiTxn resMpiTxn = new ResMpiTxn();
resMpiTxn.SetData(data_key);
resMpiTxn.SetXid(xid);
resMpiTxn.SetAmount(amount);
resMpiTxn.SetMD(MD);
resMpiTxn.SetMerchantUrl(merchantUrl);
November 2018 Page 254 of 476
![](asset-ff.png)
Moneris Gateway API- Integration Guide
Sample Vault MPITransaction
resMpiTxn.SetAccept(accept);
resMpiTxn.SetUserAgent(userAgent);
//************************OPTIONAL VARIABLES***************************
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resMpiTxn);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
/********************** REQUEST ************************/
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("MpiMessage = " + receipt.GetMpiMessage());
Console.WriteLine("MpiSuccess = " + receipt.GetMpiSuccess());
if (receipt.GetMpiSuccess() == "true")
{
Console.WriteLine(receipt.GetInLineForm());
}
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
} // end TestResMpiTxn
}
Vault response fields
For a list and explanation of (Receipt object) response fields that are available after sending this Vault
transaction, see Definitions of Response Fields (page 437).
8.6.4 MPIACS Request Transaction
MPIACSRequest transaction object definition
MpiAcs mpiAcs = new MpiAcs();
HttpsPostRequest object for MPIACSRequest transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(mpiAcs);
MPIACSRequest transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Page 255 of 476 November 2018
![](asset-100.png)
8 MPI
Value Type Limits Set method
XID String 20-character alpha-
numeric NOTE: Is the concatenated 20-character
prefix that forms part of the variable MD
Amount String 9-character decimal
Must contain at least 3
digits including two
penny values.
mpiAcs.SetAmount(amount);
MD String 1024-character alpha-
numeric
mpiAcs.SetMD(MD);
PARes String n/a mpiAcs.SetPaRes(PaRes);
Table 77: MPIACSRequest transaction object mandatory values
Sample MPIACSRequest - CA
namespace Moneris
{
using System;
public class TestCanadaMpiAcs
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string amount = "1.00";
string xid = "12345678910111214005";
string MD = xid + "mycardinfo" + amount;
string PaRes = "PaRes String";
string processing_country_code = "CA";
bool status_check = false;
MpiAcs resMpiAcs = new MpiAcs();
resMpiAcs.SetPaRes(PaRes);
resMpiAcs.SetMD(MD);
//************************OPTIONAL VARIABLES***************************
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resMpiAcs);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
/********************** REQUEST ************************/
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("MpiMessage = " + receipt.GetMpiMessage());
Console.WriteLine("MpiSuccess = " + receipt.GetMpiSuccess());
November 2018 Page 256 of 476
![](asset-101.png)
Moneris Gateway API- Integration Guide
Sample MPIACSRequest - CA
if (receipt.GetMpiSuccess() == "true")
{
Console.WriteLine("Cavv = " + receipt.GetMpiCavv());
Console.WriteLine("Crypt Type = " + receipt.GetMpiEci());
}
else
{
Console.WriteLine("Message = " + receipt.GetMessage());
}
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
8.6.4.1 ACS Response and Forming a Transaction
The ACS response contains the CAVV value and the e-commerce indicator. These values are to be passed
to the transaction engine using the Cavv Purchase or Cavv Pre-Authorization request. Please see the doc-
umentation provided by your payment solution.
Outlined below is how to send a transaction to Moneris Gateway.
if ( mpiRes.getSuccess().equals("true") )
{
//Send transaction to host using CAVV purchase or CAVV preauth, refer to sample
//code for Moneris Gateway. Call mpiRes.getCavv() to obtain the CAVV value.
//If you are using preauth/capture model, be sure to call getMessage() so the
//value can be stored and used in the capture transaction after on to protect
//your chargeback liability. (e.g. getMPIMessage()= A = crypt type of 6 for
//follow on transaction and getMPIMessage() = Y = crypt type of 5 for follow on
//transaction.
}
else
{
if (mpiRes.getMessage().equals(“N”))
{
//Do not send transaction as the cardholder failed authentication.
}
else
{
//Optional to send transaction using the mpg API. In this case merchant
//assumes liability.
}
}
8.6.5 Purchase with 3-D Secure – cavvPurchase
The Purchase with 3-D Secure transaction follows a 3-D Secure MPI authentication. After receiving con-
firmation from the MPI ACS transaction, this Purchase verifies funds on the customer’s card, removes
the funds and prepares them for deposit into the merchant’s account.
To perform the 3-D Secure authentication, the Moneris MPIor any 3rd party MPI may be used.
Page 257 of 476 November 2018
![](asset-102.png)
8 MPI
This transaction can also be used to process an Apple Pay transaction. This transaction is applicable only
if choosing to integrate directly to Apple Wallet (if not using the Moneris Apple Pay SDK). Please refer to
10 Apple Pay In-App and on the Web Integration for more details on your integration options.
Refer to Apple's developer portal for details on integrating directly to the wallet to retrieve the payload
data.
Purchase with 3-D Secure transaction object definition
CavvPurchase cavvPurchase = new CavvPurchase();
HttpsPostRequest object for Purchase with 3-D Secure transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(cavvPurchase);
Cavv Purchase transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
cavvPurchase.SetOrderId
(order_id);
Amount String 9-character decimal cavvPurchase.SetAmount
(amount);
Credit card number String 20-character alpha-
numeric
cavvPurchase.SetPan(pan);
Table 78: Purchase with 3-D Secure transaction object mandatory values
November 2018 Page 258 of 476
![](asset-103.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
Expiry date String 4-character alpha-
numeric
(YYMMformat)
cavvPurchase.SetExpdate
(expiry_date);
CAVV
NOTE: For Apple Pay
Cavv Purchase and
Cavv Pre-Authorization
transactions, CAVV
field contains the
decrypted cryptogram.
For more, see
Appendix A Definitions
of Request Fields.
String 50-character alpha-
numeric
cavvPurchase.SetCavv(cavv);
E-commerce indicator
NOTE: For Apple Pay
Cavv Purchase and
Cavv Pre-Authorization
transactions, the E-
commerce indicator is
a mandatory field con-
taining the value
received from the
decrypted payload or a
default value of 5. If
you get a 2-character
value (e.g.,. 05 or 07)
from the payload,
remove the initial 0
and just send us the
2nd character. For
more, see Appendix A
Definitions of Request
Fields.
String 1-character alpha-
numeric
cavvPurchase.SetCryptType
(crypt);
Table 78: Purchase with 3-D Secure transaction object mandatory values
Page 259 of 476 November 2018
![](asset-104.png)
8 MPI
Variable and Field
Name Type Limits Set Method
Network
NOTE: This request
variable is mandatory
for INTERAC® e-Com-
merce transactions con-
ducted via Apple Pay,
and is not for use with
credit card trans-
actions.
String alphabetical cavvPurchase.setNetwork
(network);
Data Type
NOTE: This request
variable is mandatory
for INTERAC® e-Com-
merce transactions con-
ducted via Apple Pay,
and is not for use with
credit card trans-
actions.
String 3-character alpha-
numeric
cavvPurchase.setDataType
(data_type);
Table 1 INTERAC® e-Commerce Fields – Required for Apple Pay and Google Pay Only
Value Type Limits Set Method
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Customer ID String 50-character alpha-
numeric
cavvPurchase.SetCustId(cust_
id);
Dynamic descriptor String 20-character alpha-
numeric
cavvPurchase
.SetDynamicDescriptor
(dynamic_descriptor);
Card Match ID
NOTE: Applies to Off-
linx™ only; must be
unique value for each
transaction
String 50-character alpha-
numeric
cavvPurchase.SetCmId
(transaction_id);
Table 2 Purchase with 3-D Secure transaction object optional values
November 2018 Page 260 of 476
![](asset-105.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set Method
Customer inform-
ation
Object N/A cavvPurchase.SetCustInfo
(customer);
AVS Object N/A cavvPurchase.SetAvsInfo
(avsCheck);
CVD Object N/A cavvPurchase.SetCvdInfo
(cvdCheck);
Convenience fee
NOTE: Not applicable
when processing
Apple Pay trans-
actions.
Object N/A cavvPurchase.SetConvFeeInfo
(convFeeInfo);
Page 261 of 476 November 2018
![](asset-106.png)
8 MPI
Value Type Limits Set Method
Recurring billing
recur
NOTE: For sample
code for a Purchase
with 3-DSecure includ-
ing the Recurring
Billing Info Object,
see 8.6.5.1 Purchase
with 3-D Secure and
Recurring Billing.
Object N/A cavvPurchase.SetRecur
(recurring_cycle);
Wallet indicator
NOTE: For Cavv
Purchase and Cavv
Pre-Authorization, wal-
let indicator applies to
Apple Pay or Android
Pay only. For more,
see Appendix A Defin-
itions of Request
Fields
String 3-character alpha-
numeric
cavvPurchase
.SetWalletIndicator(wallet_
indicator);
Credential on File Info
cof
NOTE: This is a nested
object within the
transaction, and
required when storing
or using the cus-
tomer's stored cre-
dentials. The
Credential on File Info
object has its own
request variables, lis-
ted in blue in the
table below, "Cre-
dential on File Object
Request Variables".
Object N/A cof.SetCofInfo(cof);
November 2018 Page 262 of 476
![](asset-107.png)
Moneris Gateway API- Integration Guide
Credential onFile Transaction Object Request Fields
Value Type Limits Set Method
Issuer ID
NOTE: This variable is
required for all mer-
chant-intiated trans-
actions following the
first one; upon sending
the first transaction,
the Issuer ID value is
received in the trans-
action response and
then used in sub-
sequent transaction
requests.
String 15-character alpha-
numeric
variable length
cof.SetIssuerId("VALUE_FOR_
ISSUER_ID");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Indicator String 1-character alphabetic cof.SetPaymentIndicator
("PAYMENT_INDICATOR_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Inform-
ation
String 1-character numeric cof.SetPaymentInformation
("PAYMENT_INFO_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Recurring Billing Info Object Request Fields
Variable and Field Name Type and Limits Description
Number of Recurs
num_recurs
String
numeric, 1-99
The number of times that the
transaction must recur
Period
period
String
numeric, 1-999
Number of recur units that
must pass between recurring
billings
Start Date String Date of the first future recurring
Page 263 of 476 November 2018
![](asset-108.png)
8 MPI
Variable and Field Name Type and Limits Description
start_date YYYY/MM/DD billing transaction
This value must be a date in the
future
If an additional charge is to be
made immediately, the value of
Start Now must be set to true
Start Now
start_now
String
true/false
If a single charge is to be made
against the card immediately,
set this value to true; the
amount to be billed imme-
diately may differ from the
amount billed on a regular
basis thereafter
If the billing is to start in the
future, set this value to false
When set to false, use Card Veri-
fication prior to sending the
Purchase with Recur and Cre-
dential on File objects
Recurring Amount
recur_amount
String
9-character decimal; Up to 6
digits (dollars)+ decimal point
+2 digits (cents) after the
decimal point
EXAMPLE:
123456.78
Amount of the recurring trans-
action
This is the amount that will be
billed on the Start Date and
then billed repeatedly based on
the interval defined by Period
and Recur Unit
Recur Unit
recur_unit
String
day, week, month or eom
Unit to be used as a basis for
the interval
Works in conjunction with
Period to define the billing fre-
quency
Possible values are:
day
week
November 2018 Page 264 of 476
![](asset-109.png)
Moneris Gateway API- Integration Guide
Variable and Field Name Type and Limits Description
month
eom (end of month)
Sample Purchase with 3-D Secure - cavvPurchase
namespace Moneris
{
using System;
using System.Collections;
public class TestCanadaCavvPurchase
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "CUS887H67";
string amount = "10.42";
string pan = "4242424242424242";
string expdate = "1901"; //YYMM
string cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA=";
string dynamic_descriptor = "123456";
string wallet_indicator = "APP";
string processing_country_code = "CA";
string crypt_type = "5";
bool status_check = false;
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("168451306048014");
CavvPurchase cavvPurchase = new CavvPurchase();
cavvPurchase.SetOrderId(order_id);
cavvPurchase.SetCustId(cust_id);
cavvPurchase.SetAmount(amount);
cavvPurchase.SetPan(pan);
cavvPurchase.SetExpDate(expdate);
cavvPurchase.SetCavv(cavv);
cavvPurchase.SetCryptType(crypt_type); //Mandatory for AMEX cards only
cavvPurchase.SetDynamicDescriptor(dynamic_descriptor);
//cavvPurchase.SetNetwork("Interac"); //set only for Interac e-commerce
//cavvPurchase.SetDataType("3DSecure"); //set only for Interac e-commerce
//cavvPurchase.SetWalletIndicator(wallet_indicator); //set only wallet transactions e.g. APPLE PAY
//cavvPurchase.SetCmId("8nAK8712sGaAkls56"); //set only for usage with Offlinx - Unique max 50
alphanumeric characters transaction id generated by merchant
cavvPurchase.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(cavvPurchase);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Page 265 of 476 November 2018
![](asset-10a.png)
8 MPI
Sample Purchase with 3-D Secure - cavvPurchase
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
8.6.5.1 Purchase with 3-D Secure and Recurring Billing
The example below illustrates the Purchase with 3-D Secure when also sending the Recurring Billing Info
object in the transaction.
Purchase with 3-D Secure and Recurring Billing
namespace Moneris
{
using System;
using System.Collections;
public class TestCanadaCavvPurchase
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "CUS887H67";
string amount = "10.42";
string pan = "4242424242424242";
string expdate = "1901"; //YYMM
string cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA=";
string dynamic_descriptor = "123456";
string wallet_indicator = "APP";
string processing_country_code = "CA";
string crypt_type = "5";
bool status_check = false;
November 2018 Page 266 of 476
![](asset-10b.png)
Moneris Gateway API- Integration Guide
Purchase with 3-D Secure and Recurring Billing
/************************* Recur Variables **********************************/
string recur_unit = "month"; //eom = end of month
string start_now = "true";
string start_date = "2018/02/25";
string num_recurs = "12";
string period = "1";
string recur_amount = "30.00";
/************************* Recur Object Option1 ******************************/
Recur recurring_cycle = new Recur(recur_unit, start_now, start_date,
num_recurs, period, recur_amount);
/************************* Recur Object Option2 ******************************/
Hashtable recur_hash = new Hashtable();
recur_hash.Add("recur_unit", recur_unit);
recur_hash.Add("start_now", start_now);
recur_hash.Add("start_date", start_date);
recur_hash.Add("num_recurs", num_recurs);
recur_hash.Add("period", period);
recur_hash.Add("recur_amount", recur_amount);
Recur recurring_cycle2 = new Recur(recur_hash);
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("R");
cof.SetPaymentInformation("2");
cof.SetIssuerId("168451306048014");
CavvPurchase cavvPurchase = new CavvPurchase();
cavvPurchase.SetOrderId(order_id);
cavvPurchase.SetCustId(cust_id);
cavvPurchase.SetAmount(amount);
cavvPurchase.SetPan(pan);
cavvPurchase.SetExpDate(expdate);
cavvPurchase.SetCavv(cavv);
cavvPurchase.SetCryptType(crypt_type); //Mandatory for AMEX cards only
cavvPurchase.SetDynamicDescriptor(dynamic_descriptor);
//cavvPurchase.SetNetwork("Interac"); //set only for Interac e-commerce
//cavvPurchase.SetDataType("3DSecure"); //set only for Interac e-commerce
//cavvPurchase.SetWalletIndicator(wallet_indicator); //set only wallet transactions e.g. APPLE PAY
cavvPurchase.SetRecur(recurring_cycle);
cavvPurchase.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(cavvPurchase);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Page 267 of 476 November 2018
![](asset-10c.png)
8 MPI
Purchase with 3-D Secure and Recurring Billing
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
8.6.6 Pre-Authorization with 3-DSecure – cavvPreauth
The Pre-Authorization with 3-DSecure transaction follows a 3-D Secure MPI authentication. After receiv-
ing confirmation from the MPI ACS transaction, this Pre-Authorization verifies funds on the customer’s
card, removes the funds and prepares them for deposit into the merchant’s account.
To perform the 3-D Secure authentication, the Moneris MPIor any 3rd party MPI may be used.
This transaction can also be used to process an Apple Pay transaction. This transaction is applicable only
if choosing to integrate directly to Apple Wallet (if not using the Moneris Apple Pay SDK). Please refer to
10 Apple Pay In-App and on the Web Integration for more details on your integration options.
Refer to Apple's developer portal for details on integrating directly to the wallet to retrieve the payload
data.
Pre-Authorization with 3-DSecure transaction object definition
CavvPreAuth cavvPreauth = new CavvPreAuth();
HttpsPostRequest object for Pre-Authorization with 3-DSecure transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(cavvPreauth);
Pre-Authorization with 3-DSecure transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
November 2018 Page 268 of 476
![](asset-10d.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
cavvPreauth.SetOrderId
(order_id);
Amount String 9-character decimal cavvPreauth.SetAmount
(amount);
Credit card number String 20-character numeric cavvPreauth.SetPan(pan);
Cardholder Authentic-
ation Verification
Value (CAVV)
NOTE: For Apple Pay
Cavv Purchase and
Cavv Pre-Authorization
transactions, CAVV
field contains the
decrypted cryptogram.
For more, see
Appendix A Definitions
of Request Fields.
String 50-character alpha-
numeric
cavvPreauth.SetCavv(cavv);
Expiry date String 4-character numeric cavvPreauth.SetExpdate
(expiry_date);
E-commerce indicator
NOTE: For Apple Pay
Cavv Purchase and
Cavv Pre-Authorization
transactions, the E-
commerce indicator is
a mandatory field con-
taining the value
received from the
decrypted payload or a
default value of 5. If
you get a 2-character
value (e.g.,. 05 or 07)
from the payload,
remove the initial 0
and just send us the
2nd character. For
more, see Appendix A
Definitions of Request
Fields.
String 1-character alpha-
numeric
cavvPreauth.SetCryptType
(crypt);
Table 79: Pre-Authorization with 3-DSecure object mandatory values
Page 269 of 476 November 2018
![](asset-10e.png)
8 MPI
Variable and Field
Name Type Limits Set Method
Network
NOTE: This request
variable is mandatory
for INTERAC® e-Com-
merce transactions con-
ducted via Apple Pay,
and is not for use with
credit card trans-
actions.
String alphabetical cavvPurchase.setNetwork
(network);
Data Type
NOTE: This request
variable is mandatory
for INTERAC® e-Com-
merce transactions con-
ducted via Apple Pay,
and is not for use with
credit card trans-
actions.
String 3-character alpha-
numeric
cavvPurchase.setDataType
(data_type);
Table 1 INTERAC® e-Commerce Fields – Required for Apple Pay and Google Pay Only
Value Type Limits Set method
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Customer ID String 50-character alpha-
numeric
cavvPreauth.SetCustId(cust_
id);
Dynamic descriptor String 20-character alpha-
numeric
cavvPreauth
.SetDynamicDescriptor
(dynamic_descriptor);
CardMatch ID
NOTE: Applies to Off-
linx™ only; must be
unique value for each
transaction
String 50-character alpha-
numeric
cavvPreauth.SetCmId
(transaction_id);
Table 2 Pre-Authorization with 3-DSecure object optional values
November 2018 Page 270 of 476
![](asset-10f.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
AVS Object N/A cavvPreauth.SetAvsInfo
(avsCheck);
CVD Object N/A cavvPreauth.SetCvdInfo
(cvdCheck);
Wallet indicator
NOTE: For Cavv
Purchase and Cavv
Pre-Authorization, wal-
let indicator applies to
Apple Pay or Android
Pay only. For more,
see Appendix A Defin-
itions of Request
Fields
String 3-character alpha-
numeric
cavvPreauth
.SetWalletIndicator(wallet_
indicator);
Credential on File Info
cof
NOTE: This is a nested
object within the
transaction, and
required when storing
or using the cus-
tomer's stored cre-
dentials. The
Credential on File Info
object has its own
request variables, lis-
ted in blue in the
table below, "Cre-
dential on File Object
Request Variables".
Object N/A cof.SetCofInfo(cof);
Page 271 of 476 November 2018
![](asset-110.png)
8 MPI
Credential onFile Transaction Object Request Fields
Value Type Limits Set Method
Issuer ID
NOTE: This variable is
required for all mer-
chant-intiated trans-
actions following the
first one; upon sending
the first transaction,
the Issuer ID value is
received in the trans-
action response and
then used in sub-
sequent transaction
requests.
String 15-character alpha-
numeric
variable length
cof.SetIssuerId("VALUE_FOR_
ISSUER_ID");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Indicator String 1-character alphabetic cof.SetPaymentIndicator
("PAYMENT_INDICATOR_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Payment Inform-
ation
String 1-character numeric cof.SetPaymentInformation
("PAYMENT_INFO_VALUE");
NOTE: For a list and explanation of the
possible values to send for this variable,
see Definitions of Request Fields – Cre-
dential on File
Sample Pre-Authorization with 3-DSecure – cavvPreauth
namespace Moneris
{
using System;
using System.Collections;
public class TestCanadaCavvPreauth
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "CUS887H67";
string amount = "10.42";
string pan = "4242424242424242";
string expdate = "1911"; //YYMM format
November 2018 Page 272 of 476
![](asset-111.png)
Moneris Gateway API- Integration Guide
Sample Pre-Authorization with 3-DSecure – cavvPreauth
string cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA=";
string dynamic_descriptor = "123456";
string wallet_indicator = "APP";
string processing_country_code = "CA";
string crypt_type = "5";
bool status_check = false;
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("168451306048014");
CavvPreAuth cavvPreauth = new CavvPreAuth();
cavvPreauth.SetOrderId(order_id);
cavvPreauth.SetCustId(cust_id);
cavvPreauth.SetAmount(amount);
cavvPreauth.SetPan(pan);
cavvPreauth.SetExpDate(expdate);
cavvPreauth.SetCavv(cavv);
cavvPreauth.SetCryptType(crypt_type); //Mandatory for AMEX cards only
cavvPreauth.SetDynamicDescriptor(dynamic_descriptor);
//cavvPreauth.SetWalletIndicator(wallet_indicator); //set only wallet transactions e.g. APPLE PAY
//cavvPreauth.SetCmId("8nAK8712sGaAkls56"); //set only for usage with Offlinx - Unique max 50
alphanumeric characters transaction id generated by merchant
cavvPreauth.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(cavvPreauth);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
Page 273 of 476 November 2018
![](asset-112.png)
8 MPI
Sample Pre-Authorization with 3-DSecure – cavvPreauth
}
}
}
8.6.7 Cavv Result Codes for Verified by Visa
Code Message Significance
0 CAVV authentication results
invalid
For this transaction, you may not receive pro-
tection from chargebacks as a result of using VbV
because the CAVV was considered invalid at the
time the financial transaction was processed.
Check that you are following the VbV process cor-
rectly and passing the correct data in our trans-
actions.
1 CAVV failed validation;
authentication
Provided that you have implemented the VbV
process correctly, the liability for this transaction
should remain with the Issuer for chargeback
reason codes covered by Verified by Visa.
2 CAVV passed validation;
authentication
The CAVV was confirmed as part of the financial
transaction. This transaction is a fully authen-
ticated VbV transaction (ECI 5)
3 CAVV passed validation;
attempt
The CAVV was confirmed as part of the financial
transaction. This transaction is an attempted
VbV transaction (ECI 6)
4 CAVV failed validation;
attempt
Provided that you have implemented the VbV
process correctly the liability for this transaction
should remain with the Issuer for chargeback
reason codes covered by Verified by Visa.
7 CAVV failed validation;
attempt (US issued cards
only)
Please check that you are following the VbV pro-
cess correctly and passing the correct data in
your transactions.
Provided that you have implemented the VbV
process correctly the liability for this transaction
should be the same as an attempted transaction
(ECI 6)
Table 80: CAVV result codes for VbV
November 2018 Page 274 of 476
![](asset-113.png)
Moneris Gateway API- Integration Guide
Code Message Significance
8 CAVV passed validation;
attempt (US issued cards
only
The CAVV was confirmed as part of the financial
transaction. This transaction is an attempted
VbV transaction (ECI 6)
9 CAVV failed validation;
attempt (US issued cards
only)
Please check that you are following the VbV pro-
cess correctly and passing the correct data in our
transactions.
Provided that you have implemented the VbV
process correctly the liability for this transaction
should be the same as an attempted transaction
(ECI 6)
A CAVV passed validation;
attempt (US issued cards
only)
The CAVV was confirmed as part of the financial
transaction. This transaction is an attempted
VbV transaction (ECI 6)
B CAVV passed validation;
information only, no liability
shift
The CAVV was confirmed as part of the financial
transaction. However, this transaction does not
qualify for the liability shift. Treat this transaction
the same as an ECI 7.
Table 80: CAVV result codes for VbV (continued)
8.6.8 Vault Cavv Purchase
Vault Cavv Purchase transaction object definition
ResCavvPurchaseCC resCavvPurchaseCC = new ResCavvPurchaseCC();
HttpsPostRequest object for Vault Cavv Purchase transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resCavvPurchaseCC);
Page 275 of 476 November 2018
![](asset-114.png)
8 MPI
Vault Cavv Purchase transaction details
Value Type Limits Set method
Data Key String 25-character alpha-
numeric
resCavvPurchaseCC.SetData
(data_key);
Order ID String 50-character alpha-
numeric
resCavvPurchaseCC.SetOrderId
(order_id);
Amount String 9-character decimal resCavvPurchaseCC.SetAmount
(amount);
Cardholder Authentic-
ation Verification Value
(CAVV)
String 50-character alpha-
numeric
resCavvPurchaseCC.SetCavv
(cavv);
E-commerce indicator String 1-character alpha-
numeric
resCavvPurchaseCC
.SetCryptType(crypt);
Table 81: Vault Cavv Purchase transaction object mandatory values
Value Type Limits Set method
Customer ID String 50-character alpha-
numeric
resCavvPurchaseCC.SetCustId
(cust_id);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Expiry date String 4-character alpha-
numeric
(YYMMformat)
resCavvPurchaseCC.SetExpdate
(expiry_date);
Table 82: Vault Cavv Purchase transaction object optional values
Sample Vault Cavv Purchase
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResCavvPreauthCC
{
public static void Main(string[] args)
November 2018 Page 276 of 476
![](asset-115.png)
Moneris Gateway API- Integration Guide
Sample Vault Cavv Purchase
{
string store_id = "store1";
string api_token = "yesguy";
string data_key = "4INQR1A8ocxD0oafSz50LADXy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string amount = "1.00";
string cust_id = "customer1"; //if sent will be submitted, otherwise cust_id from profile will be
used
string cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA";
string expdate = "1911";
string processing_country_code = "CA";
bool status_check = false;
ResCavvPreauthCC resCavvPreauthCC = new ResCavvPreauthCC();
resCavvPreauthCC.SetOrderId(order_id);
resCavvPreauthCC.SetDataKey(data_key);
resCavvPreauthCC.SetCustId(cust_id);
resCavvPreauthCC.SetAmount(amount);
resCavvPreauthCC.SetCavv(cavv);
//resCavvPreauthCC.SetExpDate(expdate); //mandatory for temp token only
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resCavvPreauthCC);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
//ResolveData
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("Masked Pan = " + 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();
Page 277 of 476 November 2018
![](asset-116.png)
8 MPI
Sample Vault Cavv Purchase
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
8.6.9 Vault Cavv Pre-Authorization
Vault Cavv Pre-Authorization transaction object definition
ResCavvPreauthCC resCavvPreauthCC = new ResCavvPreauthCC();
HttpsPostRequest object for Vault Cavv Pre-Authorization
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(resCavvPreauthCC);
Vault Cavv Pre-Authorization transaction details
Value Type Limits Set method
Data Key String 25-character alpha-
numeric
resCavvPreauthCC.SetData
(data_key);
Order ID String 50-character alpha-
numeric
resCavvPreauthCC.SetOrderId
(order_id);
Amount String 9-character decimal resCavvPreauthCC.SetAmount
(amount);
CAVV String 50-character alpha-
numeric
resCavvPreauthCC.SetCavv
(cavv);
E-commerce indicator String 1-character alpha-
numeric
resCavvPreauthCC
.SetCryptType(crypt);
Table 83: Vault Cavv Pre-Authorization object mandatory values
November 2018 Page 278 of 476
![](asset-117.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
Customer ID String 50-character
alphanumeric resCavvPreauthCC.SetCustId
(cust_id);
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Expiry date String 4-character numeric resCavvPreauthCC.SetExpdate
(expiry_date);
Table 84: Vault Cavv Pre-Authorization object optional values
Sample Vault CavvPre-Authorization
namespace Moneris
{
using System;
using System.Text;
using System.Collections;
public class TestCanadaResCavvPreauthCC
{
public static void Main(string[] args)
{
string store_id = "store1";
string api_token = "yesguy";
string data_key = "4INQR1A8ocxD0oafSz50LADXy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string amount = "1.00";
string cust_id = "customer1"; //if sent will be submitted, otherwise cust_id from profile will be
used
string cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA";
string expdate = "1911";
string processing_country_code = "CA";
bool status_check = false;
ResCavvPreauthCC resCavvPreauthCC = new ResCavvPreauthCC();
resCavvPreauthCC.SetOrderId(order_id);
resCavvPreauthCC.SetDataKey(data_key);
resCavvPreauthCC.SetCustId(cust_id);
resCavvPreauthCC.SetAmount(amount);
resCavvPreauthCC.SetCavv(cavv);
//resCavvPreauthCC.SetExpDate(expdate); //mandatory for temp token only
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(resCavvPreauthCC);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("DataKey = " + receipt.GetDataKey());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Page 279 of 476 November 2018
![](asset-118.png)
8 MPI
Sample Vault CavvPre-Authorization
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
//ResolveData
Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
Console.WriteLine("Phone = " + receipt.GetResDataPhone());
Console.WriteLine("Email = " + receipt.GetResDataEmail());
Console.WriteLine("Note = " + receipt.GetResDataNote());
Console.WriteLine("Masked Pan = " + 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);
}
}
}
}
November 2018 Page 280 of 476
![](asset-11b.png)
9.1 Address Verification Service
l9.1.1 About Address Verification Service (AVS)
l9.1.2 AVS Info Object
l9.1.3 AVS Response Codes
l9.1.4 AVS Sample Code
9.1.1 About Address Verification Service (AVS)
Address Verification Service (AVS) is an optional fraud-prevention tool offered by issuing banks whereby a
cardholder's address is submitted as part of the transaction authorization. The AVSaddress is then com-
pared to the address kept on file at the issuing bank. AVS checks whether the street number, street
name and zip/postal code match. The issuing bank returns an AVSresult code indicating whether the
data was matched successfully. Regardless of the AVS result code returned, the credit card is authorized
by the issuing bank.
The response that is received from AVS verification is intended to provide added security and fraud pre-
vention, but the response itself does not affect the completion of a transaction. Upon receiving a
response, the choice to proceed with a transaction is left entirely to the merchant. The responses is not a
strict guideline of whether a transaction will be approved or declined.
The following transactions support AVS:
lPurchase (Basic and Mag Swipe)
lPre-Authorization (Basic)
lRe-Authorization (Basic)
lResAddCC (Vault)
lResUpdateCC (Vault)
Things to Consider:
lAVS is supported by Visa, MasterCard, American Express, Discover and JCB.
lWhen testing AVS, you must only use the Visa test card numbers 4242424242424242 or
4005554444444403, and the amounts described in the Simulator eFraud Response
Codes document available at the Moneris developer portal (https://developer-
.moneris.com).
lStore ID “store5” is set up to support AVS testing.
9.1.2 AVS Info Object
AVSInfo object definition
AvsInfo avsCheck = new AvsInfo();
November 2018 Page 283 of 476
![](asset-11c.png)
Moneris Gateway API- Integration Guide
Transaction object set method
<transaction>.setAvsInfo(avsCheck);
Variable and Field
Name Type and Limits Set Method Description
AVS street num-
ber
String
19-character alpha-
numeric
NOTE: this char-
acter limit is a
combined total
allowed for
AVSstreet number
and AVSstreet
name
avsCheck.SetAvsStreetNumber
("212");
Cardholder street
number
AVS street name String
19-character alpha-
numeric
NOTE: this char-
acter limit is the
combined total
allowed for
AVSstreet number
and AVSstreet
name
avsCheck.SetAvsStreetName
("Payton Street");
Cardholder street
name
AVS zip/postal
code
String
9-character alpha-
numeric
avsCheck.SetAvsZipCode
("M1M1M1");
Cardholder zip/-
postal code
Table 1 AVS Info Object – Required Fields
9.1.3 AVS Response Codes
Below is a full list of possible AVSresponse codes. These can be returned when you call the
receipt.GetAvsResultCode() method .
Page 284 of 476 November 2018
![](asset-11d.png)
Value Visa MasterCard/Discover Amex/JCB
A Street address matches, zip/postal code
does not. Acquirer rights not implied.
Address matches, zip/-
postal code does not.
Billing address
matches, zip/postal
code does not.
B Street address matches. Zip/Postal code not
verified due to incompatible formats.
(Acquirer sent both street address and zip/-
postal code.)
N/A N/A
C Street address not verified due to incom-
patible formats. (Acquirer sent both street
address and zip/postal code.)
N/A N/A
D Street address and zip/postal code match. N/A Customer name incor-
rect, zip/postal code
matches
E N/A N/A Customer name incor-
rect, billing address and
zip/postal code match
F (Applies to UK only) Street address and zip/-
postal code match.
N/A Customer name incor-
rect, billing address
matches.
G Address information not verified for inter-
national transaction. Any of the following
may be true:
lIssuer is not an AVS participant.
lAVS data was present in the request,
but issuer did not return an AVS res-
ult.
lVisa performs AVS on behalf of the
issuer and there was no address
record on file for this account.
N/A N/A
I Address information not verified. N/A N/A
K N/A N/A Customer name
matches.
L N/A N/A Customer name and
postal code match.
N/A N/A Customer name and
zip/postal code match.
Table 85: AVS result codes
November 2018 Page 285 of 476
![](asset-11e.png)
Moneris Gateway API- Integration Guide
Value Visa MasterCard/Discover Amex/JCB
M Street address and zip/postal code match. N/A Customer name, billing
address, and zip/postal
code match.
N No match.
Also used when acquirer requests AVS but
sends no AVS data.
Neither address nor
postal code matches.
Billing address and
postal code do not
match.
O N/A N/A Customer name and
billing address match
P Postal code matches. Acquirer sent both
postal code and street address, but street
address not verified due to incompatible
formats.
N/A N/A
R Retry: System unavailable or timed out.
Issuer ordinarily performs AVS, but was
unavailable.
The code R is used by Visa when issuers are
unavailable. Issuers should refrain from
using this code.
Retry. System unable to
process.
Retry. System unavail-
able.
S N/A AVS currently not sup-
ported.
AVS currently not sup-
ported.
T N/A Nine-digit zip/postal
code matches, address
does not match.
N/A
U Address not verified for domestic trans-
action. One of the following is true:
lIssuer is not an AVS participant
lAVS data was present in the request,
but issuer did not return an AVS res-
ult
lVisa performs AVS on behalf of the
issuer and there was no address
record on file for this account.
No data from
Issuer/Authorization
system.
Information is unavail-
able.
Table 85: AVS result codes (continued)
Page 286 of 476 November 2018
![](asset-11f.png)
Value Visa MasterCard/Discover Amex/JCB
W Not applicable. If present, replaced with ‘Z’
by Visa. Available for U.S. issuers only.
For US Addresses, nine-
digit zip/postal code
matches, address does
not. For addresses out-
side the US, zip/postal
code matches, address
does not.
Customer name, billing
address, and zip/postal
code are all correct.
X N/A For US addresses, nine-
digit zip/postal code
and address match. For
addresses outside the
US,zip/postal code and
address match.
N/A
Y Street address and zip/postal code match. For US addresses, five-
digit zip/postal code
and address match.
Billing address and zip/-
postal code match.
Z Zip/postal code matches, but street address
either does not match or street address was
not included in request.
For U.S. addresses, five-
digit zip code matches,
address does not
match.
Postal code matches,
billing address does not
match.
Table 85: AVS result codes (continued)
9.1.4 AVS Sample Code
This is a sample of Java code illustrating how AVS is implemented with a Purchase transaction. Purchase
object information that is not relevant to AVS has been removed.
For more about Purchase transactions, see 2.2 Purchase.
Sample Purchase with AVSinformation
AvsInfo avsCheck = new AvsInfo();
avsCheck.SetAvsStreetNumber("212");
avsCheck.SetAvsStreetName("Payton Street");
avsCheck.SetAvsZipCode("M1M1M1");
avsCheck.SetAvsEmail("test@host.com");
avsCheck.SetAvsHostname("hostname");
avsCheck.SetAvsBrowser("Mozilla");
avsCheck.SetAvsShiptoCountry("CAN");
avsCheck.SetAvsShipMethod("G");
avsCheck.SetAvsMerchProdSku("123456");
avsCheck.SetAvsCustIp("192.168.0.1");
avsCheck.SetAvsCustPhone("5556667777");
Purchase purchase = new Purchase();
purchase.SetAvsInfo(avsCheck);
November 2018 Page 287 of 476
![](asset-120.png)
9.2 Card Validation Digits (CVD)
l9.2.1 About Card Validation Digits (CVD)
l9.2.3 CVD Info Object
l9.2.4 CVD Result Codes
l9.2.5 Sample Purchase with CVD Info Object
9.2.1 About Card Validation Digits (CVD)
The Card Validation Digits (CVD) value is an additional number printed on credit cards that is used as an
additional check when verifying cardholder credentials during a transaction.
The response that is received from CVD verification is intended to provide added security and fraud pre-
vention, but the response itself does not affect the completion of a transaction. Upon receiving a
response, the choice whether to proceed with a transaction is left entirely to the merchant. The
responses is not a strict guideline of which transaction will approve or decline.
The following transactions support CVD:
lPurchase (Basic, Vault and Mag Swipe)
lPre-Authorization (Basic and Vault)
lRe-Authorization
Things to Consider:
lCVD is only supported by Visa, MasterCard, American Express, Discover, JCB and
UnionPay.
lFor UnionPay cards, the CVD response will not be returned; the issuer will approve or
decline based on the CVD result.
lWhen testing CVD, you must only use the Visa test card numbers 4242424242424242 or
4005554444444403, and the amounts described in the Simulator eFraud Response
Codes document available at the Moneris developer portal (https://developer-
.moneris.com).
lTest store_id “store5” is set up to support CVD testing.
9.2.2 Transactions Where CVDIs Required
The Card ValidationDigits (CVD) object is required in transaction requests in the following scenarios:
lInitial transactions when storing cardholder credentials in Credential on File scenarios; subsequent
follow-on transactions do not use CVD
lAny Purchase, Pre-Authorization or Card Verification where you are not storing cardholder cre-
dentials
November 2018 Page 288 of 476
![](asset-121.png)
Moneris Gateway API- Integration Guide
9.2.3 CVD Info Object
NOTE: The CVD value must only be passed to the Moneris Gateway. Under no cir-
cumstances may it be stored for subsequent uses or displayed as part of the receipt inform-
ation.
CvdInfo object definition
CvdInfo cvdCheck = new CvdInfo();
Transaction object set method
transaction.setCvdInfo(cvdCheck);
Variable and Field
Name Type and Limits Set Method Description
CVD indicator String
1-character
numeric
cvdCheck.SetCvdIndicator
("1");
Indicates presence
of CVD
Possible values:
0: CVD value is delib-
erately bypassed or is
not provided by the mer-
chant.
1: CVD value is present.
2: CVD value is on the
card, but is illegible.
9: Cardholder states that
the card has no CVD
imprint.
CVD value String
4-character
numeric
cvdCheck.SetCvdValue
("099");
CVDvalue located
on credit card
NOTE: The CVD
value must only be
passed to the Mon-
eris Gateway.
Under no cir-
cumstances may it
be stored for sub-
sequent uses or dis-
played as part of
Table 1 CVD Info Object – Required Fields
Page 289 of 476 November 2018
![](asset-122.png)
Variable and Field
Name Type and Limits Set Method Description
the receipt inform-
ation.
9.2.4 CVD Result Codes
Value Definition
M Match
N No match
P Not processed
S CVD should be on the card, but Merchant has
indicated that CVD is not present
U Issuer is not a CVD participant
Y Match for Amex/JCB only
D Invalid security code for Amex or JCB only
Other Invalid response code
9.2.5 Sample Purchase with CVD Info Object
This is a sample of Java code illustrating how CVD is implemented with a Purchase transaction. Purchase
object information that is not relevant to CVD has been removed.
Sample Purchase with CVD Information
CvdInfo cvdCheck = new CvdInfo();
cvdCheck.setCvdIndicator("1");
cvdCheck.setCvdValue("099");
Purchase purchase = new Purchase();
purchase.setCvdInfo(cvdCheck);
November 2018 Page 290 of 476
![](asset-123.png)
9.3 Transaction Risk Management Tool
l9.3.1 About the Transaction Risk Management Tool
l9.3.2 Introduction to Queries
l9.3.3 Session Query
l9.3.4 Attribute Query
l9.3.6 Inserting the Profiling Tags Into Your Website
l9.3.6 Inserting the Profiling Tags Into Your Website
The Transaction Risk Management Tool (TRMT) is available to Canadian integrations only.
9.3.1 About the Transaction Risk Management Tool
The Transaction Risk Management Tool provides additional information to assist in identifying fraud-
ulent transactions. To maximize the benefits from the Transaction Risk Management Tool, it is highly
recommended that you:
lCarefully consider the business logic and processes that you need to implement surrounding the
handling of response information the Transaction Risk Management Tool provides.
lImplement the other fraud tools available through Moneris Gateway (such as AVS, CVD, Verified
by Visa, MasterCard SecureCode and American Express SafeKey).
9.3.2 Introduction to Queries
There are two types of transactions associated with the Transaction Risk Management Tool (TRMT):
lSession Query (page 292)
lAttribute Query (page 299)
The Session Query and Attribute Query are used at the time of the transaction to obtain the risk assess-
ment.
Moneris recommends that you use the Session Query as much as possible for obtaining your risk assess-
ment because it uses the device fingerprint as well as other transaction information when providing the
risk scores.
To use the Session Query, you must implement two components:
lTags on your website to collect the device fingerprinting information
lSession Query transaction.
If you are not able to collect the necessary information for the Session Query (such as the device fin-
gerprint), then use the Attribute Query.
November 2018 CanadaOnly Page 291 of 476
![](asset-124.png)
Moneris Gateway API- Integration Guide
9.3.3 Session Query
Once a device profiling session has been initiated upon a client device, the Session Query API is used at
the time of the transaction or even to obtain a device identifier or ‘fingerprint’, attribute list and risk
assessment for the client device.
Session Query transaction object definition
SessionQuery sq = new SessionQuery();
HttpsPostRequest object for Session Query transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(sq);
Session Query transaction values
Value
Type Limits Set method
Description
Session ID String 9-character decimal
Permitted characters: [a-z], [A-Z],
0-9, _, -
sq.SetSessionId(session_id);
Web server session identifier generated when device profiling was initiated.
Service type String 9-character decimal sq.SetServiceType(service_type);
Which output fields are returned.
session -- returns IP and device related attributes.
Event type String payment sq.SetEventType(service_type);
Defines the type of transaction or event for reporting purposes.
payment - Purchasing of goods/services.
Credit card
number (PAN)
String 20-character numeric
No spaces or dashes
sq.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.
Table 86: Session Query transaction object mandatory values
Page 292 of 476 Canada Only November 2018
![](asset-125.png)
Value
Type Limits Set method
Description
Account
address street
1
String 32-character alphanumeric sq.SetAccountAddressStreet1
("3300 Bloor St W");
First portion of the street address component of the billing address.
Account
Address street
2
String 32-character alphanumeric sq.SetAccountAddressStreet2("4th
Flr West Tower");
Second portion of the street address component of the billing address.
Account
address city
String 50-character alphanumeric sq.SetAccountAddressCity
("Toronto");
The city component of the billing address.
Account
address state/-
province
String 64-character alphanumeric sq.SetAccountAddressState
("Ontario");
The state/province component of the billing address.
Account
address coun-
try
String 2-character alphanumeric sq.SetAccountAddressCountry
("CA");
ISO2 country code of the billing addresses.
Account
address ZIP/-
postal code
String 8-character alphanumeric sq.SetAccountAddressZip
("M8X2X2");
ZIP/postal code of the billing address.
Shipping
address street
1
String 32-character alphanumeric sq.SetAccountAddressStreet1
("3300 Bloor St W");
First portion of the street address component of the shipping address.
Shipping
address street
2
String 32-character alphanumeric sq.SetAccountAddressStreet2("4th
Flr West Tower");
Second portion of the street address component of the shipping address.
Shipping
address city
String 50-character alphanumeric sq.SetAccountAddressCity
("Toronto");
City component of the shipping address.
Shipping
address state/-
province
String 64-character alphanumeric sq.SetAccountAddressState
("Ontario");
The state/province component of the shipping address.
Table 86: Session Query transaction object mandatory values (continued)
November 2018 CanadaOnly Page 293 of 476
![](asset-126.png)
Moneris Gateway API- Integration Guide
Value
Type Limits Set method
Description
Shipping
address coun-
try
String 2-character alphanumeric sq.SetAccountAddressCountry
("CA");
ISO2 country code of the account address country.
Shipping
address ZIP
String 8-character alphanumeric sq.SetAccountAddressZip
("M8X2X2");
The ZIP/postal code component of the shipping address.
Local attribute
1-5
String 255-character alphanumeric sq.SetLocalAttrib1("a");
These five attributes can be used to pass custom attribute data. These are used if you
wish to correlate some data with the returned device information.
Transaction
amount
String 255-character alphanumeric
Must contain 2 decimal places
sq.SetTransactionAmount("1.00");
The numeric currency amount.
Transaction
currency
String 10-character numeric sq.SetTransactionCurrency
("840");
The currency type that the transaction was denominated in. If TransactionAmount is
passed, the TransactionCurrency is required.
Values to be used are:
lCAD – 124
lUSD – 840
Table 86: Session Query transaction object mandatory values (continued)
Value
Type Limits Set method
Description
Account login String 255-character
alphanumeric
sq.SetAccountLogin("13195417-8CA0-46cd-960D-
14C158E4DBB2");
The Account Login name.
Password
hash
String 40-character
alphanumeric
sq.SetPasswordHash
("489c830f10f7c601d30599a0deaf66e64d2aa50a");
The input must be a SHA-2 hash of the password in hexadecimal format. Used to check
if it is on a watch list.
Table 87: Session Query transaction object optional values
Page 294 of 476 Canada Only November 2018
![](asset-127.png)
Value
Type Limits Set method
Description
Account num-
ber
String 255-character
alphanumeric
sq.SetAccountNumber("3E17A905-AC8A-4c8d-A417-
3DADA2A55220");
The account number for the account.
Account name String 255-character
alphanumeric
sq.SetAccountName("4590FCC0-DF4A-44d9-A57B-
AF9DE98B84DD");
Account name (or concatenation of first and last name of account holder).
Account email String 100-character
alphanumeric
sq.SetAccountEmail("3CAE72EF-6B69-4a25-93FE-
2674735E78E8@test.threatmetrix.com");
The email address entered into the form for this contact. Used to check if this is a high
risk account email id.
Account tele-
phone
String 32-character
alphanumeric
Contact telephone number including country and city codes. All whitespace is
removed.
Must be in format: 0..9,<space>,(,),[,] braces must be matched.
Address street
1
String 32-character
alphanumeric
The first portion of the street address component of the account address.
Address street
2
String 32-character
alphanumeric
The second portion of the street address component of the account address.
Address city String 50-character
alphanumeric
The city component of the account address.
Address state/-
province
String 64-character
alphanumeric
The state/province component of the account address
Address coun-
try
String 2-character
alphanumeric
The 2 character ISO2 country code of the account address country
Table 87: Session Query transaction object optional values (continued)
November 2018 CanadaOnly Page 295 of 476
![](asset-128.png)
Moneris Gateway API- Integration Guide
Value
Type Limits Set method
Description
Address ZIP String 8-character
alphanumeric
The ZIP/postal code of the account address.
Ship Address
Street 1
String 32-character
alphanumeric
The first portion of the street address component of the shipping address
Ship Address
Street 2
String 32-character
alphanumeric
The second portion of the street address component of the shipping address
Ship Address
City
String 50-character
alphanumeric
The city component of the shipping address
Ship Address
State/Province
String 64-character
alphanumeric
The state/province component of the shipping address
Ship Address
Country
String 2-character
alphanumeric
The 2 character ISO2 country code of the shipping address country
Ship Address
ZIP
String 8-character
alphanumeric
The ZIP/postal code of the shipping address
CCNumber
Hash
String 255-character
alphanumeric
This is a SHA-2 hash (in hexadecimal format) of the credit card number.
Custom Attrib-
ute 1-8
String 255-character
alphanumeric
These 8 attributes can be used to pass custom attribute data which can be used within
the rules.
Table 87: Session Query transaction object optional values (continued)
Page 296 of 476 Canada Only November 2018
![](asset-129.png)
Sample Session Query - CA
namespace Moneris
{
using System;
using System.Collections;
public class TestCanadaRiskCheckSession
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string session_id = "abc123";
string service_type = "session";
//string event_type = "LOGIN";
string processing_country_code = "CA";
bool status_check = false;
SessionQuery sq = new SessionQuery();
sq.SetOrderId(order_id);
sq.SetSessionId(session_id);
sq.SetServiceType(service_type);
sq.SetEventType(service_type);
//sq.SetPolicy("");
//sq.SetDeviceId("4EC40DE5-0770-4fa0-BE53-981C067C598D");
sq.SetAccountLogin("13195417-8CA0-46cd-960D-14C158E4DBB2");
sq.SetPasswordHash("489c830f10f7c601d30599a0deaf66e64d2aa50a");
sq.SetAccountNumber("3E17A905-AC8A-4c8d-A417-3DADA2A55220");
sq.SetAccountName("4590FCC0-DF4A-44d9-A57B-AF9DE98B84DD");
sq.SetAccountEmail("3CAE72EF-6B69-4a25-93FE-2674735E78E8@test.threatmetrix.com");
//sq.SetAccountTelephone("5556667777");
sq.SetPan("4242424242424242");
//sq.SetAccountAddressStreet1("3300 Bloor St W");
//sq.SetAccountAddressStreet2("4th Flr West Tower");
//sq.SetAccountAddressCity("Toronto");
//sq.SetAccountAddressState("Ontario");
//sq.SetAccountAddressCountry("CA");
//sq.SetAccountAddressZip("M8X2X2");
//sq.SetShippingAddressStreet1("3300 Bloor St W");
//sq.SetShippingAddressStreet2("4th Flr West Tower");
//sq.SetShippingAddressCity("Toronto");
//sq.SetShippingAddressState("Ontario");
//sq.SetShippingAddressCountry("CA");
//sq.SetShippingAddressZip("M8X2X2");
//sq.SetLocalAttrib1("a");
//sq.SetLocalAttrib2("b");
//sq.SetLocalAttrib3("c");
//sq.SetLocalAttrib4("d");
//sq.SetLocalAttrib5("e");
//sq.SetTransactionAmount("1.00");
//sq.SetTransactionCurrency("840");
//set SessionAccountInfo
sq.SetTransactionCurrency("CAN");
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(sq);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
November 2018 CanadaOnly Page 297 of 476
![](asset-12a.png)
Moneris Gateway API- Integration Guide
Sample Session Query - CA
try
{
Hashtable results = new Hashtable();
string[] rules;
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
// results = receipt.GetResult();
//Iterate through the response
// IDictionaryEnumerator r = results.GetEnumerator();
// while (r.MoveNext())
// {
// Console.WriteLine(r.Key.ToString() + " = " + r.Value.ToString());
// }
//Iterate through the rules that were fired
rules = receipt.GetRules();
for (int i = 0; i < rules.Length; i++)
{
Console.WriteLine("RuleName = " + rules[i]);
Console.WriteLine("RuleCode = " + receipt.GetRuleCode(rules[i]));
Console.WriteLine("RuleMessageEn = " + receipt.GetRuleMessageEn(rules[i]));
Console.WriteLine("RuleMessageFr = " + receipt.GetRuleMessageFr(rules[i]));
}
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
} // end TestRiskCheckSession
}
9.3.3.1 Session Query Transaction Flow
Figure 4: Session Query transaction flow
1. Cardholder logs onto the merchant website.
2. When the page has loaded in the cardholder's browser, special tags within the site allow inform-
ation from the device to be gathered and sent to ThreatMetrix as the device fingerprint.
The HTML tags should be placed where the cardholder is resident on the page for a couple of
seconds to get the broadest data possible.
3. Customer submits a transaction.
Page 298 of 476 Canada Only November 2018
![](asset-12b.png)
4. Merchant’s web application makes a Session Query transaction to the Moneris Gateway using
the same session id that was included in the device fingerprint. This call must be made within 30
minutes of profiling (2).
5. Moneris Gateway submits the Session Query data to ThreatMetrix.
6. ThreatMetrix uses the Session Query data and the device fingerprint information to assess the
transaction against the rules. A score is generated based on the rules.
7. The merchant uses the returned device information in its risk analysis to make a business
decision. The merchant may wish to continue or cancel with the cardholder’s payment trans-
action.
9.3.4 Attribute Query
The Attribute Query is used to obtain a risk assessment of transaction-related identifiers such as the
email address and the card number. Unlike the Session Query, the Attribute Query does not require the
device fingerprinting information to be provided.
AttributeQuery transaction object definition
AttributeQuery aq = new AttributeQuery();
HttpsPostRequest object for AttributeQuery transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
Attribute Query transaction values
Value
Type Limits Set method
Description
Service type String N/A aq.SetServiceType(service_type);
Which output fields are returned.
session -- returns IP and device related attributes.
Device ID String 36-character alphanumeric aq.SetDeviceId("");
Unique device identifier generated by a previous call to the ThreatMetrix session-
query API.
Credit card
number
String 20-character numeric
No spaces or dashes
aq.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.
Table 88: Attribute Query transaction object mandatory values
November 2018 CanadaOnly Page 299 of 476
![](asset-12c.png)
Moneris Gateway API- Integration Guide
Value
Type Limits Set method
Description
IPaddress String 64-character alphanumeric aq.SetIPAddress("192.168.0.1");
True IP address. Results will be returned as true_ip_geo, true_ip_score and so on.
IP forwarded String 64-character alphanumeric aq.SetIPForwarded
("192.168.1.0");
The IP address of the proxy. If the IPAddress is supplied, results will be returned as
proxy_ip_geo and proxy_ip_score.
If the IP Address is not supplied, this IP address will be treated as the true IP address
and results will be returned as true_ip_geo, true_ip_score and so on
Account
address street
1
String 32-character alphanumeric aq.SetAccountAddressStreet1
("3300 Bloor St W");
First portion of the street address component of the billing address.
Account
Address Street
2
String 32-character alphanumeric aq.SetAccountAddressStreet2("4th
Flr West Tower");
Second portion of the street address component of the billing address.
Account
address city
String 50-character alphanumeric aq.SetAccountAddressCity
("Toronto");
The city component of the billing address.
Account
address state/-
province
String 64-character alphanumeric aq.SetAccountAddressState
("Ontario");
The state component of the billing address.
Account
address coun-
try
String 2-character alphanumeric aq.SetAccountAddressCountry
("CA");
ISO2 country code of the billing addresses.
Account
address zip/-
postal code
String 8-character alphanumeric aq.SetAccountAddressZip
("M8X2X2");
Zip/postal code of the billing address.
Shipping
address street
1
String 32-character alphanumeric aq.SetShippingAddressStreet1
("3300 Bloor St W");
Account address country
Shipping
Address Street
2
String 32-character alphanumeric aq.SetShippingAddressStreet2
("4th Flr West Tower");
Second portion of the street address component of the shipping address.
Table 88: Attribute Query transaction object mandatory values (continued)
Page 300 of 476 Canada Only November 2018
![](asset-12d.png)
Value
Type Limits Set method
Description
Shipping
Address City
String 50-character alphanumeric aq.setShippingAddressCity
("Toronto");
City component of the shipping address.
Shipping
Address
State/Province
String 64-character alphanumeric aq.setShippingAddressState
("Ontario");
State/Province component of the shipping address.
Shipping
Address Coun-
try
String 2-character alphanumeric aq.setShippingAddressCountry
("CA");
ISO2 country code of the account address country.
Shipping
Address zip/-
postal code
String 8-character alphanumeric
The zip/postal code component of the shipping address.
Table 88: Attribute Query transaction object mandatory values (continued)
Sample Attribute Query
namespace Moneris
{
using System;
using System.Collections;
public class TestRiskCheckAttribute
{
public static void Main(string[] args)
{
string store_id = "moneris";
string api_token = "hurgle";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string service_type = "session";
string processing_country_code = "CA";
bool status_check = false;
AttributeQuery aq = new AttributeQuery();
aq.SetOrderId(order_id);
aq.SetServiceType(service_type);
aq.setDeviceId("");
aq.setAccountLogin("13195417-8CA0-46cd-960D-14C158E4DBB2");
aq.setPasswordHash("489c830f10f7c601d30599a0deaf66e64d2aa50a");
aq.setAccountNumber("3E17A905-AC8A-4c8d-A417-3DADA2A55220");
aq.setAccountName("4590FCC0-DF4A-44d9-A57B-AF9DE98B84DD");
aq.setAccountEmail("3CAE72EF-6B69-4a25-93FE-2674735E78E8@test.threatmetrix.com");
//aq.setCCNumberHash("4242424242424242");
//aq.setIPAddress("192.168.0.1");
//aq.setIPForwarded("192.168.1.0");
aq.setAccountAddressStreet1("3300 Bloor St W");
aq.setAccountAddressStreet2("4th Flr West Tower");
aq.setAccountAddressCity("Toronto");
aq.setAccountAddressState("Ontario");
aq.setAccountAddressCountry("CA");
aq.setAccountAddressZip("M8X2X2");
November 2018 CanadaOnly Page 301 of 476
![](asset-12e.png)
Moneris Gateway API- Integration Guide
Sample Attribute Query
aq.setShippingAddressStreet1("3300 Bloor St W");
aq.setShippingAddressStreet2("4th Flr West Tower");
aq.setShippingAddressCity("Toronto");
aq.setShippingAddressState("Ontario");
aq.setShippingAddressCountry("CA");
aq.setShippingAddressZip("M8X2X2");
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(aq);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Hashtable results = new Hashtable();
string[] rules;
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
results = receipt.GetResult();
//Iterate through the response
IDictionaryEnumerator response = results.GetEnumerator();
while (response.MoveNext())
{
Console.WriteLine(response.Key.ToString() + " = " + response.Value.ToString());
}
//Iterate through the rules that were fired
rules = receipt.GetRules();
for (int i = 0; i < rules.Length; i++)
{
Console.WriteLine("RuleName = " + rules[i]);
Console.WriteLine("RuleCode = " + receipt.GetRuleCode(rules[i]));
Console.WriteLine("RuleMessageEn = " + receipt.GetRuleMessageEn(rules[i]));
Console.WriteLine("RuleMessageFr = " + receipt.GetRuleMessageFr(rules[i]));
}
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
} // end TestRiskCheckAttribute
}
Page 302 of 476 Canada Only November 2018
![](asset-12f.png)
9.3.4.1 Attribute Query Transaction Flow
Figure 5: Attribute query transaction flow
1. Cardholder logs onto merchant website and submits a transaction.
2. The merchant’s web application makes an Attribute Query transaction that includes the session
ID to the Moneris Gateway.
3. Moneris Gateway submits Attribute Query data to ThreatMetrix.
4. ThreatMetrix uses the Attribute Query data to assess the transaction against the rules. A score is
generated based on the rules.
5. The merchant uses the returned device information in its risk analysis to make a business
decision. The merchant may wish to continue or cancel with the cardholder's payment trans-
action.
9.3.5 Handling Response Information
When reviewing the response information and determining how to handle the transaction, it is recom-
mended that you (either manually or through automated logic on your site) use the following pieces of
information:
lRisk score
lRules triggered (such as Rule Codes, Rule Names, Rule Messages)
lResults obtained from Verified by Visa, MasterCard Secure Code, AVS, CVD and the financial trans-
action authorization
lResponse codes for the Transaction Risk Management Transaction that are included by auto-
mated processes.
November 2018 CanadaOnly Page 303 of 476
![](asset-130.png)
Moneris Gateway API- Integration Guide
9.3.5.1 TRMT Response Fields
Value
Type Limits Get method
Definition
Response
Code
String 3-character alpha-
numeric
receipt.GetResponseCode();
001 – Success
981 – Data error
982 – Duplicate Order ID
983 – Invalid Transaction
984 – Previously asserted
985 – Invalid activity description
986- Invalid impact description
987 – Invalid Confidence description
988 - Cannot find Previous
Message String N/A receipt.GetMessage();
Response message
Event type String N/A
Type of transaction or event returned in the response.
Org ID String N/A
ThreatMetrix-defined unique transaction identifier
Policy String N/A
Policy used for the Session Query will be returned with the return request. If the Policy
was not included, then the Policy name default is returned.
Policy score String N/A
The sum of all the risks weights from triggered rules within the selected policy in the
range [-100…100]
Request dur-
ation
String N/A
Length of time it takes for the transaction to be processed.
Table 89: Receipt object response values for TRMT
Page 304 of 476 Canada Only November 2018
![](asset-131.png)
Value
Type Limits Get method
Definition
Request ID String N/A
Unique number and will always be returned with the return request.
Request res-
ult
String N/A
See 9.3.5.1 (page 304).
Review
status
String N/A
The transaction status based on the assessments and risk scores.
Risk rating String N/A
The rating based on the assessments and risk scores.
Service type String N/A
The service type will be returned in the attribute query response.
Session ID String N/A
Temporary identifier unique to the visitor will be returned in the return request.
Summary
risk score
String N/A
Based on all of the returned values in the range [-100 … 100]
Transaction
ID
String N/A
This is the transaction identifier and will always be returned in the response when sup-
plied as input.
Unknown
session
String N/A
If present, the value is "yes". It indicates the session ID that was passed was not found.
Table 89: Receipt object response values for TRMT (continued)
Value Definition
001 Success
981 Data error
982 Duplicate order ID
983 Invalid transaction
984 Previously asserted
985 Invalid activity description
Table 90: Response code descriptions
November 2018 CanadaOnly Page 305 of 476
![](asset-132.png)
Moneris Gateway API- Integration Guide
Value Definition
986 Invalid impact description
987 Invalid confidence description
988 Cannot find previous
Value Definition
fail_duplicate_entities_of_same_type More than one entity of the same was specified,
e.g. password_hash was specified twice.
fail_incomplete ThreatMetrix was unable to process the request
due to incomplete or incorrect input data
fail_invalid_account_number The format of the supplied account number was
invalid
fail_invalid_characters Invalid characters submitted
fail_invalid_charset The value of character set was invalid
fail_invalid_currency_code The format of the currency_code was invalid
fail_invalid_currency_format The format of the currency_format was invalid
fail_invalid_telephone_number Format of the supplied telephone number was
invalid
fail_access ThreatMetrix was unable to process the request
because of API verification failing
fail_internal_error ThreatMetrix encountered an error while pro-
cessing the request
fail_invalid_device_id Format of the supplied device_id was invalid
fail_invalid_email_address Format of the supplied email address was invalid
fail_invalid_fuzzy_device_id The format of fuzzy_device_id was invalid
fail_invalid_ip_address_parameter Format of a supplied ip_address parameter was
invalid
fail_invalid_parameter The format of the parameter was invalid, or the
Table 91: Request result values and descriptions
Page 306 of 476 Canada Only November 2018
![](asset-133.png)
Value Definition
value is out of boundary
fail_invalid_sha_hash The format of a parameter specified as a sha hash
was invalid, sha hash included sha1/2/3 hash
fail_invalid_submitter_id The format of the submitter id was invalid or the
value is out of boundary
fail_no_policy_configured No policy was configured against the org_id
fail_not_enough_params Not enough device attributes were collected dur-
ing profiling to perform a fingerprint match
fail_parameter_overlength The value of the parameter was overlength
fail_temporarily_unavailable Request failed because the service is temporarily
unavailable
fail_too_many_instances_of_same_parameter Multiple values for some parameters which only
allow one instance
fail_verification API query limit reached
success ThreatMetrix was able to process the request suc-
cessfully
9.3.5.2 Understanding the Risk Score
For each Session Query or Attribute Query, a score with a value between -100 and +100 is returned based
on the rules that were triggered for the transaction.
Table 92 defines the risk scores ranges.
Risk score Visa definition
-100 to -1 A lower score indicates a higher probability that the transaction is fraudulent.
0 Neutral transaction
1 to 100 A higher score indicates a lower probability that the transaction is fraudulent.
Note: All e-commerce transactions have some level of risk associated with them.
Therefore, it is rare to see risk score in the high positive values.
Table 92: Session Query and Attribute Query risk score definitions
November 2018 CanadaOnly Page 307 of 476
![](asset-134.png)
Moneris Gateway API- Integration Guide
When evaluating the risk of a transaction, the risk score gives an initial indicator of the potential risk that
the transaction is fraudulent. Because some of the rules that are evaluated on each transaction may not
be relevant to your business scenario, review the rules that were triggered for the transaction before
determining how to handle the transaction.
9.3.5.3 Understanding the Rule Codes, Rule Names and Rule Messages
The rule codes, rule names and rule messages provide details about what rules were triggered during the
assessment of the information provided in the Session or Attribute Query. Each rule code has a rule
name and rule message. The rule name and rule message are typically similar. Table 93 provides addi-
tional information on each rule.
When evaluating the risk of a transaction, it is recommended that you review the rules that were
triggered for the transaction and assess the relevance to your business. (That is, how does it relate to the
typical buying habits of your customer base?)
If you are automating some or all of the decision-making processes related to handling the responses,
you may want to use the rule codes. If you are documenting manual processes, you may want to refer to
the more user-friendly rule name or rule message.
Rule name Rule number Rule message
Rule explanation
White lists
DeviceWhitelisted WL001 Device White Listed
Device is on the white list. This indicates that the device has
been flagged as always "ok".
Note: This rule is currently not in use.
IPWhitelisted WL002 IP White Listed
IP address is on the white list. This indicates the device has
been flagged as always "ok".
Note: This rule is currently not in use.
EmailWhitelisted WL003 Email White Listed
Email address is on the white list. This indicates that the
device has been flagged as always "ok".
Note: This rule is currently not in use.
Event velocity
2DevicePayment EV003 2 Device Payment Velocity
Multiple payments were detected from this device in the
past 24 hours.
Table 93: Rule names, numbers and messages
Page 308 of 476 Canada Only November 2018
![](asset-135.png)
Rule name Rule number Rule message
Rule explanation
2IPPaymentVelocity EV006 2 IP Payment Velocity
Multiple payments were detected from this IP within the
past 24 hours.
2ProxyPaymentVelocity EV008 2 Proxy Payment Velocity
The device has used 3 or more different proxies during a 24
hour period. This could be a risk or it could be someone
using a legitimate corporate proxy.
Email
3EmailPerDeviceDay EM001 3 Emails for the Device ID in 1 Day
This device has presented 3 different email IDs within the
past 24 hours.
3EmailPerDeviceWeek EM002 3 emails for the Device ID in 1 week
This device has presented 3 different email IDs within the
past week.
3DevciePerEmailDay EM003 3 Device Ids for email address in 1 day
This email has been presented from three different devices
in the past 24 hours.
3DevciePerEmailWeek EM004 3 Device Ids for email address in 1 week
This email has been presented from three different devices
in the past week.
EmailDistanceTravelled EM005 Email Distance Travelled
This email address has been associated with different phys-
ical locations in a short period of time.
3EmailPerSmartIDHour EM006 3 Emails for SmartID in 1 Hour
The SmartID for this device has been associated with 3 dif-
ferent email addresses in 1 hour.
GlobalEMailOverOneMonth EM007 Global Email over 1 month
The e-mail address involved in the transaction over 30 days
ago. This generally indicates that the transaction is less
risky.
Note: This rule is set so that it does not impact the policy
score or risk rating.
ComputerGeneratedEmailAddress EM008 Computer Generated Email Address
Table 93: Rule names, numbers and messages (continued)
November 2018 CanadaOnly Page 309 of 476
![](asset-136.png)
Moneris Gateway API- Integration Guide
Rule name Rule number Rule message
Rule explanation
This transaction used a computer-generated email address.
Account Number
3AccountNumberPerDeviceDay AN001 3 Account Numbers for device in 1 day
This device has presented 3 different user accounts within
the past 24 hours.
3AccountNumberPerDeviceWeek AN002 3 Account Numbers for device in 1
week
This device has presented 3 different user accounts within
the past week.
3DevciePerAccountNumberDay AN003 3 Device IDs for account number in 1
day
This user account been used from three different devices in
the past 24 hours.
3DevciePerAccountNumberWeek AN004 3 Device IDs for account number in 1
week
This card number has been used from three different
devices in the past week.
AccountNumberDistanceTravelled AN005 Account Number distance travelled
This card number has been used from a number of phys-
ically different locations in a short period of time.
Credit card/payments
3CreditCardPerDeviceDay CP001 3 credit cards for device in 1 day
This device has used three credit cards within 24 hours.
3CreditCardPerDeviceWeek CP002 3 credit cards for device in 1 week
This device has used three credit cards within 1 week.
3DevicePerCreditCardDay CP003 3 device ids for credit card in 1 day
This credit card has been used on three different devices in
24 hours.
3DevciePerCreditCardWeek CP004 3 device ids for credit card in 1 week
This credit card has been used on three different devices in 1
week.
Table 93: Rule names, numbers and messages (continued)
Page 310 of 476 Canada Only November 2018
![](asset-137.png)
Rule name Rule number Rule message
Rule explanation
CredtCardDistanceTravelled CP005 Credit Card has travelled
The credit card has been used at a number of physically dif-
ferent locations in a short period of time.
CreditCardShipAddressGeoMismatch CP006 Credit Card and Ship Address do not
match
The credit card was issued in a region different from the Ship
To Address information provided.
CreditCardBillAddressGeoMismatch CP007 Credit Card and Billing Address do not
match
The credit card was issued in a region different from the
Billing Address information provided.
CreditCardDeviceGeoMismatch CP008 Credit Card and device location do not
match
The device is located in a region different from where the
card was issued.
CreditCardBINShipAddressGeoMismatch CP009 Credit Card issuing location and Ship-
ping address do not match
The credit card was issued in a region different from the Ship
To Address information provided.
CreditCardBINBillAddressGeoMismatch CP010 Credit Card issuing location and Billing
address do not match
The credit card was issued in a region different from the
Billing Address information provided.
CreditCardBINDeviceGeoMismatch CP011 Credit Card issuing location and loc-
ation of the device do not match
The device is located in a region different from where the
card was issued.
TransactionValueDay CP012 Daily Transaction Value Threshold
The transaction value exceeds the daily threshold.
TransactionValueWeek CP013 Weekly Transaction Value Threshold
The transaction value exceeds the weekly threshold.
Proxy rules
3ProxyPerDeviceDay PX001 3 Proxy Ips in 1 day
This device has used three different proxy servers in the past
24 hours.
Table 93: Rule names, numbers and messages (continued)
November 2018 CanadaOnly Page 311 of 476
![](asset-138.png)
Moneris Gateway API- Integration Guide
Rule name Rule number Rule message
Rule explanation
AnonymousProxy PX002 Anonymous Proxy IP
This device is using an anonymous proxy
UnusualProxyAttributes PX003 Unusual Proxy Attributes
This transaction is coming from a source with unusual proxy
attributes.
AnonymousProxy PX004 Anonymous Proxy
This device is connecting through an anonymous proxy con-
nection.
HiddenProxy PX005 Hidden Proxy
This device is connecting via a hidden proxy server.
OpenProxy PX006 Open Proxy
This transaction is coming from a source that is using an
open proxy.
TransparentProxy PX007 Transparent Proxy
This transaction is coming from a source that is using a trans-
parent proxy.
DeviceProxyGeoMismatch PX008 Proxy and True GEO Match
This device is connecting through a proxy server that didn’t
match the devices geo-location.
ProxyTrueISPMismatch PX009 Proxy and True ISP Match
This device is connecting through a proxy server that
doesn’t match the true IP address of the device.
ProxyTrueOrganizationMismatch PX010 Proxy and True Org Match
The Proxy information and True ISP information for this
source do not match.
DeviceProxyRegionMismatch PX011 Proxy and True Region Match
The proxy and device region location information do not
match.
ProxyNegativeReputation PX012 Proxy IP Flagged Risky in Reputation
Network
This device is connecting from a proxy server with a known
negative reputation.
Table 93: Rule names, numbers and messages (continued)
Page 312 of 476 Canada Only November 2018
![](asset-139.png)
Rule name Rule number Rule message
Rule explanation
SatelliteProxyISP PX013 Satellite Proxy
This transaction is coming from a source that is using a satel-
lite proxy.
GEO
DeviceCountriesNotAllowed GE001 True GEO in Countries Not Allowed
blacklist
This device is connecting from a high-risk geographic loc-
ation.
DeviceCountriesNotAllowed GE002 True GEO in Countries Not Allowed
(negative whitelist)
The device is from a region that is not on the whitelist of
regions that are accepted.
DeviceProxyGeoMismatch GE003 True GEO different from Proxy GEO
The true geographical location of this device is different from
the proxy geographical location.
DeviceAccountGeoMismatch GE004 Account Address different from True
GEO
This device has presented an account billing address that
doesn't match the devices geolocation.
DeviceShipGeoMismatch GE005 Device and Ship Geo mismatch
The location of the device and the shipping address do not
match.
DeviceShipGeoMismatch GE006 Device and Ship Geo mismatch
The location of the device and the shipping address do not
match.
Device
SatelliteISP DV001 Satellite ISP
This transaction is from a source that is using a satellite ISP.
MidsessionChange DV002 Session Changed Mid-session
This device changed session details and identifiers in the
middle of a session.
Table 93: Rule names, numbers and messages (continued)
November 2018 CanadaOnly Page 313 of 476
![](asset-13a.png)
Moneris Gateway API- Integration Guide
Rule name Rule number Rule message
Rule explanation
LanguageMismatch DV003 Language Mismatch
The language of the user does not match the primary lan-
guage spoken in the location where the True IP is registered.
NoDeviceID DV004 No Device ID
No device ID was available for this transaction.
Dial-upConnection DV005 Dial-up connection
This device uses a less identifiable dial-up connection.
DeviceNegativeReputation DV006 Device Blacklisted in Reputational Net-
work
This device has a known negative reputation as reported to
the fraud network.
DeviceGlobalBlacklist DV007 Device on the Global Black List
This device has been flagged on the global blacklist of known
problem devices.
DeviceCompromisedDay DV008 Device compromised in last day
This device has been reported as compromised in the last 24
hours.
DeviceCompromisedHour DV009 Device compromised in last hour
This device has been reported as compromised in the last
hour.
FlashImagesCookiesDisabled DV010 Flash Images Cookies Disabled
Key browser functions/identifiers have been disabled on
this device.
FlashCookiesDisabled DV011 Flash Cookies Disabled
Key browser functions/identifiers have been disabled on
this device.
FlashDisabled DV012 Flash Disabled
Key browser functions/identifiers have been disabled on
this device.
ImagesDisabled DV013 Images Disabled
Key browser functions/identifiers have been disabled on
this device.
Table 93: Rule names, numbers and messages (continued)
Page 314 of 476 Canada Only November 2018
![](asset-13b.png)
Rule name Rule number Rule message
Rule explanation
CookiesDisabled DV014 Cookies Disabled
Key browser functions/identifiers have been disabled on
this device.
DeviceDistanceTravelled DV015 Device Distance Travelled
The device has been used from multiple physical locations in
a short period of time.
PossibleCookieWiping DV016 Cookie Wiping
This device appears to be deleting cookies after each ses-
sion.
PossibleCookieCopying DV017 Possible Cookie Copying
This device appears to be copying cookies.
PossibleVPNConnection DV018 Possibly using a VPN Connection
This device may be using a VPN connection
Table 93: Rule names, numbers and messages (continued)
9.3.5.4 Examples of Risk Response
Session Query
Sample Risk Response - Session Query
<?xml version=”1.0”?>
<response>
<receipt>
<ResponseCode>001</ResponseCode>
<Message>Success</Message>
<Result>
<session_id>abc123</session_id>
<unknown_session>yes</unknown_session>
<event_type>payment</event_type>
<service_type>session</service_type>
<policy_score>-25</policy_score>
<transaction_id>riskcheck42</transaction_id>
<org_id>11kue096</org_id>
<request_id>91C1879B-33D4-4D72-8FCB-B60A172B3CAC</request_id>
<risk_rating>medium</risk_rating>
<request_result>success</request_result>
<summary_risk_score>-25</summary_risk_score>
<Policy>default</policy>
<review_status>review</review_status>
</Result>
<Rule>
<RuleName>ComputerGeneratedEMail</RuleName>
<RuleCode>UN001</RuleCode>
November 2018 CanadaOnly Page 315 of 476
![](asset-13c.png)
Moneris Gateway API- Integration Guide
Sample Risk Response - Session Query
<RuleMessageEn>Unknown Rule</RuleMessageEn>
<RuleMessageFr>Regle Inconnus</RuleMessageFr>
</Rule>
<Rule>
<RuleName>NoDeviceID</RuleName>
<RuleCode>DV004</RuleCode>
<RuleMessageEn>No Device ID</RuleMessageEn>
<RuleMessageFr>null</RuleMessageFr>
</Rule>
</receipt>
</response>
Attribute Query
Sample Risk Response - Attribute Query
<?xml version=”1.0”?>
<response>
<receipt>
<ResponseCode001</ReponseCode>
<Message = Success</Message>
<Result>
<org_id>11kue096</org_id>
<request_id>443D7FB5-CC5C-4917-A57E-27EAC824069C</request_id>
<service_type>session</service_type>
<risk_rating>medium</risk_rating>
<summary_risk_score>-25</summary_risk_score>
<request_result>success</request_result>
<policy>default</policy>
<policy_score>-25</policy_score>
<transaction_id>riskcheck19</transaction_id>
<review_status>review</review_status>
</Result>
<Rule>
<RuleName>ComputerGeneratedEMail</RuleName>
<RuleCode>UN001</RuleCode>
<RuleMessageEn>Unknown Rule</RuleMessageEn>
<RuleMessageFr>Regle Inconnus</RuleMessageFr>
</Rule>
<Rule>
<RuleName>NoDeviceID</RuleName>
<RuleCode>DV004</RuleCode>
<RuleMessageEn>No Device ID</RuleMessageEn>
<RuleMessageFr>null</RuleMessageFr>
</Rule>
</receipt>
</response>
9.3.6 Inserting the Profiling Tags Into Your Website
Place the profiling tags on an HTML page served by your web application such that ThreatMetrix can col-
lect device information from the customer’s web browser. The tags must be placed on a page that a vis-
itor would display in a browser window for 3-5 seconds (such as a page that requires a user to input
Page 316 of 476 Canada Only November 2018
![](asset-13d.png)
data). After the device is profiled, a Session Query may be used to obtain the detail device information
for risk assessment before submitting a financial payment transaction.
There are two profiling tags that require two variables. Those tags are org_id and session_id.ses-
sion_id must match the session ID value that is to be passed in the Session Query transaction. The
valid org_id values are:
11kue096
QA testing environment.
lbhqgx47
Production environment.
Below is an HTML sample of the profiling tags.
NOTE: Your site must replace <my_session_id> in the sample code with a unique alpha-
numeric value each time you fingerprint a new customer.
<p style="background:url(https://h.online-metrix.net/fp/clear.png?org_id=11kue096&session_id=<my_
session_id>&m=1)">
</p>
<img src="https://h.onlinemetrix.net/fp/clear.png?org_id=11kue096&session_id=<my_session_id>&m=2" alt=""
>
<script src="https://h.onlinemetrix.net/fp/check.js?org_id=11kue096&session_id=<my_session_id>"
type="text/javascript">
</script>
<object type="application/x-shockwave-flash"
data="https://h.onlinemetrix.net/fp/fp.swf?org_id=11kue096&session_id=<my_session_id>"
width="1" height="1" id="obj_id">
<param name="movie"
value="https://h.onlinemetrix.net/fp/fp.swf?org_id=11kue096&session_id=<my_session_id>" />
<div></div>
</object>
November 2018 CanadaOnly Page 317 of 476
![](asset-13e.png)
9.4 Encorporating All Available Fraud Tools
l9.4.1 Implementation Options for TRMT
l9.4.2 Implementation Checklist
l9.4.3 Making a Decision
To minimize fraudulent activity in online transactions, Moneris recommends that you implement all of
the fraud tools available through the Moneris Gateway. These are explained below:
Address Verification Service (AVS)
Verifies the cardholder's billing address information.
Verified by Visa, MasterCard Secure Code and Amex SafeKey (VbV/MCSC/SafeKey)
Authenticates the cardholder at the time of an online transaction.
Card Validation Digit (CVD)
Validates that cardholder is in possession of a genuine credit card during the transaction.
Note that all responses that are returned from these verification methods are intended to provide added
security and fraud prevention. The response itself does not affect the completion of a transaction. Upon
receiving a response, the choice to proceed with a transaction is left entirely to the merchant.
9.4.1 Implementation Options for TRMT
Option A
Process a Transaction Risk Management Tool query and obtain the response. You can then decide
whether to continue with the transaction, abort the transaction, or use additional efraud features.
If you want to use additional efraud features, perform one or both of the following to help make your
decision about whether to continue with the transaction or abort it:
lProcess a VbV/MCSC/SafeKey transaction and obtain the response. The merchant then makes the
decision whether to continue with the transaction or to abort it.
lProcess a financial transaction including AVS/CVD details and obtain the response. The merchant
then makes a decision whether to continue with the transaction or to abort it.
Option B
1. Process a Transaction Risk Management Tool query and obtain the response.
2. Process a VbV/MCSC/SafeKey transaction and obtain the response.
3. Process a financial transaction including AVS/CVD details and obtain the response.
4. Merchant then makes a one-time decision based on the responses received from the eFraud
tools.
9.4.2 Implementation Checklist
The following checklists provide high-level tasks that are required as part of your implementation of the
Transaction Risk Management Tool. Because each organization has certain project requirements for
implementing system and process changes, this list is only a guideline, and does not cover all aspects of
your project.
November 2018 Page 318 of 476
![](asset-13f.png)
Moneris Gateway API- Integration Guide
Download and review all of the applicable APIs and Integration Guides
Please review the sections outlined within this document that refers to the following feature
Document/API Use the document if you are….
Transaction Risk Management Tool Integration
Guide (Section #)
Implementing or updating your integration for the
Transaction Risk Management Tool
Moneris MPI – Verified by Visa/MasterCard
SecureCode/American Express SafeKey – Java API
Integration Guide
Implementing or updating Verified by Visa, Master-
Card SecureCode or AmericanExpress SafeKey
Basic transaction with VS andCVD (Section#) Implementing or updating transaction processing,
AVS or CVD
Table 94: API documentation
Design your transaction flow and business processes
When designing your transaction flow, think about which scenarios you would like to have automated,
and which scenarios you would like to have handled manually by your employees.
The “Understand Transaction Risk Management Transaction Flow” and Handling Response Information
(page 303) sections can help you work through the design of your transaction and process flows.
Things to consider when designing your process flows:
lProcesses for notifying people within your organization when there is scheduled maintenance for
Moneris Gateway.
lHandling refunds, canceled orders and so on.
lCommunicating with customers when you will not be shipping the goods because of suspected
fraud, back-ordered goods and so on.
Complete your development and testing
lThe Moneris Gateway API- Integration Guide provides the technical details required for the devel-
opment and testing. Ensure that you follow the testing instructions and data provided.
If you are an integrator
lEnsure that your solution meets the requirements for PCI-DSS/PA-DSS as applicable.
lSend an email to eproducts@moneris.com with the subject line “Certification Request”.
lDevelop material to set up your customers as quickly as possible with your solution and a Moneris
account. Include information such as:
lSteps they must take to enter their store ID or API token information into your solution.
Page 319 of 476 November 2018
![](asset-140.png)
lAny optional services that you support via Moneris Gateway (such as TRMT, AVS, CVD,
VBV/MCSC/SafeKey and so on) so that customers can request these features.
9.4.3 Making a Decision
Depending on your business policies and processes, the information obtained from the fraud tools (such
as AVS, CVD, VbV/MCSC/SafeKey and TRMT) can help you make an informed decision about whether to
accept a transaction or deny it because it is potentially fraudulent.
If you do not want to continue with a likely fraudulent transaction, you must inform the customer that
you are not proceeding with their transaction.
If you are attempting to do further authentication by using the available fraud tools, but you have
received an approval response instead, cancel the financial transaction by doing one of the following:
lIf the original transaction is a Purchase, use a Purchase Correction or Refund transaction. You will
need the original order ID and transaction number.
lIf the original transaction is a Pre-Authorization, use a Completion transaction for $0.00.
November 2018 Page 320 of 476
![](asset-141.png)
10 Apple Pay In-App and on the Web Integration
l10.1 About Apple Pay In-App and on the Web Integration10.1 About Apple Pay In-App and on the
Web Integration
l10.2 About API Integration of Apple Pay
l10.3 Apple Pay In-App Process Flows10.3 Apple Pay In-App Process Flows
l10.4 Cavv Purchase – Apple Pay 10.4 Cavv Purchase – Apple Pay
l10.5 Cavv Pre-Authorization – Apple Pay
10.1 About Apple Pay In-App and on the Web Integration
The Moneris Gateway enables merchants to process in-app or on the web payment methods in mobile
applications andthe Safari web browser on Apple devices via Apple Pay.
Moneris Solutions offers two processing and integration methods for Apple Pay. Merchants can choose
to use one of two methods:
lSoftware Development Kit (SDK), or
lAPI
While both methods provide the same basic payment features, there are differences in their imple-
mentations.
This guide only deals with the APImethod; for detailed information about the SDK method of integ-
ration, see the Moneris Developer Portal at https://developer.moneris.com.
10.2 About API Integration of Apple Pay
An API integration works to provide a communication link between the merchants’ server and Moneris’
server. APIs are required to complete any transaction, and therefore the APIs for Apple Pay are also
included within an SDK integration.
If the merchant chooses to use only an API integration, the merchant must decrypt payload information
themselves before sending the decrypted information to the Moneris Gateway to be processed. Because
this process is complicated, Apple recommend only businesses with expertise and a previously integ-
rated payment processing system use APIs instead of SDKs.
10.2.1 Transaction Types That Use Apple Pay
In the Moneris Gateway API, there are two transaction types that allow you to process decrypted trans-
action payload information with Apple Pay:
l10.4 Cavv Purchase – Apple Pay 10.4 Cavv Purchase – Apple Pay
l10.5 Cavv Pre-Authorization – Apple Pay
November 2018 Page 321 of 476
![](asset-142.png)
Moneris Gateway API- Integration Guide
NOTE: INTERAC® e-Commerce functionality is currently available using the Cavv
Purchase transaction type only.
Once you have processed the initial transaction using CavvPurchase or CavvPre-Authorization, if
required you can then process any of the following transactions:
lRefund (page 35)
lPre-Authorization Completion (page 25)
lPurchase Correction (page 33)
10.3 Apple Pay In-App Process Flows
For both API and SDK methods of mobile in-app integration, the merchant’s iOS app uses Apple’s PassKit
Framework to request and receive encrypted payment details from Apple. When payment details are
returned in their encrypted form, they can be decrypted and processed by the Moneris Gateway in one
of two ways: SDK or API.
Steps in the Apple Pay In-App and on the Web payment process
API
1. Merchant’s mobile application or web page requests and receives the encrypted payload.
2. Encrypted payload is sent to the merchant’s server, where it is decrypted.
Page 322 of 476 November 2018
![](asset-143.png)
10 Apple Pay In-App and on the Web Integration
3. Moneris Gateway receives the decrypted payload from the merchant’s server, and processes the
Cavv Purchase – Apple Pay (page 323)Cavv Purchase – Apple Pay (page 323) or Cavv Pre-Author-
ization – Apple Pay (page 327)Cavv Pre-Authorization – Apple Pay (page 327) transaction.
a. Please ensure the wallet indicator is properly populated with the correct value (APPfor
Apple Pay In-App or APW for Apple Pay on the Web).
SDK
1. Merchant's mobile application or web page requests and receives the encrypted payload.
2. Encrypted payload is sent from the merchant’s server to the Moneris Gateway, and the payload is
decrypted and processed.
This guide only deals with the APImethod; for detailed information about the SDK method of integ-
ration, see the Moneris Developer Portal at https://developer.moneris.com.
10.4 Cavv Purchase – Apple Pay
The Cavv Purchase for Apple Pay transaction follows a 3-D Secure model but it does not require an MPI.
Once the Apple Pay payload has been decrypted, this Purchase verifies funds on the customer’s card,
removes the funds and prepares them for deposit into the merchant’s account.
For Apple Pay processing, this transaction is only applicable if choosing to integrate directly to the Apple
Wallet (if not using the Moneris Apple Pay SDK). Please refer to 10 Apple Pay In-App and on the Web
Integration for more details on your integration options.
Refer to Apple's Developer Portal for details on integrating directly to Apple Wallet to retrieve the pay-
load data.
CavvPurchase transaction object definition
CavvPurchase cavvPurchase = new CavvPurchase();
HttpsPostRequest object for Cavv Purchase transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(cavvPurchase);
Cavv Purchase transaction values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
November 2018 Page 323 of 476
![](asset-144.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
cavvPurchase.SetOrderId
(order_id);
Amount String 9-character decimal cavvPurchase.SetAmount
(amount);
Credit card number String 20-character alpha-
numeric
cavvPurchase.SetPan(pan);
Expiry date String 4-character alpha-
numeric
YYMMformat
cavvPurchase.SetExpdate
(expiry_date);
CAVV
NOTE: For Apple Pay
Cavv Purchase and
Cavv Pre-Authorization
transactions, CAVV
field contains the
decrypted cryptogram.
For more, see
Appendix A Definitions
of Request Fields.
String 100-character alpha-
numeric
cavvPurchase.SetCavv(cavv);
E-commerce indicator
NOTE: For Apple Pay
Cavv Purchase and
Cavv Pre-Authorization
transactions, the E-
commerce indicator is
a mandatory field con-
taining the value
received from the
decrypted payload or a
default value of 5. If
you get a 2-character
value (e.g.,. 05 or 07)
from the payload,
remove the initial 0
and just send us the
2nd character. For
more, see Appendix A
Definitions of Request
Fields.
String 1-character alpha-
numeric
cavvPurchase.SetCryptType
(crypt);
Table 95: Cavv Purchase transaction object mandatory values
Page 324 of 476 November 2018
![](asset-145.png)
10 Apple Pay In-App and on the Web Integration
Value Type Limits Set Method
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Customer ID String 50-character alpha-
numeric
cavvPurchase.SetCustId(cust_
id);
Dynamic descriptor String 20-character alpha-
numeric
cavvPurchase
.SetDynamicDescriptor
(dynamic_descriptor);
Card Match ID
NOTE: Applies to Off-
linx™ only; must be
unique value for each
transaction
String 50-character alpha-
numeric
cavvPurchase.SetCmId
(transaction_id);
Customer information Object N/A cavvPurchase.SetCustInfo
(customer);
Network
NOTE: This request
variable is mandatory
for INTERAC® e-Com-
merce transactions
conducted via Apple
Pay, and is not for use
with credit card trans-
actions.
String alphabetical cavvPurchase.setNetwork
(network);
Data Type
NOTE: This request
variable is mandatory
for INTERAC® e-Com-
merce transactions
conducted via Apple
Pay, and is not for use
with credit card trans-
actions.
String 3-character alpha-
numeric
cavvPurchase.setDataType
(data_type);
Table 1 CavvPurchase transaction object optional values
November 2018 Page 325 of 476
![](asset-146.png)
Moneris Gateway API- Integration Guide
Sample Cavv Purchase for Apple Pay
namespace Moneris
{
using System;
using System.Collections;
public class TestCanadaCavvPurchase
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "CUS887H67";
string amount = "10.42";
string pan = "4242424242424242";
string expdate = "1901"; //YYMM
string cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA=";
string dynamic_descriptor = "123456";
string wallet_indicator = "APP";
string processing_country_code = "CA";
string crypt_type = "5";
bool status_check = false;
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("168451306048014");
CavvPurchase cavvPurchase = new CavvPurchase();
cavvPurchase.SetOrderId(order_id);
cavvPurchase.SetCustId(cust_id);
cavvPurchase.SetAmount(amount);
cavvPurchase.SetPan(pan);
cavvPurchase.SetExpDate(expdate);
cavvPurchase.SetCavv(cavv);
cavvPurchase.SetCryptType(crypt_type); //Mandatory for AMEX cards only
cavvPurchase.SetDynamicDescriptor(dynamic_descriptor);
//cavvPurchase.SetNetwork("Interac"); //set only for Interac e-commerce
//cavvPurchase.SetDataType("3DSecure"); //set only for Interac e-commerce
//cavvPurchase.SetWalletIndicator(wallet_indicator); //set only wallet transactions e.g. APPLE PAY
//cavvPurchase.SetCmId("8nAK8712sGaAkls56"); //set only for usage with Offlinx - Unique max 50
alphanumeric characters transaction id generated by merchant
cavvPurchase.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(cavvPurchase);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Page 326 of 476 November 2018
![](asset-147.png)
10 Apple Pay In-App and on the Web Integration
Sample Cavv Purchase for Apple Pay
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
10.5 Cavv Pre-Authorization – Apple Pay
The Cavv Pre-Authorization for Apple Pay transaction follows a 3-D Secure model but it does not require
an MPI. Once the Apple Pay payload has been decrypted, this Pre-Authorization verifies funds on the cus-
tomer’s card, and holds the funds. To prepare the funds for deposit into the merchant’s account please
process a Pre-Authorization Completion transaction.
For Apple Pay processing, this transaction is only applicable if choosing to integrate directly to the Apple
Wallet (if not using the Moneris Apple Pay SDK). Please refer to 10 Apple Pay In-App and on the Web
Integration for more details on your integration options.
Refer to Apple's Developer Portal for details on integrating directly to Apple Wallet to retrieve the pay-
load data.
NOTE: INTERAC® e-Commerce functionality is currently available using the Cavv
Purchase transaction type only.
Cavv Pre-Authorization transaction object definition
CavvPreAuth cavvPreauth = new CavvPreAuth();
HttpsPostRequest object for Cavv Pre-Authorization transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(cavvPreauth);
November 2018 Page 327 of 476
![](asset-148.png)
Moneris Gateway API- Integration Guide
Cavv Pre-Authorization transaction values
Value Type Limits Set method
Order ID String 50-character alpha-
numeric
cavvPreauth.SetOrderId
(order_id);
Amount String 9-character decimal cavvPreauth.SetAmount
(amount);
Credit card number String 20-character numeric cavvPreauth.SetPan(pan);
Cardholder Authentic-
ation Verification
Value (CAVV)
NOTE: For Apple Pay
Cavv Purchase and
Cavv Pre-Authorization
transactions, CAVV
field contains the
decrypted cryptogram.
For more, see
Appendix A Definitions
of Request Fields.
String 50-character alpha-
numeric
cavvPreauth.SetCavv(cavv);
Expiry date String 4-character numeric cavvPreauth.SetExpdate
(expiry_date);
E-commerce indicator
NOTE: For Apple Pay
Cavv Purchase and
Cavv Pre-Authorization
transactions, the E-
commerce indicator is
a mandatory field con-
taining the value
received from the
decrypted payload or a
default value of 5. If
you get a 2-character
value (e.g.,. 05 or 07)
from the payload,
remove the initial 0
and just send us the
2nd character. For
more, see Appendix A
Definitions of Request
Fields.
String 1-character alpha-
numeric
cavvPreauth.SetCryptType
(crypt);
Table 96: Cavv Pre-Authorization object mandatory values
Page 328 of 476 November 2018
![](asset-149.png)
10 Apple Pay In-App and on the Web Integration
Value Type Limits Set method
Status Check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Customer ID String 50-character alpha-
numeric
cavvPreauth.SetCustId(cust_
id);
Dynamic descriptor String 20-character alpha-
numeric
cavvPreauth
.SetDynamicDescriptor
(dynamic_descriptor);
Card Match ID
NOTE: Applies to Off-
linx™ only; must be
unique value for each
transaction
String 50-character alpha-
numeric
cavvPreauth.SetCmId
(transaction_id);
Network
NOTE: This request
variable is mandatory
for INTERAC® e-Com-
merce transactions
conducted via Apple
Pay, and is not for use
with credit card trans-
actions.
String alphabetical cavvPurchase.setNetwork
(network);
Data Type
NOTE: This request
variable is mandatory
for INTERAC® e-Com-
merce transactions
conducted via Apple
Pay, and is not for use
with credit card trans-
actions.
String 3-character alpha-
numeric
cavvPurchase.setDataType
(data_type);
Table 1 Cavv Pre-Authorization object optional values
Sample Cavv Pre-Authorization for Apple Pay
namespace Moneris
November 2018 Page 329 of 476
![](asset-14a.png)
Moneris Gateway API- Integration Guide
Sample Cavv Pre-Authorization for Apple Pay
{
using System;
using System.Collections;
public class TestCanadaCavvPreauth
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "CUS887H67";
string amount = "10.42";
string pan = "4242424242424242";
string expdate = "1911"; //YYMM format
string cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA=";
string dynamic_descriptor = "123456";
string wallet_indicator = "APP";
string processing_country_code = "CA";
string crypt_type = "5";
bool status_check = false;
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("U");
cof.SetPaymentInformation("2");
cof.SetIssuerId("168451306048014");
CavvPreAuth cavvPreauth = new CavvPreAuth();
cavvPreauth.SetOrderId(order_id);
cavvPreauth.SetCustId(cust_id);
cavvPreauth.SetAmount(amount);
cavvPreauth.SetPan(pan);
cavvPreauth.SetExpDate(expdate);
cavvPreauth.SetCavv(cavv);
cavvPreauth.SetCryptType(crypt_type); //Mandatory for AMEX cards only
cavvPreauth.SetDynamicDescriptor(dynamic_descriptor);
//cavvPreauth.SetWalletIndicator(wallet_indicator); //set only wallet transactions e.g. APPLE PAY
//cavvPreauth.SetCmId("8nAK8712sGaAkls56"); //set only for usage with Offlinx - Unique max 50
alphanumeric characters transaction id generated by merchant
cavvPreauth.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(cavvPreauth);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Page 330 of 476 November 2018
![](asset-14b.png)
10 Apple Pay In-App and on the Web Integration
Sample Cavv Pre-Authorization for Apple Pay
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
November 2018 Page 331 of 476
![](asset-14c.png)
Moneris Gateway API- Integration Guide
11 Offlinx™
lWhat Is a Pixel Tag?
lOfflinx™ and API Transactions
11.1 What Is a Pixel Tag?
A pixel tag is a piece of code that goes on a web page and requests an image file (a tiny transparent image
or pixel) when loaded, which, while not visible to the user, allows Offlinx™ to gather relevant information
about the user.
The data collected by our pixel tag is:
lAnonymous (not personally identifiable) and compliant with privacy standards
lSecure — utilizes SSL communication to transmit the data securely
lNot shared with anyone
11.2 Offlinx™ and API Transactions
The Offlinx™ Card Match pixel tag feature can be implemented via the UnifiedAPI with the CardMatch
IDvariable, which corresponds to the TransactionID in Offlinx™. The Card Match IDmust be a unique
value for each transaction.
For more information about the Offlinx™ solution, consult the Offlinx™ Pixel TagSetup Guide available
from your account/service manager.
APItransactions where this applies:
lPurchase
lPre-Authorization
lPurchase with 3-D Secure – cavvPurchase
lPre-Authorization with 3-DSecure – cavvPreauth
lCavv Purchase – Apple Pay
lCavv Pre-Authorization – Apple Pay
Page 332 of 476 November 2018
![](asset-14d.png)
12 Convenience Fee
l12.1 About Convenience Fee
l12.2 Purchase with Convenience Fee
l12.3 Convenience Fee Purchase w/ Customer Information
l12.4 Convenience Fee Purchase with VbV, MCSC and Amex SafeKey
12.1 About Convenience Fee
The Convenience Fee program was designed to allow merchants to offer the convenience of an altern-
ative payment channel to the cardholder at a charge. This applies only when providing a true "con-
venience" in the form of an alternative payment channel outside the merchant's customary face-to-face
payment channels. The convenience fee will be a separate charge on top of what the consumer is paying
for the goods and/or services they were given, and this charge will appear as a separate line item on the
consumer’s statement.
NOTE: The Convenience Fee program is only offered to certain supported Merchant Cat-
egory Codes (MCCs). Please speak to your account manager for further details.
12.2 Purchase with Convenience Fee
NOTE: Convenience Fee Purchase with Customer Information is also supported.
Convenience Fee Purchase transaction object definition
Purchase purchase = new Purchase();
HttpsPostRequest object for Convenience Fee Purchase transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(purchase);
Convenience Fee Purchase transaction object values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
November 2018 Page 333 of 476
![](asset-14e.png)
Moneris Gateway API- Integration Guide
Value Type Limits SetMethod
Convenience Fee Object n/a purchase.SetConvFeeInfo
(convFeeInfo);
Order ID String 50-character alpha-
numeric
purchase.SetOrderId(order_
id);
Amount String 9-character decimal purchase.SetAmount(amount);
Credit card number String 20-character numeric purchase.SetPan(pan);
Expiry date String 4-character numeric
YYMM format
purchase.SetExpdate(expiry_
date);
E-commerce indicator String 1-character alpha-
numeric
purchase.SetCryptType
(crypt);
Convenience fee
amount
String 9-character decimal .SetConvFeeInfo(convfee_
amount);
Table 1 Convenience Fee Purchase transaction object mandatory values
Value Type Limits Set Method
Customer ID String 50-character alpha-
numeric
purchase.SetCustId(cust_id);
Dynamic descriptor String 20-character alpha-
numeric
purchase
.SetDynamicDescriptor
(dynamic_descriptor);
AVSinformation Object purchase.SetAvsInfo
(avsCheck);
CVD information Object purchase.SetCvdInfo
(cvdCheck);
Table 2 Convenience Fee Purchase transaction object optional values
Sample Purchase with Convenience Fee
namespace Moneris
{
using System;
public class TestCanadaConvFeePurchase
{
Page 334 of 476 November 2018
![](asset-14f.png)
12 Convenience Fee
Sample Purchase with Convenience Fee
public static void Main(string[] args)
{
string store_id = "monca00392";
string api_token = "qYdISUhHiOdfTr1CLNpN";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string amount = "5.00";
string pan = "4242424242424242";
string expdate = "1602"; //YYMM format
string crypt = "7";
string convenience_fee = "1.00";
string processing_country_code = "CA";
bool status_check = false;
ConvFeeInfo convFeeInfo = new ConvFeeInfo();
convFeeInfo.SetConvenienceFee(convenience_fee);
Purchase purchase = new Purchase();
purchase.SetOrderId(order_id);
purchase.SetAmount(amount);
purchase.SetPan(pan);
purchase.SetExpDate(expdate);
purchase.SetCryptType(crypt);
purchase.SetConvFeeInfo(convFeeInfo);
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(purchase);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CfSuccess = " + receipt.GetCfSuccess());
Console.WriteLine("CfStatus = " + receipt.GetCfStatus());
Console.WriteLine("FeeAmount = " + receipt.GetFeeAmount());
Console.WriteLine("FeeRate = " + receipt.GetFeeRate());
Console.WriteLine("FeeType = " + receipt.GetFeeType());
//Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
//Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
//Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.ReadLine();
}
catch (Exception e)
{
November 2018 Page 335 of 476
![](asset-150.png)
Moneris Gateway API- Integration Guide
Sample Purchase with Convenience Fee
Console.WriteLine(e);
}
}
}
}
12.3 Convenience Fee Purchase w/ Customer Information
Convenience Fee Purchase with Customer information transaction object definition
Purchase purchase = new Purchase();
HttpsPostRequest object for Convenience Fee Purchase with Customer Info transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(purchase);
Convenience Fee Purchase with Customer information transaction object values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits SetMethod
Convenience Fee Object n/a purchase.SetConvFeeInfo
(convFeeInfo);
Order ID String 50-character alpha-
numeric
purchase.SetOrderId(order_
id);
Amount String 9-character decimal purchase.SetAmount(amount);
Credit card number String 20-character numeric purchase.SetPan(pan);
Expiry date String 4-character numeric
YYMM format
purchase.SetExpdate(expiry_
date);
E-commerce indicator String 1-character alpha-
numeric
purchase.SetCryptType
(crypt);
Convenience fee
amount
String 9-character decimal purchase.SetConvFeeInfo
(convfee_amount);
Table 1 Convenience Fee Purchase w/ Customer Info transaction object mandatory values
Page 336 of 476 November 2018
![](asset-151.png)
12 Convenience Fee
Value Type Limits Set Method
Customer ID String 50-character alpha-
numeric
purchase.SetCustId(cust_id);
Dynamic descriptor String 20-character alpha-
numeric
purchase
.SetDynamicDescriptor
(dynamic_descriptor);
Customer information Object n/a purchase.SetCustInfo
(customer);
AVSinformation Object n/a purchase.SetAvsInfo
(avsCheck);
CVD information Object n/a purchase.SetCvdInfo
(cvdCheck);
Table 2 Convenience Fee Purchase w/ Customer Info transaction object optional values
Sample Convenience Fee Purchase withCustomer Information
namespace Moneris
{
using System;
public class TestCanadaConvFeePurchaseCustInfo
{
public static void Main(string[] args)
{
string store_id = "monca00392";
string api_token = "qYdISUhHiOdfTr1CLNpN";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string amount = "5.00";
string pan = "4005554444444403";
string expdate = "1602"; //YYMM format
string crypt = "7";
string cust_id = "my customer id";
string convenience_fee = "1.00";
string processing_country_code = "CA";
bool status_check = false;
ConvFeeInfo convFeeInfo = new ConvFeeInfo();
convFeeInfo.SetConvenienceFee(convenience_fee);
Purchase purchase = new Purchase();
purchase.SetOrderId(order_id);
purchase.SetCustId(cust_id);
purchase.SetAmount(amount);
purchase.SetPan(pan);
purchase.SetExpDate(expdate);
purchase.SetCryptType(crypt);
purchase.SetConvFeeInfo(convFeeInfo);
/********************* Billing/Shipping Variables ****************************/
string first_name = "Bob";
string last_name = "Smith";
string company_name = "ProLine Inc.";
string address = "623 Bears Ave";
November 2018 Page 337 of 476
![](asset-152.png)
Moneris Gateway API- Integration Guide
Sample Convenience Fee Purchase withCustomer Information
string city = "Chicago";
string province = "Illinois";
string postal_code = "M1M2M1";
string country = "Canada";
string phone = "777-999-7777";
string fax = "777-999-7778";
string tax1 = "10.00";
string tax2 = "5.78";
string tax3 = "4.56";
string shipping_cost = "10.00";
/********************* Order Line Item Variables *****************************/
string[] item_description = new string[] { "Chicago Bears Helmet", "Soldier Field Poster" };
string[] item_quantity = new string[] { "1", "1" };
string[] item_product_code = new string[] { "CB3450", "SF998S" };
string[] item_extended_amount = new string[] { "150.00", "19.79" };
/********************** Customer Information Object **************************/
CustInfo customer = new CustInfo();
/********************** Set Customer Billing Information **********************/
customer.SetBilling(first_name, last_name, company_name, address, city,
province, postal_code, country, phone, fax, tax1, tax2,
tax3, shipping_cost);
/******************** Set Customer Shipping Information ***********************/
customer.SetShipping(first_name, last_name, company_name, address, city,
province, postal_code, country, phone, fax, tax1, tax2,
tax3, shipping_cost);
/***************************** Order Line Items ******************************/
customer.SetItem(item_description[0], item_quantity[0],
item_product_code[0], item_extended_amount[0]);
customer.SetItem(item_description[1], item_quantity[1],
item_product_code[1], item_extended_amount[1]);
purchase.SetCustInfo(customer);
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(purchase);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("CfSuccess = " + receipt.GetCfSuccess());
Console.WriteLine("CfStatus = " + receipt.GetCfStatus());
Page 338 of 476 November 2018
![](asset-153.png)
12 Convenience Fee
Sample Convenience Fee Purchase withCustomer Information
Console.WriteLine("FeeAmount = " + receipt.GetFeeAmount());
Console.WriteLine("FeeRate = " + receipt.GetFeeRate());
Console.WriteLine("FeeType = " + receipt.GetFeeType());
//Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
//Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
//Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
12.4 Convenience Fee Purchase with VbV, MCSC and Amex SafeKey
Convenience Fee Purchase with VbV/MCSC/SafeKeytransaction object definition
CavvPurchase cavvPurchase = new CavvPurchase();
HttpsPostRequest object for Convenience Fee Purchase w/ VbV/MCSC/SafeKey transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(cavvPurchase);
Convenience Fee Purchase with VbV/MCSC/SafeKeytransaction object values
For a full description of mandatory and optional values, see Appendix A Definitions of Request Fields
Value Type Limits Set Method
Convenience Fee Object N/A cavvPurchase.SetConvFeeInfo
(convFeeInfo);
Order ID String 50-character alpha-
numeric
cavvPurchase.SetOrderId
(order_id);
Amount String 9-character decimal cavvPurchase.SetAmount
(amount);
Credit card number String 20-character numeric cavvPurchase.SetPan(pan);
Expiry date String 4-character numeric
YYMM format
cavvPurchase.SetExpdate
(expiry_date);
E-Commerce indicator String 1-character alpha- cavvPurchase.SetCryptType
(crypt);
Table 1 Convenience Fee Purchase with VbV, MCSC, SafeKey - Required Fields
November 2018 Page 339 of 476
![](asset-154.png)
Moneris Gateway API- Integration Guide
Value Type Limits Set Method
numeric
Cardholder Authentic-
ation Verification Value
(CAVV)
String 50-character alpha-
numeric
cavvPurchase.SetCavv(cavv);
Convenience fee
amount
String 9-character decimal .SetConvFeeInfo(convfee_
amount);
Value Type Limits Set Method
StatusCheck Boolean true/false mpgReq.SetStatusCheck
(status_check);
CustomerID String 50-character alpha-
numeric
cavvPurchase.SetCustId(cust_
id);
Dynamic descriptor String 20-character alpha-
numeric
cavvPurchase
.SetDynamicDescriptor
(dynamic_descriptor);
E-commerce indicator String 1-character numeric cavvPurchase.SetCryptType
(crypt);
Customer Information Object N/A cavvPurchase.SetCustInfo
(customer);
AVS Information Object N/A cavvPurchase.SetAvsInfo
(avsCheck);
CVD Information Object N/A cavvPurchase.SetCvdInfo
(cvdCheck);
Table 2 Convenience Fee Purchase with VbV, MCSC, SafeKey - Optional Values
Sample Purchase with VbV/MCSC/SafeKey
namespace Moneris
{
using System;
using System.Collections;
public class TestCanadaConvFeeCavvPurchase
{
public static void Main(string[] args)
Page 340 of 476 November 2018
![](asset-155.png)
12 Convenience Fee
Sample Purchase with VbV/MCSC/SafeKey
{
string store_id = "monca00392";
string api_token = "qYdISUhHiOdfTr1CLNpN";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string cust_id = "B_Urlac_54";
string amount = "10.42";
string pan = "4005554444444403";
string expdate = "1901"; //YYMM format
string cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA";
string crypt_type = "5";
string convenience_fee = "1.00";
string dynamic_descriptor = "my descriptor";
string processing_country_code = "CA";
bool status_check = false;
AvsInfo avsCheck = new AvsInfo();
avsCheck.SetAvsStreetNumber("212");
avsCheck.SetAvsStreetName("Payton Street");
avsCheck.SetAvsZipCode("M1M1M1");
CvdInfo cvdCheck = new CvdInfo();
cvdCheck.SetCvdIndicator("1");
cvdCheck.SetCvdValue("099");
ConvFeeInfo convFeeInfo = new ConvFeeInfo();
convFeeInfo.SetConvenienceFee(convenience_fee);
CavvPurchase cavvPurchase = new CavvPurchase();
cavvPurchase.SetOrderId(order_id);
cavvPurchase.SetCustId(cust_id);
cavvPurchase.SetAmount(amount);
cavvPurchase.SetPan(pan);
cavvPurchase.SetExpDate(expdate);
cavvPurchase.SetCavv(cavv);
cavvPurchase.SetCryptType(crypt_type); //Mandatory for AMEX cards only
cavvPurchase.SetDynamicDescriptor(dynamic_descriptor);
cavvPurchase.SetAvsInfo(avsCheck);
cavvPurchase.SetCvdInfo(cvdCheck);
cavvPurchase.SetConvFeeInfo(convFeeInfo);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(cavvPurchase);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
November 2018 Page 341 of 476
![](asset-156.png)
Moneris Gateway API- Integration Guide
Sample Purchase with VbV/MCSC/SafeKey
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("Avs Response = " + receipt.GetAvsResultCode());
Console.WriteLine("Cvd Response = " + receipt.GetCvdResultCode());
//Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
Console.WriteLine("CfSuccess = " + receipt.GetCfSuccess());
Console.WriteLine("CfStatus = " + receipt.GetCfStatus());
Console.WriteLine("FeeAmount = " + receipt.GetFeeAmount());
Console.WriteLine("FeeRate = " + receipt.GetFeeRate());
Console.WriteLine("FeeType = " + receipt.GetFeeType());
//Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
//Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Page 342 of 476 November 2018
![](asset-157.png)
13 Recurring Billing
l1 About Recurring Billing
l13.2 Purchase with Recurring Billing
l13.3 Recurring Billing Update
l1 Recurring Billing Response Fields and Codes
l13.5 Credential on File and Recurring Billing
13.1 About Recurring Billing
Recurring Billing allows you to set up payments whereby Moneris automatically processes the trans-
actions and bills customers on your behalf based on the billing cycle information you provide.
Recurring Billing series are created by sending the Recurring Billing object in these transactions:
lPurchase
lPurchase with Vault
lPurchase with 3-D Secure (cavvPurchase)
You can modify a Recurring Billing series after it has been created by sending the RecurringBilling Update
administrative transaction.
NOTE: Alternatively, if you prefer to manage recurring series on your own merchant sys-
tem, you can send the periodic payments as basic Purchase transactions with the e-com-
merce indicator (crypt_type)value = 2 and with the Credential on File info object
included.
13.2 Purchase with Recurring Billing
Recurring Billing Info Object Definition
Recur recurring_cycle = new Recur(recur_unit, start_now, start_date, num_
recurs, period, recur_amount);
Transaction object set method
<transaction>.SetRecur(recurring_cycle);
Recurring Billing Info Object Request Fields
Variable and Field Name Type and Limits Description
Number of Recurs
num_recurs
String
numeric, 1-99
The number of times that the
transaction must recur
Period String Number of recur units that
November 2018 Page 343 of 476
![](asset-158.png)
Moneris Gateway API- Integration Guide
Variable and Field Name Type and Limits Description
period numeric, 1-999 must pass between recurring
billings
Start Date
start_date
String
YYYY/MM/DD
Date of the first future recurring
billing transaction
This value must be a date in the
future
If an additional charge is to be
made immediately, the value of
Start Now must be set to true
Start Now
start_now
String
true/false
If a single charge is to be made
against the card immediately,
set this value to true; the
amount to be billed imme-
diately may differ from the
amount billed on a regular
basis thereafter
If the billing is to start in the
future, set this value to false
When set to false, use Card Veri-
fication prior to sending the
Purchase with Recur and Cre-
dential on File objects
Recurring Amount
recur_amount
String
9-character decimal; Up to 6
digits (dollars)+ decimal point
+2 digits (cents) after the
decimal point
EXAMPLE:
123456.78
Amount of the recurring trans-
action
This is the amount that will be
billed on the Start Date and
then billed repeatedly based on
the interval defined by Period
and Recur Unit
Recur Unit
recur_unit
String
day, week, month or eom
Unit to be used as a basis for
the interval
Works in conjunction with
Period to define the billing fre-
quency
Possible values are:
Page 344 of 476 November 2018
![](asset-159.png)
13 Recurring Billing
Variable and Field Name Type and Limits Description
day
week
month
eom (end of month)
Sample Purchase with Recurring Billing
namespace Moneris
{
using System;
using System.Collections;
public class TestCanadaPurchaseRecur
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string amount = "10.00";
string pan = "4242424242424242";
string expiry_date = "1901"; //YYMM format
string crypt = "7";
/************************* Recur Variables **********************************/
string recur_unit = "month"; //eom = end of month
string start_now = "true";
string start_date = "2016/07/28";
string num_recurs = "12";
string period = "1";
string recur_amount = "30.00";
string processing_country_code = "CA";
bool status_check = false;
/************************* Recur Object Option1 ******************************/
Recur recurring_cycle = new Recur(recur_unit, start_now, start_date,
num_recurs, period, recur_amount);
/************************* Recur Object Option2 ******************************/
Hashtable recur_hash = new Hashtable();
recur_hash.Add("recur_unit", recur_unit);
recur_hash.Add("start_now", start_now);
recur_hash.Add("start_date", start_date);
recur_hash.Add("num_recurs", num_recurs);
recur_hash.Add("period", period);
recur_hash.Add("recur_amount", recur_amount);
Recur recurring_cycle2 = new Recur(recur_hash);
/************************ Transactional Object *******************************/
Purchase purchase = new Purchase(order_id, amount, pan, expiry_date, crypt);
/******************************* Set Recur ***********************************/
purchase.SetRecur(recurring_cycle);
CofInfo cof = new CofInfo();
cof.SetPaymentIndicator("R");
cof.SetPaymentInformation("2");
cof.SetIssuerId("168451306048014");
purchase.SetCofInfo(cof);
/**************************** Https Post Request ***************************/
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
November 2018 Page 345 of 476
![](asset-15a.png)
Moneris Gateway API- Integration Guide
Sample Purchase with Recurring Billing
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(purchase);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
/******************************* Receipt ***********************************/
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("Recur Success = " + receipt.GetRecurSuccess());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
13.3 Recurring Billing Update
After you have set up a Recurring Billing transaction series, you can change some of the details of the
series as long as it has not yet completed the preset recurring duration (i.e., it hasn’t terminated yet).
Before sending a Recurring Billing Update transaction that updates the credit card number, you must
send a Card Verification request. This requirement does not apply if you are only updating the schedule
or amount.
Things to Consider:
lWhen completing the update recurring billing portion please keep in mind that the
recur bill dates cannot be changed to have an end date greater than 10 years from
Page 346 of 476 November 2018
![](asset-15b.png)
13 Recurring Billing
today and cannot be changed to have an end date end today or earlier.
Recurring Billing Update transaction object definition
RecurUpdate recurUpdate = new RecurUpdate();
HttpsPostRequest object for Recurring Billing Update transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(recurUpdate);
Recurring Billing Update transaction values
Variable and Field Name Type and Limits Set Method
Order ID
order_id
String
50-character alphanumeric
recurUpdate.setCustId(cust_
id);
Table 1 Recurring Billing Update – Basic Required Fields
Variable and Field Name Type and Limits Set Method
Customer ID
cust_id
String
50-character alphanumeric
recurUpdate.setCustId(cust_
id);
Credit card number
pan
String
20-character alphanumeric
recurUpdate.SetPan(pan);
Expiry date
expiry_date
String
YYMM
recurUpdate.setExpdate
(expiry_date);
Table 2 Recurring Billing Update – Basic Optional Fields
Variable and
Field Name Type and Limits Set Method Description
Recurring String recurUpdate.SetRecurAmount
(recur_amount);
Changes the
amount that is
Table 3 Recurring Billing Update – Recurring Billing Required Fields
November 2018 Page 347 of 476
![](asset-15c.png)
Moneris Gateway API- Integration Guide
Variable and
Field Name Type and Limits Set Method Description
amount
recur_amount
9-character decimal;
Up to 6 digits
(dollars)+ decimal
point +2 digits
(cents) after the
decimal point
EXAMP-
LE:
123456.-
78
billed recurrently
The change takes
effect on the next
charge
Add number of
recurs
add_num
String
numeric, 1-999
recurUpdate.SetAddNumRecurs
(add_num);
Adds to the given
number of recur-
ring transactions
to the current
(remaining) num-
ber
This can be used if
a customer
decides to extend
a membership or
subscription
Cannot be used to
decrease the cur-
rent number of
recurring trans-
actions; use
Change number of
recurs instead
Change number
of recurs
total_num
String
numeric, 1-999
recurUpdate.SetTotalNumRecurs
(total_num);
Replaces the cur-
rent (remaining)
number of recur-
ring transactions
Hold recurring
billing
hold
String
true/false
recurUpdate.SetHold(hold); Temporarily
pauses recurring
billing
While a trans-
action is on hold,
it is not billed for
the recurring
amount; however,
the number of
remaining recurs
continues to be
decremented dur-
Page 348 of 476 November 2018
![](asset-15d.png)
13 Recurring Billing
Variable and
Field Name Type and Limits Set Method Description
ing that time
Terminate recur-
ring transaction
terminate
String
true/false
recurUpdate.SetTerminate
(terminate);
Terminates recur-
ring billing
NOTE: After it
has been ter-
minated, a
recurring
transaction
cannot be
reactivated; a
new purchase
transaction
with recurring
billing must
be submitted.
Sample Recurring Billing Update
namespace Moneris
{
using System;
public class TestCanadaRecurUpdate
{
public static void Main(string[] args)
{
string store_id = "store5";
string api_token = "yesguy";
string order_id = "Test20150625013553";
string cust_id = "antonio";
string recur_amount = "1.50";
string pan = "4242424242424242";
string expiry_date = "1901";
//string add_num = "";
//string total_num = "";
//string hold = "";
//string terminate = "";
string processing_country_code = "CA";
bool status_check = false;
CofInfo cof = new CofInfo();
cof.SetIssuerId("139X3130ASCXAS9");
RecurUpdate recurUpdate = new RecurUpdate();
recurUpdate.SetOrderId(order_id);
recurUpdate.SetCustId(cust_id);
recurUpdate.SetRecurAmount(recur_amount);
recurUpdate.SetPan(pan);
recurUpdate.SetExpDate(expiry_date);
//recurUpdate.SetAddNumRecurs(add_num);
//recurUpdate.SetTotalNumRecurs(total_num);
//recurUpdate.SetHold(hold);
//recurUpdate.SetTerminate(terminate);
November 2018 Page 349 of 476
![](asset-15e.png)
Moneris Gateway API- Integration Guide
Sample Recurring Billing Update
recurUpdate.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(recurUpdate);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("RecurUpdateSuccess = " + receipt.GetRecurUpdateSuccess());
Console.WriteLine("NextRecurDate = " + receipt.GetNextRecurDate());
Console.WriteLine("RecurEndDate = " + receipt.GetRecurEndDate());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
13.4 Recurring Billing Response Fields and Codes
Table 97 outlines the response fields that are part of recurring billing. Some are available when you set up
recurring billing (such as with a Purchase transaction), and some are available when you update an exist-
ing transaction with the Recurring Billing transaction.
Receipt object definition
Receipt receipt = mpgReq.GetReceipt();
Value Type Limits Get method
Description
Transaction object with Recurring Billing response fields
Response
code
String 3-character numeric receipt.GetResponseCode();
See Table 98: for a description of possible response codes.
Table 97: Recurring Billing response fields
Page 350 of 476 November 2018
![](asset-15f.png)
13 Recurring Billing
Value Type Limits Get method
Description
Recur success String TBD receipt.GetRecurSuccess();
Indicates whether the transaction successfully registered
Recur update object response fields
Recur update
success
String true/false receipt.GetRecurUpdateSuccess();
Indicates whether the transaction successfully updated.
Next recur
date
String yyyy-mm-dd format receipt.GetNextRecurDate();
Indicates when the transaction will be billed again.
Recur end
date
String yyyy-mm-dd format receipt.GetRecurEndDate();
Indicates when the Recurring Billing Transaction will end.
Table 97: Recurring Billing response fields
The Recur Update response is a 3-digit numeric value. The following is a list of all possible responses after
a Recur Update transaction has been sent.
Request Value Definition
001 Recurring transaction successfully updated (optional: terminated)
983 Cannot find the previous transaction
984 Data error: (optional: field name)
985 Invalid number of recurs
986 Incomplete: timed out
null Error: Malformed XML
Table 98: Recur update response codes
13.5 Credential on File and Recurring Billing
NOTE: The value of the payment indicator field must be Rwhen sending Recurring Billing
transactions.
For Recurring Billing transactions which are set to start immediately:
November 2018 Page 351 of 476
![](asset-160.png)
Moneris Gateway API- Integration Guide
1. Send a Purchase transaction request with both the Recurring Billing and Credential on File info
objects
For Recurring Billing transactions which are set to start on a future date:
1. Send Card Verification transaction request including the Credential onFile info object to get the
IssuerID
2. Send Purchase transaction request with the Recur and Credential on File info objects included
For updating a Recurring Billing series where you are updating the card number (does not apply if you are
only modifying the schedule or amount in a recurring series):
1. Send CardVerification request including the Credential on File info object to get the Issuer ID
2. Send a Recurring Billing Update transaction
For more information about the Recurring Billing object, see Definition of Request Fields – Recurring.
Page 352 of 476 November 2018
![](asset-161.png)
14 Customer Information
l14.1 Using the Customer Information Object
l14.2 Customer Information Sample Code
An optional add-on to a number of transactions the Customer Information object. The Customer Inform-
ation object offers a number of fields to be submitted as part of the financial transaction, and stored by
Moneris. These details may be viewed in the future in the Merchant Resource Center.
The following transactions support the Customer Information object :
lPurchase (Basic, Interac Debit and Vault)
lPre-Authorization (Basic and Vault)
lRe-Authorization (Basic)
The Customer Information object holds three types of information:
lMiscellaneous customer information properties
lBilling/Shipping information
lItem information
Things to Consider:
lIf you send characters that are not included in the allowed list, these extra transaction
details may not be stored.
lAll fields are alphanumeric and allow the following characters: a-z A-Z 0-9 _ - : . @ $= /
lAll French accents should be encoded as HTML entities, such as é.
lThe data sent in Billing and Shipping Address fields will not be used for any address veri-
fication.
14.1 Using the Customer Information Object
l14.1.1 CustInfo Object – Miscellaneous Properties
l14.1.2 CustInfo Object – Billing and Shipping Information
l14.1.3 CustInfo Object – Item Information
In addition to instantiating a transaction object and a connection object (as you would for a normal trans-
action), you must instantiate a CustInfo object.
Any transaction that supports CustInfo has a setCustInfo method. This is used to write the customer
information to the transaction object before writing the transaction object to the connection object.
CustInfo object definition
CustInfo customer = new CustInfo();
November 2018 Page 353 of 476
![](asset-162.png)
Moneris Gateway API- Integration Guide
Transaction object set method
<transaction>.SetCustInfo(customer);
14.1.1 CustInfo Object – Miscellaneous Properties
While most of the customer information data is organized into objects, there are some values that are
properties of the CustInfo object itself. They are explained in the table below.
Value Type Limits Set method
Email
Address
String 60-character alphanumeric customer.SetEmail(email);
Instructions String 100-character alphanumeric customer.SetInstructions(note);
Table 99: CustInfo object miscellaneous properties
14.1.2 CustInfo Object – Billing and Shipping Information
Billing and shipping information is stored as part of the CustInfo object. They can be written to the object
in one of two ways:
lUsing set methods
lUsing hash tables
Whichever method you use, you will be writing the information found in the table below for both the
billing information and the shipping information.
All values are alphanumeric strings. Their maximum lengths are given in the Limit column.
Value Limit Hash table key
First name 30 "first_name"
Last name 30 "last_name"
Company name 50 "company_name"
Address 70 "address"
City 30 "city"
Province/State 30 "province"
Postal/Zip code 30 "postal_code"
Country 30 "country"
Table 100: Billing and shipping information values
Page 354 of 476 November 2018
![](asset-163.png)
14 Customer Information
Value Limit Hash table key
Phone number (voice) 30 "phone"
Fax number 30 "fax"
Federal tax 10 "tax1"
Provincial/State tax 10 "tax2"
County/Local/Specialty tax 10 "tax3"
Shipping cost 10 "shipping_cost"
Table 100: Billing and shipping information values (continued)
14.1.2.1 Set Methods for Billing and Shipping Info
The billing information and the shipping information for a given CustInfo object are written by using the
customer.SetBilling() and customer.SetShipping() methods respectively:
customer.SetBilling(first_name, last_name, company_name, address, city,
province, postal_code, country, phone, fax, tax1, tax2, tax3, shipping_cost);
customer.SetShipping(first_name, last_name, company_name, address, city,
province, postal_code, country, phone, fax, tax1, tax2, tax3, shipping_cost);
Both of these methods have the same set of mandatory arguments. They are described in the Billing and
shipping information values table in 14.1.2.1 Set Methods for Billing and Shipping Info.
For sample code, see 14.2 Customer Information Sample Code.
14.1.2.2 Using Hash Tables for Billing and Shipping Info
Writing billing or shipping information using hash tables is done as follows:
1. Instantiate a CustInfo object.
2. Instantiate a hash table object. (The sample code uses a different hash table for billing and ship-
ping for clarity purposes. However, the skillful developer can re-use the same one.)
3. Build the hash table using put methods with the hash table keys found in the Billing and shipping
information values table in 14.1.2 CustInfo Object – Billing and Shipping Information.
4. Call the CustInfo object's setBilling/setShipping method to pass the hash table information to
the CustInfo object
5. Call the transaction object's setCustInfo method to write the CustInfo object (with the billing/-
shipping information to the transaction object.
For sample code, see 14.2 Customer Information Sample Code.
14.1.3 CustInfo Object – Item Information
The CustInfo object can hold information about multiple items. For each item, the values in the table
below can be written.
All values are strings, but note the guidelines in the Limits column.
November 2018 Page 355 of 476
![](asset-164.png)
Moneris Gateway API- Integration Guide
Value Limits Hash table key
Item name 45-character alphanumeric "name"
Item quantity 5-character numeric "quantity"
Item product code 20-character alphanumeric "product_code"
Item extended
amount
9-character decimal with at least 3 digits and 2 penny values.
0.01-999999.99
"extended_
amount"
Table 101: Item information values
One way of representing multiple items is with four arrays. This is the method used in the sample code.
However, there are two ways to write the item information to the CustInfo object:
lSet methods
lHash tables
14.1.3.1 Set Methods for Item Information
All the item information found in the Item information values table in 14.1.3 CustInfo Object – Item
Information is written to the CustInfo object in one instruction for a given item. Such as:
customer.setItem(item_description, item_quantity, item_product_code, item_
extended_amount);
For sample code (showing how to use arrays to write information about two items), see 14.2 Customer
Information Sample Code.
14.1.3.2 Using Hash Tables for Item Information
Writing item information using hash tables is done as follows:
1. Instantiate a CustInfo object.
2. Instantiate a hash table object. (The sample code uses a different hash table for each item for clar-
ity purposes. However, the skillful developer can re-use the same one.)
3. Build the hash table using put methods with the hash table keys in the Item information values
table in 14.1.3 CustInfo Object – Item Information.
4. Call the CustInfo object's setItem method to pass the hash table information to the CustInfo
object
5. Call the transaction object's setCustInfo method to write the CustInfo object (with the item
information to the transaction object.
For sample code that shows how to use arrays to write information about two items, see 14.2 Customer
Information Sample Code.
14.2 Customer Information Sample Code
Below are two examples of a Basic Purchase Transaction with Customer Information. Both samples start
with the same declaration of variables, as shown.
Page 356 of 476 November 2018
![](asset-165.png)
14 Customer Information
Values that are not involved in the Customer Information feature are not shown.
Note that the two items ordered are represented by four arrays, and the billing and shipping details are
the same.
Declaring the variables (common to both methods)
string first_name = "Bob";
string last_name = "Smith";
string company_name = "ProLine Inc.";
string address = "623 Bears Ave";
string city = "Chicago";
string province = "Illinois";
string postal_code = "M1M2M1";
string country = "Canada";
string phone = "777-999-7777";
string fax = "777-999-7778";
string tax1 = "10.00";
string tax2 = "5.78";
string tax3 = "4.56";
string shipping_cost = "10.00";
/********************* Order Line Item Variables *****************************/
string[] item_description = new string[] { "Chicago Bears Helmet", "Soldier Field Poster" };
string[] item_quantity = new string[] { "1", "1" };
string[] item_product_code = new string[] { "CB3450", "SF998S" };
string[] item_extended_amount = new string[] { "150.00", "19.79" };
Sample Purchase with Customer Information – Set method version
CustInfo customer = new CustInfo();
/********************** Set Customer Billing Information **********************/
customer.SetBilling(first_name, last_name, company_name, address, city,
province, postal_code, country, phone, fax, tax1, tax2,
tax3, shipping_cost);
/******************** Set Customer Shipping Information ***********************/
customer.SetShipping(first_name, last_name, company_name, address, city,
province, postal_code, country, phone, fax, tax1, tax2,
tax3, shipping_cost);
/***************************** Order Line Items ******************************/
customer.SetItem(item_description[0], item_quantity[0],
item_product_code[0], item_extended_amount[0]);
customer.SetItem(item_description[1], item_quantity[1],
item_product_code[1], item_extended_amount[1]);
Sample Purchase with Customer Information – Hash table version
CustInfo customer2 = new CustInfo();
/******************************* Billing Hashtable ***************************/
Hashtable b = new Hashtable(); //billing hashtable
b.Add("first_name", first_name);
b.Add("last_name", last_name);
b.Add("company_name", company_name);
b.Add("address", address);
b.Add("city", city);
November 2018 Page 357 of 476
![](asset-166.png)
Moneris Gateway API- Integration Guide
Sample Purchase with Customer Information – Hash table version
b.Add("province", province);
b.Add("postal_code", postal_code);
b.Add("country", country);
b.Add("phone", phone);
b.Add("fax", fax);
b.Add("tax1", tax1); //federal tax
b.Add("tax2", tax2); //prov tax
b.Add("tax3", tax3); //luxury tax
b.Add("shipping_cost", shipping_cost); //shipping cost
customer2.SetBilling(b);
/****************************** Shipping Hashtable ***************************/
Hashtable s = new Hashtable(); //shipping hashtable
s.Add("first_name", first_name);
s.Add("last_name", last_name);
s.Add("company_name", company_name);
s.Add("address", address);
s.Add("city", city);
s.Add("province", province);
s.Add("postal_code", postal_code);
s.Add("country", country);
s.Add("phone", phone);
s.Add("fax", fax);
s.Add("tax1", tax1); //federal tax
s.Add("tax2", tax2); //prov tax
s.Add("tax3", tax3); //luxury tax
s.Add("shipping_cost", shipping_cost); //shipping cost
customer2.SetShipping(s);
/************************* Order Line Item1 Hashtable ************************/
Hashtable i1 = new Hashtable(); //item hashtable #1
i1.Add("name", item_description[0]);
i1.Add("quantity", item_quantity[0]);
i1.Add("product_code", item_product_code[0]);
i1.Add("extended_amount", item_extended_amount[0]);
customer2.SetItem(i1);
/************************* Order Line Item2 Hashtable **************************/
Hashtable i2 = new Hashtable(); //item hashtable #2
i2.Add("name", "item2's name");
i2.Add("quantity", "7");
i2.Add("product_code", "item2's product code");
i2.Add("extended_amount", "5.01");
customer2.SetItem(i2);
Page 358 of 476 November 2018
![](asset-167.png)
15 Status Check
l15.1 About Status Check
l15.2 Using Status Check Response Fields
l15.3 Sample Purchase with Status Check
15.1 About Status Check
Status Check is a connection object value that allows merchants to verify whether a previously sent trans-
action was processed successfully.
To submit a Status Check request, resend the original transaction with all the same parameter values,
but set the status check value to either true or false.
Once set to “true”, the gateway will check the status of a transaction that has an order_id that matches
the one passed.
lIf the transaction is found, the gateway will respond with the specifics of that transaction.
lIf the transaction is not found, the gateway will respond with a not found message.
Once it is set to “false”, the transaction will process as a new transaction.
For example, if you send a Purchase transaction with Status Check, include the same values as the ori-
ginal Purchase such as the order ID and the amount.
The feature must be enabled in your merchant profile. To have it enabled, contact Moneris.
Things to Consider:
lThe Status Check request should only be used once and immediately (within 2 minutes)
after the last transaction that had failed.
lThe Status Check request should not be used to check openTotals & batchClose
requests.
lDo not resend the Status Check request if it has timed out. Additional investigation is
required.
15.2 Using Status Check Response Fields
After you have used the connection object to send a Status Check request, you can use the Receipt
object to obtain the information you want regarding the success of the original transaction.
The status response fields related to the status check are Status Code and Status Message.
Possible Status Code response values:
l0-49: successful transaction
l50-999: unsuccessful transaction.
November 2018 Page 359 of 476
![](asset-168.png)
Moneris Gateway API- Integration Guide
Possible Status Message response values:
lFound: Status code is 0-49
lNot found or Null: Status code is 50-999)
If the Status Message is Found, all other response fields are the same as those from the original trans-
action.
If the Status Message is Not found, all other response fields will be Null.
15.3 Sample Purchase with Status Check
Sample Purchase transaction with Status Check
using System;
using System.Collections.Generic;
using System.Text;
using Moneris;
namespace CanadaPurchaseConsoleTest
{
class CanadaPurchaseTest
{
public static void Main(string[] args)
{
Purchase purchase = new Purchase();
purchase.SetOrderId("order");
purchase.SetAmount("1.00");
purchase.SetPan("4242424242424242");
purchase.SetExpDate("2202");
purchase.SetCryptType("1");
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode("CA");
mpgReq.SetTestMode(true);
mpgReq.SetStoreId("store1");
mpgReq.SetApiToken("yesguy");
mpgReq.SetTransaction(purchase);
mpgReq.SetStatusCheck(true);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Page 360 of 476 November 2018
![](asset-169.png)
16 Visa Checkout
l16.1 About Visa Checkout
l16.2 Transaction Types - Visa Checkout
l16.3 Integrating Visa Checkout Lightbox
l16.4 Transaction Flow for Visa Checkout
l16.5 Visa Checkout Purchase
l16.6 Visa Checkout Pre-Authorization
l16.7 Visa Checkout Completion
l16.8 Visa Checkout Purchase Correction
l16.9 Visa Checkout Refund
l16.10 Visa Checkout Information
16.1 About Visa Checkout
VisaCheckout is a digital wallet service offered to customers using credit cards.Visa Checkout func-
tionality can be integrated into the Moneris Gateway via the API.
16.2 Transaction Types - Visa Checkout
Below is a list of transactions supported by the Visa Checkout API, other terms used for the transaction
type are indicated in brackets.
VdotMePurchase (sale)
Call to Moneris to obtain funds on the Visa Checkout callId and ready them for deposit
into the merchant’s account. It also updates the customer’s Visa Checkout transaction his-
tory.
VdotMePreAuth (authorisation / pre-authorization)
Call to Moneris to verify funds on the Visa Checkout callid and reserve those funds for
your merchant account. The funds are locked for a specified amount of time, based on the
card issuer. To retrieve the funds from this call so that they may be settled in the merchant’s
account, a VdotMeCompletion must be performed. It also updates the customer’s Visa
Checkout transaction history.
VdotMeCompletion (Completion / Capture)
Call to Moneris to obtain funds reserved by VdotMePreAuth call. This transaction call
retrieves the locked funds and readies them for settlement into the merchant’s account. This
call must be made typically within 72 hours of performing VdotMePreAuth. It also updates
the customer’s Visa Checkout transaction history.
VdotMePurchaseCorrection (Void / Purchase Correction)
Call to Moneris to void the VdotMePurchases and VdotMeCompletions the same day* that
they occurred on. It also updates the customer’s Visa Checkout transaction history.
VdotMeRefund (Credit)
Call to Moneris to refund against a VdotMePurchase or VdotMeCompletion to refund
any part, or all of the transaction. It also updates the customer’s Visa Checkout transaction
history.
November 2018 Page 361 of 476
![](asset-16a.png)
Moneris Gateway API- Integration Guide
VdotMeInfo (Credit)
Call to Moneris to obtain cardholder details such as, name on card, partial card number,
expiry date, shipping and billing information.
16.3 Integrating Visa Checkout Lightbox
1. Using the APIKey you obtained when you configured your Visa Checkout store, create Visa Check-
out Lightbox integration with JavaScript by following the Visa documentation, which is available
on Visa Developer portal:
Visa Checkout General Information (JavaScript SDK download)
https://developer.visa.com/products/visa_checkout
Getting Started With Visa checkout
https://developer.visa.com/products/visa_checkout/guides#getting_started
Adding Visa Checkout to Your Web Page
https://developer.visa.com/products/visa_checkout/guides#adding_to_page
Submitting the Consumer Payment Request
https://developer.visa.com/products/visa_checkout/guides#submitting_csr
2. If you get a payment success event from the resulting Visa Lightbox JavaScript, you will have to
parse and obtain the callid from their JSON response. The additional information is obtained
using VdotMeInfo.
Once you have obtained the callid from Visa Lightbox, you can make appropriate Visa Checkout VdotMe
transaction call to Moneris to process your transaction and obtain your funds.
NOTE: During Visa Checkout testing in our QA test environment, please use the APIkey
that you generated in the Visa Checkout configuration for the V.Init call in your
JavaScript.
Page 362 of 476 November 2018
![](asset-16b.png)
16 Visa Checkout
16.4 Transaction Flow for Visa Checkout
November 2018 Page 363 of 476
![](asset-16c.png)
Moneris Gateway API- Integration Guide
16.5 Visa Checkout Purchase
VdotMePurchase transaction object definition
VdotMePurchase vmepurchase = new VdotMePurchase();
HttpsPostRequest for VdotMePurchase transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(vmepurchase);
VdotMePurchase transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
vmepurchase.SetOrderId
(order_id);
Call ID String 20-character numeric vmepurchase.SetCallId(call_
id);
Amount String 9-character decimal vmepurchase.SetAmount
(amount);
E-commerce indicator String 1-character alpha-
numeric
vmepurchase.SetCryptType
(crypt);
Table 1 VdotMePurchase transaction object mandatory values
Value Type Limits Set Method
Dynamic
descriptor
String 20-character
alphanumeric
vmepurchase.SetDynamicDescriptor
(dynamic_descriptor);
Status check Boolean true/false mpgReq.SetStatusCheck(status_
check);
Table 2 VdotMePurchase transaction object optional values
Sample VdotMePurchase
using System;
using System.Collections.Generic;
using System.Text;
using Moneris;
namespace Moneris
{
class TestCanadaVdotMePurchase
{
public static void Main(string[] args)
{
Page 364 of 476 November 2018
![](asset-16d.png)
16 Visa Checkout
Sample VdotMePurchase
string store_id = "store2";
string api_token = "yesguy";
string cust_id = "Joe Doe";
string order_id = "VmeOrder" + DateTime.Now.ToString("yyyyMMddhhmmss");
string amount = "8.00";
string crypt_type = "7";
string call_id = "2374837188642083454";
string dynamic_descriptor = "inv123";
string processing_country_code = "CA";
bool status_check = false;
VdotMePurchase vmepurchase = new VdotMePurchase();
vmepurchase.SetOrderId(order_id);
vmepurchase.SetCustId(cust_id);
vmepurchase.SetAmount(amount);
vmepurchase.SetCallId(call_id);
vmepurchase.SetCryptType(crypt_type);
vmepurchase.SetDynamicDescriptor(dynamic_descriptor);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(vmepurchase);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.WriteLine("\r\nPress the enter key to exit");
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
November 2018 Page 365 of 476
![](asset-16e.png)
Moneris Gateway API- Integration Guide
16.6 Visa Checkout Pre-Authorization
VdotMePreAuth is virtually identical to the VdotMePurchase with the exception of the transaction
type name.
If the order could not be completed for some reason, such as an order is cancelled, made in error or not
fulfillable, the VdotMePreAuth transaction must be reversed within 72 hours.
To reverse an authorization, perform a VdotMeCompletion transaction for $0.00 (zero dollars).
VdotMePreAuth transaction object definition
VdotMePreauth vMePreauthRequest = new VdotMePreauth();
HttpsPostRequest object for VdotMePreAuth transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(vMePreauthRequest);
VdotMePreAuth transaction object values
Value Type Limits Set Method
Amount String 9-character decimal vDotMeReauthRequest
.SetAmount(amount);
Call ID String 20-character numeric vDotMeReauthRequest
.SetCallId(call_id);
Order ID String 50-character alpha-
numeric
vDotMeReauthRequest
.SetOrderId(order_id);
E-commerce indicator String 1-character alpha-
numeric
vDotMeReauthRequest
.SetCryptType(crypt);
Table 1 VdotMePreAuth transaction object mandatory values
Value Type Limits Set Method
Customer ID String 50-character alpha-
numeric
vMePreauthRequest.SetCustId
(cust_id);
Dynamic descriptor String 20-character alpha-
numeric
vDotMeReauthRequest
.SetDynamicDescriptor
(dynamic_descriptor);
Table 2 VdotMePreAuth transaction object optional values
Page 366 of 476 November 2018
![](asset-16f.png)
16 Visa Checkout
Sample VdotMePreAuth
using System;
namespace Moneris
{
class TestCanadaVdotMePreauth
{
public static void Main(string[] args)
{
string store_id = "store2";
string api_token = "yesguy";
string amount = "5.00";
string crypt_type = "7";
string order_id = "VmeOrder" + DateTime.Now.ToString("yyyyMMddhhmmss");
string call_id = "2336392495138357172";
string cust_id = "my customer id";
string processing_country_code = "CA";
bool status_check = false;
VdotMePreauth vMePreauthRequest = new VdotMePreauth();
vMePreauthRequest.SetOrderId(order_id);
vMePreauthRequest.SetAmount(amount);
vMePreauthRequest.SetCallId(call_id);
vMePreauthRequest.SetCustId(cust_id);
vMePreauthRequest.SetCryptType(crypt_type);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(vMePreauthRequest);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.WriteLine("\r\nPress the enter key to exit");
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
November 2018 Page 367 of 476
![](asset-170.png)
Moneris Gateway API- Integration Guide
16.7 Visa Checkout Completion
The VdotMeCompletion transaction is used to secure the funds locked by a VdotMePreAuth trans-
action.
You may also perform this transaction at $0.00 (zero dollars) to reverse a VdotMePreauth transaction
that you are unable to fulfill.
VdotMeCompletion transaction object definition
VdotMeCompletion vmecompletion = new VdotMeCompletion();
HttpsPostRequest object for VdotMeCompletion transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(vmecompletion);
VdotMeCompletion transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
vmecompletion.SetOrderId
(order_id);
Transaction number String 255-character alpha-
numeric
vmecompletion.SetTxnNumber
(txn_number);
Completion amount String 9-character decimal vmecompletion.SetCompAmount
(comp_amount);
E-commerce indicator String 1-character alpha-
numeric
vmecompletion.SetCryptType
(crypt);
Table 1 VdotMeCompletion transaction object mandatory values
Value Type Limits Set Method
Customer ID String 50-character alpha-
numeric
vmecompletion.SetCustId
(cust_id);
Dynamic descriptor String 20-character alpha-
numeric
vmecompletion
.SetDynamicDescriptor
(dynamic_descriptor);
Table 2 VdotMeCompletion transaction object optional values
Sample VdotMeCompletion
using System;
Page 368 of 476 November 2018
![](asset-171.png)
16 Visa Checkout
Sample VdotMeCompletion
namespace Moneris
{
class TestCanadaVdotMeCompletion
{
public static void Main(string[] args)
{
string store_id = "store2";
string api_token = "yesguy";
string order_id = "VmeOrder20150626023358";
string txn_number = "737541-0_10";
string comp_amount = "1.00";
string ship_indicator = "P";
string crypt_type = "7";
string cust_id = "mycustomerid";
string dynamic_descriptor = "inv 123";
string processing_country_code = "CA";
bool status_check = false;
VdotMeCompletion vmecompletion = new VdotMeCompletion();
vmecompletion.SetOrderId(order_id);
vmecompletion.SetTxnNumber(txn_number);
vmecompletion.SetAmount(comp_amount);
vmecompletion.SetCryptType(crypt_type);
vmecompletion.SetDynamicDescriptor(dynamic_descriptor);
vmecompletion.SetCustId(cust_id);
vmecompletion.SetShipIndicator(ship_indicator);
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(vmecompletion);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.WriteLine("\r\nPress the enter key to exit");
Console.ReadLine();
}
catch (Exception e)
{
November 2018 Page 369 of 476
![](asset-172.png)
Moneris Gateway API- Integration Guide
Sample VdotMeCompletion
Console.WriteLine(e);
}
}
}
}
16.8 Visa Checkout Purchase Correction
VdotMePurchaseCorrection is used to cancel a VdotMeCompletion or VdotMePurchase trans-
action that was performed in the current batch. No other transaction types can be corrected using this
method.
No amount is required because it is always for 100% of the original transaction.
VdotMePurchaseCorrection transaction object definition
VdotMePurchaseCorrection vDotMePurchaseCorrection = new
VdotMePurchaseCorrection();
HttpsPostRequest object for VdotMePurchaseCorrection transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(vDotMePurchaseCorrection);
VdotMePurchaseCorrection transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
vDotMePurchaseCorrection
.SetOrderId(order_id);
Transaction number String 255-character alpha-
numeric
vDotMePurchaseCorrection
.SetTxnNumber(txn_number);
Table 1 VdotMePurchaseCorrection transaction object mandatory values
Value Type Limits Set Method
Customer ID String 50-character alpha-
numeric
vDotMePurchaseCorrection
.SetCustId(cust_id);
Status check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Table 2 VdotMePurchaseCorrection transaction object optional values
Page 370 of 476 November 2018
![](asset-173.png)
16 Visa Checkout
Sample VdotMePurchaseCorrection
using System;
using Moneris;
namespace ACME
{
class TestCanadaVdotMePurchaseCorrection
{
public static void Main(string[] args)
{
string store_id = "store2";
string api_token = "yesguy";
string order_id = "VmeOrder20150626022834";
string txn_number = "737534-0_10";
string crypt_type = "7";
string cust_id = "my customer id";
string processing_country_code = "CA";
bool status_check = false;
VdotMePurchaseCorrection vDotMePurchaseCorrection = new VdotMePurchaseCorrection();
vDotMePurchaseCorrection.SetOrderId(order_id);
vDotMePurchaseCorrection.SetCustId(cust_id);
vDotMePurchaseCorrection.SetTxnNumber(txn_number);
vDotMePurchaseCorrection.SetCryptType(crypt_type);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(vDotMePurchaseCorrection);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.WriteLine("\r\nPress the enter key to exit");
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
November 2018 Page 371 of 476
![](asset-174.png)
Moneris Gateway API- Integration Guide
16.9 Visa Checkout Refund
VdotMeRefund will credit a specified amount to the cardholder’s credit card and update their Visa Check-
out transaction history. A refund can be sent up to the full value of the original VdotMeCompletion or
VdotMePurchase.
VdotMeRefund transaction object definition
VdotMeRefund vDotMeRefundRequest = new VdotMeRefund();
HttpsPostRequest object for VdotMeRefund transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(vDotMeRefundRequest);
VdotMeRefund transaction object values
Value Type Limits Set Method
Order ID String 50-character alpha-
numeric
vDotMeRefundRequest
.SetOrderId(order_id);
Amount String 9-character decimal vDotMeRefundRequest
.SetAmount(amount);
Transaction number String 255-character alpha-
numeric
vDotMeRefundRequest
.SetTxnNumber(txn_number);
E-commerce indicator String 1-character alpha-
numeric
vDotMeRefundRequest
.SetCryptType(crypt);
Table 1 VdotMeRefund transaction object mandatory values
Value Type Limits Set Method
Customer ID String 50-character alpha-
numeric
vDotMeRefundRequest
.SetCustId(cust_id);
Dynamic descriptor String 20-character alpha-
numeric
vDotMeRefundRequest
.SetDynamicDescriptor
(dynamic_descriptor);
Status check Boolean true/false mpgReq.SetStatusCheck
(status_check);
Table 2 VdotMeRefund transaction object optional values
Page 372 of 476 November 2018
![](asset-175.png)
16 Visa Checkout
Sample VdotMeRefund
using System;
using Moneris;
namespace ACME
{
class TestCanadaVdotMeRefund
{
public static void Main(string[] args)
{
string store_id = "store2";
string api_token = "yesguy";
string order_id = "VmeOrder20150626023725";
string txn_number = "737545-0_10";
string amount = "1.00";
string crypt_type = "7";
string dynamic_descriptor = "inv 123";
string cust_id = "my customer id";
string processing_country_code = "CA";
bool status_check = false;
VdotMeRefund vDotMeRefundRequest = new VdotMeRefund();
vDotMeRefundRequest.SetOrderId(order_id);
vDotMeRefundRequest.SetAmount(amount);
vDotMeRefundRequest.SetCustId(cust_id);
vDotMeRefundRequest.SetTxnNumber(txn_number);
vDotMeRefundRequest.SetCryptType(crypt_type);
vDotMeRefundRequest.SetDynamicDescriptor(dynamic_descriptor);
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetProcCountryCode(processing_country_code);
mpgReq.SetTestMode(true); //false or comment out this line for production transactions
mpgReq.SetStoreId(store_id);
mpgReq.SetApiToken(api_token);
mpgReq.SetTransaction(vDotMeRefundRequest);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
Console.WriteLine("\r\nPress the enter key to exit");
Console.ReadLine();
}
catch (Exception e)
{
November 2018 Page 373 of 476
![](asset-176.png)
Moneris Gateway API- Integration Guide
Sample VdotMeRefund
Console.WriteLine(e);
}
}
}
}
16.10 Visa Checkout Information
VdotMeInfo will get customer information from their Visa Checkout wallet. The details returned are
dependent on what the customer has stored in Visa Checkout.
VdotMeInfo transaction object definition
VdotMeInfo vmeinfo = new VdotMeInfo();
HttpsPostRequest object for VdotMeInfo transaction
HttpsPostRequest mpgReq = new HttpsPostRequest();
mpgReq.SetTransaction(vmeinfo);
VdotMeInfo transaction object values
Value Type Limits Set Method
Call ID String 20-character numeric vmeinfo.SetCallId(call_id);
Table 1 VdotMeInfo transaction object mandatory values
Sample VdotMeInfo
using System;
using System.Collections.Generic;
using System.Text;
namespace Moneris
{
public class TestCanadaVdotMeInfo
{
public static void Main(string[] args)
{
string store_id = "store2";
string api_token = "yesguy";
string call_id = "5840726785406561048";
string processing_country_code = "CA";
bool status_check = false;
VdotMeInfo vmeinfo = new VdotMeInfo();
vmeinfo.SetCallId(call_id);
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);
Page 374 of 476 November 2018
![](asset-177.png)
16 Visa Checkout
Sample VdotMeInfo
mpgReq.SetTransaction(vmeinfo);
mpgReq.SetStatusCheck(status_check);
mpgReq.Send();
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("Response Code: " + receipt.GetResponseCode());
Console.WriteLine("Response Message: " + receipt.GetMessage());
Console.WriteLine("Currency Code: " + receipt.GetCurrencyCode());
Console.WriteLine("Payment Totals: " + receipt.GetPaymentTotal());
Console.WriteLine("User First Name: " + receipt.GetUserFirstName());
Console.WriteLine("User Last Name: " + receipt.GetUserLastName());
Console.WriteLine("Username: " + receipt.GetUserName());
Console.WriteLine("User Email: " + receipt.GetUserEmail());
Console.WriteLine("Encrypted User ID: " + receipt.GetEncUserId());
Console.WriteLine("Creation Time Stamp: " + receipt.GetCreationTimeStamp());
Console.WriteLine("Name on Card: " + receipt.GetNameOnCard());
Console.WriteLine("Expiration Month: " + receipt.GetExpirationDateMonth());
Console.WriteLine("Expiration Year: " + receipt.GetExpirationDateYear());
Console.WriteLine("Last 4 Digits: " + receipt.GetLastFourDigits());
Console.WriteLine("Bin Number (6 Digits): " + receipt.GetBinSixDigits());
Console.WriteLine("Card Brand: " + receipt.GetCardBrand());
Console.WriteLine("Card Type: " + receipt.GetVdotMeCardType());
Console.WriteLine("Billing Person Name: " + receipt.GetPersonName());
Console.WriteLine("Billing Address Line 1: " + receipt.GetBillingAddressLine1());
Console.WriteLine("Billing City: " + receipt.GetBillingCity());
Console.WriteLine("Billing State/Province Code: " + receipt.GetBillingStateProvinceCode());
Console.WriteLine("Billing Postal Code: " + receipt.GetBillingPostalCode());
Console.WriteLine("Billing Country Code: " + receipt.GetBillingCountryCode());
Console.WriteLine("Billing Phone: " + receipt.GetBillingPhone());
Console.WriteLine("Billing ID: " + receipt.GetBillingId());
Console.WriteLine("Billing Verification Status: " + receipt.GetBillingVerificationStatus());
Console.WriteLine("Partial Shipping Country Code: " + receipt.GetPartialShippingCountryCode());
Console.WriteLine("Partial Shipping Postal Code: " + receipt.GetPartialShippingPostalCode());
Console.WriteLine("Shipping Person Name: " + receipt.GetShippingPersonName());
Console.WriteLine("Shipping Address Line 1: " + receipt.GetShipAddressLine1());
Console.WriteLine("Shipping City: " + receipt.GetShippingCity());
Console.WriteLine("Shipping State/Province Code: " + receipt.GetShippingStateProvinceCode());
Console.WriteLine("Shipping Postal Code: " + receipt.GetShippingPostalCode());
Console.WriteLine("Shipping Country Code: " + receipt.GetShippingCountryCode());
Console.WriteLine("Shipping Phone: " + receipt.GetShippingPhone());
Console.WriteLine("Shipping Default: " + receipt.GetShippingDefault());
Console.WriteLine("Shipping ID: " + receipt.GetShippingId());
Console.WriteLine("Shipping Verification Status: " + receipt.GetShippingVerificationStatus());
Console.WriteLine("isExpired: " + receipt.GetIsExpired());
Console.WriteLine("Base Image File Name: " + receipt.GetBaseImageFileName());
Console.WriteLine("Height: " + receipt.GetHeight());
Console.WriteLine("Width: " + receipt.GetWidth());
Console.WriteLine("Issuer Bid: " + receipt.GetIssuerBid());
Console.WriteLine("Risk Advice: " + receipt.GetRiskAdvice());
Console.WriteLine("Risk Score: " + receipt.GetRiskScore());
Console.WriteLine("AVS Response Code: " + receipt.GetAvsResponseCode());
Console.WriteLine("CVV Response Code: " + receipt.GetCvvResponseCode());
Console.WriteLine("\r\nPress the enter key to exit");
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
November 2018 Page 375 of 476
![](asset-178.png)
Moneris Gateway API- Integration Guide
Sample VdotMeInfo
}
}
}
}
Page 376 of 476 November 2018
![](asset-179.png)
17 Testing a Solution
l17.1 About the Merchant Resource Center
l17.2 Logging In to the QAMerchant Resource Center
l17.3 Test Credentials for Merchant Resource Center
l17.4 Getting a Unique Test Store ID and API Token
l17.5 Processing a Transaction
l17.6 Testing INTERAC® Online Payment Solutions
l17.7 Testing MPI Solutions
l17.8 Testing Visa Checkout
l1 Test Cards
l17.10 Simulator Host
17.1 About the Merchant Resource Center
The Merchant Resource Center is the user interface for Moneris Gateway services.There is also a
QAversion of the Merchant Resource Center site specifically allocated for you and other developers to
use to test your API integrations with the gateway.
You can access the Merchant Resource Center in the test environment at:
https://esqa.moneris.com/mpg (Canada)
The test environment is generally available 24/7, but 100% availability is not guaranteed. Also, please be
aware that other merchants are using the test environment in the Merchant Resource Center. Therefore,
you may see transactions and user IDs that you did not create. As a courtesy to others who are testing,
we ask that you use only the transactions/users that you created. This applies to processing Refund
transactions, changing passwords or trying other functions.
17.2 Logging In to the QAMerchant Resource Center
To log in to the QAMerchant Resource Center for testing purposes:
1. Go to the Merchant Resource Center QA website at https://esqa.moneris.com/mpg
2. Enter your username and password, which are the same email address and password you use to
log in to the Developer Portal
3. Enter your Store ID, which you obtained from the Developer Portal's My Testing Credentials as
described in Test Credentials for Merchant Resource Center (page 377)
17.3 Test Credentials for Merchant Resource Center
For testing purposes, you can either use the pre-existing test stores in the Merchant Resource Center, or
you can create your own unique test store where you will only see your own transactions. If you want to
use the pre-existing stores, use the test credentials provided in the following tables with the cor-
responding lines of code, as in the examples below.
November 2018 Page 377 of 476
![](asset-17a.png)
Moneris Gateway API- Integration Guide
Example of Corresponding Code For Canada:
string store_id = "store5";
string api_token = "yesguy";
string processing_country_code = "CA";
mpgReq.SetTestMode(true);
store_id api_token Username Password Other Information
store1 yesguy demouser password
store2 yesguy demouser password
store3 yesguy demouser password
store4 yesguy demouser password
store5 yesguy demouser password
monca00392 yesguy demouser password Use this store to
test Convenience
Fee transactions
moncaqagt1 mgtokenguy1 demouser password Use this store to
test Token Shar-
ing
moncaqagt2 mgtokenguy2 demouser password Use this store to
test Token Shar-
ing
moncaqagt3 mgtokenguy3 demouser password Use this store to
test Token Shar-
ing
monca01428 mcmpguy demouser password Use this store to
test MasterCard
MasterPass
Table 102: Test Server Credentials - Canada
Alternatively, you can create and use a unique test store where you will only see your own
transactions.For more on this, see Getting a Unique Test Store ID and API Token (page 379)
Page 378 of 476 November 2018
![](asset-17b.png)
17 Testing a Solution
17.4 Getting a Unique Test Store ID and API Token
Transactions requests via the API will require you to have a Store ID and a corresponding APItoken.For
testing purposes, you can either use the pre-existing test stores in the Merchant Resource Center, or you
can create your own unique test store where you will only see your own transactions.
To get your unique Store IDand APItoken:
1. Log in to the Developer Portal at https://developer.moneris.com
2. In the MyProfile dialog, click the FullProfile button
3. Under My Testing Credentials, select RequestTesting Credentials
4. Enter your Developer Portal password and select your country
5. Record the Store IDand APItoken that are given, as you will need them for logging in to the Mer-
chant Resource Center (StoreID) and for APIrequests (APItoken).
Alternatively, you can use the pre-existing test stores already set up in the Merchant Resource Center as
described in Test Credentials for Merchant Resource Center (page 377).
November 2018 Page 379 of 476
![](asset-17d.png)
17.5 Processing a Transaction
l1.1 Overview
l1.2 HttpsPostRequest Object
l1.3 Receipt Object
17.5.1 Overview
There are some common steps for every transaction that is processed.
1. Instantiate the transaction object (e.g., Purchase), and update it with object definitions that
refer to the individual transaction.
2. Instantiate the HttpsPostRequest connection object and update it with connection information,
host information and the transaction object that you created in step 17.5
Section 17.5 (page 381) provides the HttpsPostRequest connection object definition. This object
and its variables apply to every transaction request.
3. Invoke the HttpsPostRequest object's send() method.
4. Instantiate the Receipt object, by invoking the HttpsPostRequest object's get Receipt method.
Use this object to retrieve the applicable response details.
Some transactions may require steps in addition to the ones listed here. Below is a sample Purchase
transaction with each major step outlined. For extensive code samples of other transaction types, refer
to the Java API ZIP file.
NOTE: For illustrative purposes, the order in which lines of code appear below may differ
slightly from the same sample code presented elsewhere in this document.
using System;
using System.Collections.Generic;
using System.Text;
using Moneris;
Include all necessary
classes.
string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
string amount = "5.00";
string pan = "4242424242424242";
string expdate = "1901"; //YYMM format
string crypt = "7";
string processing_country_code = "CA";
Define all mandatory
values for the trans-
action object prop-
erties.
string store_id = "store5";
string api_token = "yesguy";
Define all mandatory
values for the con-
nection object prop-
erties.
Purchase purchase = new Purchase();
purchase.SetOrderId(order_id);
purchase.SetAmount(amount);
purchase.SetPan(pan);
purchase.SetExpdate(expdate);
purchase.SetCryptType(crypt);
purchase.SetDynamicDescriptor("2134565");
Instantiate the trans-
action object and
assign values to prop-
erties.
November 2018 Page 381 of 476
![](asset-17e.png)
Moneris Gateway API- Integration Guide
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(purchase);
mpgReq.SetStatusCheck(status_check);
Instantiate connection
object and assign val-
ues to properties,
including the trans-
action object you just
created.
try
{
Receipt receipt = mpgReq.GetReceipt();
Console.WriteLine("CardType = " + receipt.GetCardType());
Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
Console.WriteLine("TransType = " + receipt.GetTransType());
Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
Console.WriteLine("ISO = " + receipt.GetISO());
Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
Console.WriteLine("Message = " + receipt.GetMessage());
Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
Console.WriteLine("Complete = " + receipt.GetComplete());
Console.WriteLine("TransDate = " + receipt.GetTransDate());
Console.WriteLine("TransTime = " + receipt.GetTransTime());
Console.WriteLine("Ticket = " + receipt.GetTicket());
Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
Instantiate the Receipt
object and use its get
methods to retrieve
the desired response
data.
17.5.2 HttpsPostRequest Object
The transaction object that you instantiate becomes a property of this object when you call its set trans-
action method.
HttpsPostRequest Object Definition
HttpsPostRequest mpgReq = new HttpsPostRequest();
After instantiating the HttpsPostRequest object, update its mandatory and optional values as outlined in
the following values tables.
Page 382 of 476 November 2018
![](asset-17f.png)
Value
Type Limits Set method
Description
Processing
country code
String 2-character alphabetic mpgReq.setProcCountryCode
(processing_country_code);
CA for Canada, US for USA.
Test mode Boolean true/false mpgReq.setTestMode(true);
Set to true when in test mode. Set to false (or comment out entire line) when in pro-
duction mode.
Store ID String 10-character alphanumeric mpgReq.setStoreId(store_id);
Unique identifier provided by Moneris upon merchant account set up.
See 17.1 About the Merchant Resource Center for test environment details.
API Token String 20-character alphanumeric mpgReq.setApiToken(api_token);
Unique alphanumeric string assigned upon merchant account activation. To locate your
production API token, refer to the Merchant Resource Center Admin Store Settings.
See 17.3 Test Credentials for Merchant Resource Center for test environment details.
Transaction Object Not applicable mpgReq.setTransaction
(transaction);
This argument is one of the numerous transaction types discussed in the rest of this
manual. (Such as Purchase, Refund and so on.) This object is instantiated in step 1
above.
Table 103: HttpsPostRequest object mandatory values
Value
Type Limits Set method
Description
Status Check Boolean true/false mpgReq.setStatusCheck (status_check);
See Appendix A Definitions of Request Fields.
NOTE: while this value belongs to the HttpsPostRequest object, it is only supported by some trans-
actions. Check the individual transaction definition to find out whether Status Check can be used.
Table 1 HttpsPostRequest object optional values
17.5.3 Receipt Object
After you send a transaction using the HttpsPostRequest object's send method, you can instantiate a
receipt object.
November 2018 Page 383 of 476
![](asset-180.png)
Moneris Gateway API- Integration Guide
Receipt Object Definition
Receipt receipt = mpgReq.GetReceipt();
For an in-depth explanation of Receipt object methods and properties, see Appendix B Definitions of
Response Fields.
17.6 Testing INTERAC® Online Payment Solutions
Acxsys has two websites where merchants can post transactions for testing the fund guarantee porting
of INTERAC® Online Payment transactions. The test IDEBIT_MERCHNUM value is provided by Moneris
after registering in the test environment.
After registering, the following two links become accessible:
lMerchant Test Tool
lCertification Test Tool
Merchant Test Tool
https://merchant-test.interacidebit.ca/gateway/merchant_test_processor.do
This URL is used to simulate the transaction response process, to validate response variables, and to
properly integrate your checkout process.
When testing INTERAC® Online Payment transactions, you are forwarded to the INTERAC® Online Pay-
ment Merchant Testing Tool. A screen appears where certain fields need to be completed.
For an approved response, do not alter any of the fields except for the ones listed here.
IDEBIT_TRACK2
To form a track2 when testing with the Moneris Gateway, use one of these three numbers:
3728024906540591206=01121122334455000
5268051119993326=01121122334455000000
453781122255=011211223344550000000000
IDEBIT_ISSNAME
RBC
IDEBIT_ISSCONF
123456
For a declined response, provide any other value as the IDEBIT_TRACK2. Click Post to Merchant.
Whether the transaction is approved or declined, do not click Validate Data. This will return validation
errors.
Certification Test Tool
https://merchant-test.interacidebit.ca/gateway/merchant_certification_processor.do
This URL is used to complete the required INTERAC® Online Payment Merchant Front-End Certification
test cases, which are outlined in Appendix E (page 454) and Appendix F (page 458).
Page 384 of 476 November 2018
![](asset-181.png)
To confirm the fund that was guaranteed above, an INTERAC® Online Payment Purchase must be sent to
the Moneris Gateway QAusing the following test store information:
Host: esqa.moneris.com
Store ID: store3
API Token: yesguy
You can always log into the Merchant Resource Center to check the results using the following inform-
ation:
URL: https://esqa.moneris.com/mpg
Store ID: store3
Note that all response variables that are posted back from the IOP gateway in step 5.4 of 5.4 must be val-
idated for length of field, permitted characters and invalid characters.
17.7 Testing MPI Solutions
When testing your implementation of the Moneris MPI, you can use the Visa/MasterCard/Amex PIT (pro-
duction integration testing) environment. The testing process is slightly different than a production envir-
onment in that when the inline window is generated, it does not contain any input boxes. Instead, it
contains a window of data and a Submit button. Clicking Submit loads the response in the testing win-
dow. The response will not be displayed in production.
NOTE: MasterCard SecureCode and Amex SafeKey may not be directly tested within our
current test environment. However, the process and behavior tested with the Visa test
cards will be the same for MCSC and SafeKey.
When testing you may use the following test card numbers with any future expiry date. Use the appro-
priate test card information from the tables below: Visa and MasterCard use the same test card inform-
ation, while Amex uses unique information.
Card Number VERes PARes Action
4012001037141112
4242424242424242
Y true TXN – Call function to create inLine window.
ACS – Send CAVV to Moneris Gateway using either the Cavv
Purchase or the Cavv Pre-Authorization transaction.
4012001038488884 U NA Send transaction to Moneris Gateway using either the basic
Purchase or the basic Pre-Authorization transaction. Set crypt_
type = 7.
Table 104: MPI test card numbers (Visa and MasterCard only)
November 2018 Page 385 of 476
![](asset-182.png)
Moneris Gateway API- Integration Guide
Card Number VERes PARes Action
4012001038443335 N NA Send transaction to Moneris Gateway using either the basic
Purchase or the basic Pre-Authorization transaction.
Set crypt_type = 6.
4012001037461114 Y false Card failed to authenticate. Merchant may chose to send trans-
action or decline transaction. If transaction is sent, use crypt
type = 7.
Table 104: MPI test card numbers (Visa and MasterCard only) (continued)
Card Number VERes
Password
Required? PARes Action
375987000000062 U Not
required
N/A TXN – Call function to create inLine window.
ACS – Send CAVV to Moneris Gateway using either the
Cavv Purchase or the Cavv Pre-Authorization trans-
action.Set crypt_type = 7.
375987000000021 Y Yes:
test13fail
false Card failed to authenticate. Merchant may chose to
send transaction or decline transaction. If transaction
is sent, use crypt type = 7.
375987000000013 N Not
required
N/A Send transaction to Moneris Gateway using either the
basic Purchase or the basic Pre-Authorization trans-
action. Set crypt_type = 6.
374500261001009 Y Yes:
test09
true Card failed to authenticate. Merchant may choose to
send transaction or decline transaction. Set crypt_
type = 5.
Table 105: MPI test card numbers (Amex only)
VERes
The result U, Y or N is obtained by using getMessage().
PARes
The result “true” or “false” is obtained by using getSuccess().
To access the Merchant Resource Center in the test environment go to https://esqa.moneris.com/mpg.
Transactions in the test environment should not exceed $11.00.
17.8 Testing Visa Checkout
In order to test Visa Checkout you need to:
Page 386 of 476 November 2018
![](asset-183.png)
1. Create a Visa Checkout configuration profile in the Merchant Resource Center QA environment at
https://esqa.moneris.com/mpg. To learn more about this, see "Creating a Visa Checkout Con-
figuration for Testing" below.
2. Obtain a Lightbox APIkey to be used for Lightbox integration. To learn more about this, see "Integ-
rating Visa Checkout Lightbox" on page362.
3. For test card numbers specifically for use when testing Visa Checkout, see "Test Cards for Visa
Checkout" on the next page
17.8.1 Creating a Visa Checkout Configuration for Testing
Once you have a test store created, you need to activate Visa Checkout in the QA environment.
To activate Visa Checkout in QA:
1. Log in to the the QA environment at https://esqa.moneris.com/mpg
2. In the Admin menu, select Visa Checkout
3. Complete the applicable fields
4. ClickSave.
17.9 Test Card Numbers
Because of security and compliance reasons, the use of live credit and debit card numbers for testing is
strictly prohibited. Only test credit and debit card numbers are to be used.
To test general transactions, use the following test card numbers:
Card Plan Card Number
Mastercard 5454545454545454
Visa 4242424242424242
Amex 373599005095005
JCB 3566007770015365
Diners 36462462742008
Track2 5258968987035454=06061015454001060101?
Discover 6510000000000182
UnionPay 6250944000000771
Table 106: General test card numbers
November 2018 Page 387 of 476
![](asset-184.png)
Moneris Gateway API- Integration Guide
17.9.1 Test Card Numbers for Level 2/3
When testing Level 2/3 transactions, use the card numbers below.
Card Brand Test CardNumber
Mastercard 5454545442424242
Visa 4242424254545454
Amex 373269005095005
17.9.2 Test Cards for Visa Checkout
Card Plan Card Number
Visa 4005520201264821 (without card art)
Visa 4242424242424242 (with card art)
MasterCard 5500005555555559
American Express 340353278080900
Discover 6011003179988686
Table 1 Test Cards Numbers - Visa Checkout
17.10 Simulator Host
The test environment has been designed to replicate the production environment as closely as possible.
One major difference is that Moneris is unable to send test transactions onto the production author-
ization network. Therefore, issuer responses are simulated. Additionally, the requirement to emulate
approval, decline and error situations dictates that certain transaction variables initiate various response
and error situations.
The test environment approves and declines transactions based on the penny value of the amount sent.
For example, a transaction made for the amount of $9.00 or $1.00 is approved because of the .00 penny
value.
Transactions in the test environment must not exceed $11.00.
For a list of all current test environment responses for various penny values, please see the Test Envir-
onment Penny Response Table available at https://developer.moneris.com.
Page 388 of 476 November 2018
![](asset-185.png)
NOTE: These responses may change without notice. Check the Moneris Developer Portal
(https://developer.moneris.com) regularly to access the latest documentation and down-
loads.
November 2018 Page 389 of 476
![](asset-187.png)
18 Moving to Production
l18.1 Activating a Production Store Account
l18.2 Configuring a Store for Production
l18.3 Receipt Requirements
l1 Getting Help
18.1 Activating a Production Store Account
The steps below outline how to activate your production account so that you can process production
transactions.
1. Obtain your activation letter/fax from Moneris.
2. Go to [[[Undefined variable URLs.ActivationCanada]]].
3. Input your store ID and merchant ID from the letter/fax and click Activate.
4. Follow the on-screen instructions to create an administrator account. This account will grant you
access to the Merchant Resource Center.
5. Log into the Merchant Resource Center at https://www3.moneris.com/mpgusing the user cre-
dentials created in step 18.1.
6. Proceed to ADMIN and then STORE SETTINGS.
7. Locate the API token at the top of the page. You will use this API token along with the store ID
that you received in your letter/fax and to send any production transactions through the API.
When your production store is activated, you need to configure your store so that it points to the pro-
duction host. To learn how do to this, see Configuring a Store for Production (page 391)
NOTE: For more information about how to use the Merchant Resource Center, see the Mon-
eris Gateway Merchant Resource Center User’s Guide, which is available at
https://developer.moneris.com.
18.2 Configuring a Store for Production
After you have completed your testing and have activated your production store, you are ready to point
your store to the production host.
To configure a store for production:
1. Change the test mode set method from true to false.
2. Change the Store ID to reflect the production store ID that you received when you activated your
production store. To review the steps for activating a production store, see Activating a Pro-
duction Store Account (page 391).
3. Change the API token to the production token that you received during activation.
4. If you haven't done so already, change the code to reflect the correct processing country (Canada
for most merchants). For more on this, see
The table below illustrates the steps above using the relevant code (and where Xis an alphanumeric char-
acter).
November 2018 Page 391 of 476
![](asset-188.png)
Moneris Gateway API- Integration Guide
Step Code in Testing Changes for Production
1 No string changes for this item, only set
method is altered:
mpgReq.SetTestMode(true);
Set method for production:
mpgReq.SetTestMode(false);
2 String:
string store_id = "store5";
Associated Set Method:
mpgReq.SetStoreId(store_id);
String for Production:
string store_id = "monXXXXXXXX";
3 String:
string api_token = "yesguy";
Associated SetMethod:
mpgReq.SetApiToken(api_token);
String for Production:
string api_token = "XXXX";
18.2.1 Configuring an INTERAC® Online Payment Store for Production
Before you can process INTERAC® Online Payment transactions through your web site, you need to com-
plete the certification registration process with Moneris, as described below. The production IDEBIT_
MERCHNUM value is provided by Moneris after you have successfully completed the certification.
Acxsys’ production INTERAC® Online PaymentGateway URL is https://g-
ateway.interaconline.com/merchant_processor.do.
To access the Moneris Moneris Gateway production gateway URL, use the following:
Store ID: Provided by Moneris
API Token: Generated during your store activation process.
Processing country code:CA
The production Merchant Resource Center URL is https://www3.moneris.com/mpg/
18.2.1.1 Completing the Certification Registration - Merchants
To complete the certification registration, fax or email the information below to our Integration Support
helpdesk:
Page 392 of 476 November 2018
![](asset-189.png)
18 Moving to Production
lMerchant logo to be displayed on the INTERAC® Online Payment Gateway page
lIn both French and English
l120 × 30 pixels
lOnly PNG format is supported.
lMerchant business name
lIn both English and French
lMaximum 30 characters.
lList of all referrer URLs. That is, URLs from which the customer may be redirected to the INTERAC®
Online Payment gateway.
lList of all URLs that may appear in the IDEBIT_FUNDEDURL field of the https form POST to the
INTERAC® Online Payment Gateway.
lList of all URLs that may appear in the IDEBIT_NOTFUNDEDURL field of the https form POST to the
INTERAC® Online Payment Gateway.
18.2.1.2 Third-Party Service/Shopping Cart Provider
In your product documentation, instruct your clients to provide the information below to the Moneris
Gateway Integration Support helpdesk for certification registration:
lMerchant logo to be displayed on the INTERAC® Online Payment Gateway page
lIn both French and English
l120 × 30 pixels
lOnly PNG format is supported.
lMerchant business name
lIn both English and French
lMaximum 30 characters.
lList of all referrer URLs. That is, URLs from which the customer may be redirected to the INTERAC®
Online Payment gateway.
lList of all URLs that may appear in the IDEBIT_FUNDEDURL field of the https form POST to the
INTERAC® Online Payment Gateway.
lList of all URLs that may appear in the IDEBIT_NOTFUNDEDURL field of the https form POST to the
INTERAC® Online Payment Gateway.
See 5.3.3, page 108 for additional client requirements.
November 2018 Page 393 of 476
![](asset-18a.png)
Moneris Gateway API- Integration Guide
18.3 Receipt Requirements
Visa and MasterCard expect certain details to be provided to the cardholder and on the receipt when a
transaction is approved.
Receipts must comply with the standards outlined within the Integration Receipts Requirements. For all
the receipt requirements covering all transaction scenarios, visit the Moneris Developer Portal at
https://developer.moneris.com.
Production of the receipt must begin when the appropriate response to the transaction request is
received by the application. The transaction may be any of the following:
lSale (Purchase)
lAuthorization (PreAuth, Pre-Authorization)
lAuthorization Completion (Completion, Capture)
lOffline Sale (Force Post)
lSale Void (Purchase Correction, Void)
lRefund.
The boldface terms listed above are the names for transactions as they are to be displayed on receipts.
Other terms used for the transaction are indicated in brackets.
18.3.1 Certification Requirements
Card-present transaction receipts are required to complete certification.
Card-not-present integration
Certification is optional but highly recommended.
Card-present integration
After you have completed the development and testing, your application must undergo a cer-
tification process where all the applicable transaction types must be demonstrated, and the
corresponding receipts properly generated.
Contact a Client Integration Specialist for the Certification Test checklist that must be com-
pleted and returned for verification. (See "Getting Help" on page1 for contact details.) Be sure
to include the application version of your product. Any further changes to the product after
certification requires re-certification.
After the certification requirements are met, Moneris will provide you with an official cer-
tification letter.
Page 394 of 476 November 2018
![](asset-18b.png)
Appendix A Definitions of Request Fields
This appendix deals with values that belong to transaction objects. For information on values that
belong to the (HttpsPostRequest) connection object, see "Processing a Transaction" on page381.
NOTE:
Alphanumeric fields allow the following characters: a-z A-Z 0-9 _ - : . @ spaces
All other request fields allow the following characters: a-z A-Z 0-9 _ - : . @ $= /
Note that the values listed in Appendix A are not mandatory for every transaction. Check the transaction
definition. If it says that a value is mandatory, a further description is found here.
Value
Type Limits Sample code variable definition
Description
General transaction values
Order ID String 50-character
alphanumeric
string order_id;
Merchant-defined transaction identifier that must be unique for every Purchase,
PreAuth and Independent Refund transaction. No two transactions of these types
may have the same order ID.
For Refund, Completion and Purchase Correction transactions, the order ID must
be the same as that of the original transaction.
The last 10 characters of the order ID are displayed in the “Invoice Number” field
on the Merchant Direct Reports. However only letters, numbers and spaces are
sent to Merchant Direct.
A minimum of 3 and a maximum of 10 valid characters are sent to Merchant
Direct. Only the last characters beginning after any invalid characters are sent. For
example, if the order ID is 1234-567890, only 567890 is sent to Merchant Direct.
If the order ID has fewer than 3 characters, it may display a blank or 0000000000 in
the Invoice Number field.
Table 107: Request fields
November 2018 Page 395 of 476
![](asset-18c.png)
Moneris Gateway API- Integration Guide
Value
Type Limits Sample code variable definition
Description
Amount String 9-character decimal string amount;
Transaction amount. Used in a number of transactions. Note that this is different
from the amount used in a Completion transaction, which is an alphanumeric
value.
This must contain at least 3 digits, two of which are penny values.
The minimum allowable value is $0.01, and the maximum allowable value is 999
999.99. Transaction amounts of $0.00 are not allowed.
Credit card number String 20-character numeric
(no spaces or dashes)
string pan;
Most credit card numbers today are 16 digits, but some 13-digit numbers are still
accepted by some issuers. This field has been intentionally expanded to 20 digits
in consideration for future expansion and potential support of private label card
ranges.
Expiry date String 4-character numeric
(YYMM format)
string expiry_date;
Note: This is the reverse of the date displayed on the physical card, which is
MMYY.
Table 107: Request fields (continued)
Page 396 of 476 November 2018
![](asset-18d.png)
Appendix A Definitions of Request Fields
Value
Type Limits Sample code variable definition
Description
E-Commerce
indicator
String 1-character alpha-
numeric
string crypt;
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/MCSC/SafeKey)
6: Non-authenticated e-commerce transaction (VbV/MCSC/SafeKey)
7: SSL-enabled merchant
8: Non-secure transaction (web- or email-based)
9: SET non-authenticated transaction
NOTE:
When processing a Cavv Purchase or Pre-Authorization for Apple
Pay or Android Pay transactions whereby the merchant is using
their own API to decrypt the payload, this field is mandatory.
For Apple Pay or Android Pay, send the value returned in the
eciIndicator or 3dsEciIndicator respectively. If the value is not
present, please send the value as 5. If you get a 2-character value
(e.g.,. 05 or 07) from the payload, remove the initial 0 and just
send us the 2nd character.
Supported values for Apple Pay and Android Pay are:
5: Authenticated e-commerce transaction
7: SSL-enabled merchant
Completion
Amount
String 9-character decimal string comp_amount;
Amount of a Completion transaction. This may not be equal to the amount value
(described on page 395), which appeared in the original Pre-Authorization
transaction.
Table 107: Request fields (continued)
November 2018 Page 397 of 476
![](asset-18e.png)
Moneris Gateway API- Integration Guide
Value
Type Limits Sample code variable definition
Description
Shipping Indicator1String 1-character alpha-
numeric
string ship_indicator;
Used to identify completion transactions that require multiple shipments, also
referred to as multiple completions. By default, if the shipping indicator is not
passed, all completions are listed as final completions. To indicate that the
completion is to be left open by the issuer as supplemental shipments or
completions are pending, a value of P is submitted.
Possible values:
P = Partial
F = Final
Transaction num-
ber
String 255-character
alphanumeric
string txn_number;
Used when performing follow-on transactions. (That is, Completion, Purchase Cor-
rection 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.
Authorization code String 8-character alpha-
numeric
string auth_code;
Authorization code provided in the transaction response from the issuing bank.
This is required for Force Post transactions.
ECR number String 8-character alpha-
numeric
string ecr_no;
Electronic cash register number, also referred to as TIDor Terminal ID.
MPI transaction values
Table 107: Request fields (continued)
1Available to Canadian integrations only.
Page 398 of 476 November 2018
![](asset-18f.png)
Appendix A Definitions of Request Fields
Value
Type Limits Sample code variable definition
Description
XID String 20-character alpha-
numeric
string xid;
Can also be used as your order ID when using Moneris Gateway. Fixed length —
must be exactly 20 characters.
MD (Merchant
Data)
String 1024-character alpha-
numeric
string MD;
Information to be echoed back in the response.
Merchant URL String Variable length string merchantUrl;
URL to which the MPI response is to be sent.
Accept String Variable length string accept;
MIME types that the browser accepts
User Agent String Variable length string userAgent;
Browser details
PARes String Variable length (Not shown)
Value passed back to the API during the TXN, and returned to the MPI when an
ACS request is made.
Cardholder
Authentication Veri-
fication Value
(CAVV)
String 50-character alpha-
numeric
string cavv;
Value provided by the Moneris MPI or by a third-party MPI. It is part of a Verified
by Visa/MasterCard SecureCode/American Express SafeKey transaction.
NOTE: For Apple Pay and Android Pay Cavv Purchase and Cavv Pre-Authorization transactions,
CAVV field contains the decrypted cryptogram.
Vault transaction values
Table 107: Request fields (continued)
November 2018 Page 399 of 476
![](asset-190.png)
Moneris Gateway API- Integration Guide
Value
Type Limits Sample code variable definition
Description
Data key String 28-character alpha-
numeric
string data_key;
Profile identifier that all future financial Vault transactions (that is, they occur after
the profile was registered by a Vault Add Credit Card- ResAddCC, Vault Encrypted
Add Credit Card - EncResAddCC, Vault Tokenize Credit Card - ResTokenizeCC,
Vault Add Temporary Token - ResTempAdd or Vault Add Token - ResAddToken
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.
Duration String 3-character numeric string duration;
Amount of time the temporary token should be available, up to 900 seconds.
Data key format1String 2-character alpha-
numeric
string data_key_format;
This field will specify the data key format being returned. If left blank, Data Key
format will default to 25-character alphanumeric.
Valid values:
no value sent or 0 = 25-character alpha-numeric Data Key
By using the following values, a unique token is generated specifically for the PAN
that is presented for tokenization. Any subsequent tokenization requests for the
same PAN will result in the same token
0U = 25-character alpha-numeric Data Key, Unique
Mag Swipe transaction values
Table 107: Request fields (continued)
1Available to Canadian integrations only.
Page 400 of 476 November 2018
![](asset-191.png)
Appendix A Definitions of Request Fields
Value
Type Limits Sample code variable definition
Description
POS code String 20-character numeric string pos_code;
Under normal presentment situations, the value is 00.
If a Pre-Authorization transaction was card-present and keyed-in, then the
POScode for the corresponding Completion transaction is 71.
In an unmanned kiosk environment where the card is present, the value is 27.
If the solution is not “merchant and cardholder present”, contact Moneris for the
proper POS code.
Track2 data String 40-character
alphanumeric
string track2;
Retrieved from the mag stripe of a credit card by swiping it through a card reader,
or the "fund guarantee" value returned by the INTERAC® Online Payment system.
Encrypted track2
data
String Variable length string enc_track2;
String that is retrieved by swiping or keying in a credit card number through a
Moneris-provided encrypted mag swipe card reader. It is part of an encrypted
keyed or swiped transaction only. This string must be retrieved by a specific
device. (See below for the list of current available devices.)
Device type String 30-character alpha-
numeric
string device_type;
Type of encrypted mag swipe reader that was read the credit card. This must be a
Moneris-provided device so that the values are properly encrypted and
decrypted.
This field is case-sensitive. Available values are:
"idtech_bdk"
Table 107: Request fields (continued)
November 2018 Page 401 of 476
![](asset-192.png)
Moneris Gateway API- Integration Guide
Note that the values listed in Appendix A are not supported by every transaction. Check the transaction
definition. If it says that a value is optional, a further description is found here.
Value
Type Limits Sample code variable definition
Description
General transaction values
Customer ID String 30-character alphanumeric string cust_id;
This can be used for policy number, membership number, student ID, invoice num-
ber and so on.
This field is searchable from the Moneris Merchant Resource Center.
Status Check String true/false string status_check;
See .
Dynamic
descriptor
String 20-character alphanumeric
Combined with merchant's busi-
ness name cannot exceed 25 char-
acters.
string dynamic_descriptor;
Merchant-defined description sent on a per-transaction basis that will appear on the
credit card statement appended to the merchant’s business name.
Table 108: Optional transaction values
Page 402 of 476 November 2018
![](asset-193.png)
Appendix A Definitions of Request Fields
Value
Type Limits Sample code variable definition
Description
Wallet
indicator1
String 3-character alphanumeric string wallet_indicator;
Optional value to indicate when the credit card details were collected from a wallet
such as ApplePay, Android Pay, Visa Checkout, MasterCard MasterPass.
This field is applicable to Apple Pay and Android Pay transactions whereby the mer-
chant is using their own API to decrypt the payload. This is a mandatory field for
these types of Apple Pay and Android Pay transactions.
lApple Pay and Android Pay wallet indicator is applicable to Cavv Purchase –
Apple Pay and Cavv Pre-Authorization – Apple Pay
lVisa Checkout and MasterCard MasterPass wallet indicator is applicable to
basic Purchase and Pre-Authorization
Possible values are:
lAPP = Apple Pay In-App
lAPW = Apple Pay on the Web
lANP = Android Pay In-App
lVCO = Visa Checkout
lMMP = MasterCardMasterPass
NOTE: Please note that if this field is included to indicate Apple Pay or Android Pay, then Con-
venience Fee is not supported.
Vault transaction values
Phone number String 30-character alphanumeric string phone;
Phone number of the customer. Can be sent in when creating or updating a Vault pro-
file.
Email address String 30-character alphanumeric string email;
Email address of the customer. Can be sent in when creating or updating a Vault pro-
file.
Additional
notes
String 30-character alphanumeric string 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.
Table 108: Optional transaction values (continued)
For information about Customer Information request fields see 14 Customer Information
1Available to Canadian integrations only.
November 2018 Page 403 of 476
![](asset-194.png)
Moneris Gateway API- Integration Guide
For information about Address Verification Service (AVS) request fields see 9.1 Address Verification Ser-
vice
For information about Card Validation Digits (CVD) request fields see
For information about Recurring Billing request fields see Appendix A Recurring Billing.
For information about Convenience Fee request fields see Appendix A Convenience Fee.
For information about Level 2/3 Visa,Level 2/3 MasterCard and Level 2/3 American Express, see A.3 Defin-
ition of Request Fields for Level 2/3 - Visa,A.5 Definition of Request Fields for Level 2/3 - Amex
Page 404 of 476 November 2018
![](asset-195.png)
Appendix A Definitions of Request Fields
A.1 Definitions of Request Fields – Credential on File
Variable Name Type Limits Description
Issuer ID
NOTE: This variable is
required for all mer-
chant-intiated trans-
actions following the
first one; upon sending
the first transaction,
the Issuer ID value is
received in the trans-
action response and
then used in sub-
sequent transaction
requests.
String 15-character alpha-
numeric
Variable length
Unique identifier for the cardholder's
stored credentials
Sent back in the response from the
card brand when processing a Cre-
dential on File transaction
If the cardholder's credentials are
being stored for the first time, you
must save the Issuer ID on your sys-
tem to use in subsequent Credential
on File transactions (applies to mer-
chant-initiated transactions only)
Payment Indicator String 1-character alphabetic Indicates the intended or current use
of the credentials
Possible values for first transactions:
C - unscheduled credential on file (first trans-
action only)
R - recurring
Possible values for subsequent trans-
actions:
R - recurring
U - unscheduled merchant-initiated trans-
action
Z - unscheduled cardholder-initiated trans-
action
Payment Information String 1-character numeric Describes whether the transaction is
the first or subsequent in the series
Possible values are:
0 - first transaction in a series (storing pay-
ment details provided by the cardholder)
2 - subsequent transactions (using previously
stored payment details)
November 2018 Page 405 of 476
![](asset-196.png)
Moneris Gateway API- Integration Guide
A.2 Definition of Request Fields – Recurring
Recurring Billing Info Object Request Fields
Variable and Field Name Type and Limits Description
Number of Recurs
num_recurs
String
numeric, 1-99
The number of times that the
transaction must recur
Period
period
String
numeric, 1-999
Number of recur units that
must pass between recurring
billings
Start Date
start_date
String
YYYY/MM/DD
Date of the first future recurring
billing transaction
This value must be a date in the
future
If an additional charge is to be
made immediately, the value of
Start Now must be set to true
Start Now
start_now
String
true/false
If a single charge is to be made
against the card immediately,
set this value to true; the
amount to be billed imme-
diately may differ from the
amount billed on a regular
basis thereafter
If the billing is to start in the
future, set this value to false
When set to false, use Card Veri-
fication prior to sending the
Purchase with Recur and Cre-
dential on File objects
Recurring Amount
recur_amount
String
9-character decimal; Up to 6
digits (dollars)+ decimal point
+2 digits (cents) after the
decimal point
Amount of the recurring trans-
action
This is the amount that will be
billed on the Start Date and
then billed repeatedly based on
the interval defined by Period
and Recur Unit
Page 406 of 476 November 2018
![](asset-197.png)
Appendix A Definitions of Request Fields
Variable and Field Name Type and Limits Description
EXAMPLE:
123456.78
Recur Unit
recur_unit
String
day, week, month or eom
Unit to be used as a basis for
the interval
Works in conjunction with
Period to define the billing fre-
quency
Possible values are:
day
week
month
eom (end of month)
A.3 Definition of Request Fields for Level 2/3 - Visa
Req* Field Name Limits Set Method Description
Y NationalTax 12-character decimal TRANSACTIONNAME
.SetNationalTax
(national_tax);
Must reflect the
amount of
National Tax
(GST or HST)
appearing on
the invoice.
Minimum - 0.01
Maximum -
999999.99.
Must have 2
decimal places.
Y Merchant
VATRegistration/Single
Business Reference
Number
20-character alpha-
numeric
TRANSACTIONNAME
.SetMerchantVatNo
(merchant_vat_no);
Merchant’s Tax
Registration
Number
must be
provided if tax is
included on the
invoice
Table 1 Visa - Corporate Card CommonData - Level 2 Request Fields
November 2018 Page 407 of 476
![](asset-198.png)
Moneris Gateway API- Integration Guide
Req* Field Name Limits Set Method Description
NOTE: Must
not be all
spaces or all
zeroes
C Local Tax 12-character decimal TRANSACTIONNAME
.SetLocalTax
(local_tax);
Must reflect the
amount of Local
Tax (PST or QST)
appearing on
the invoice
If Local Tax
included then
must not be all
spaces or all zer-
oes; Must be
provided if Local
Tax (PST or QST)
applies
Minimum = 0.01
Maximum =
999999.99
Must have 2
decimal places
C Local Tax (PST or QST)
Registration Number
15-character alpha-
numeric
TRANSACTIONNAME
.SetLocalTaxNo
(local_tax_no);
Merchant's
Local Tax
(PST/QST) Regis-
tration Number
Must be
provided if tax is
included on the
invoice; If Local
Tax included
then must not
be all spaces or
all zeroes
Must be
provided if Local
Tax (PST or QST)
applies
Page 408 of 476 November 2018
![](asset-199.png)
Appendix A Definitions of Request Fields
Req* Field Name Limits Set Method Description
C Customer
VATRegistration Num-
ber
13-character alpha-
numeric
TRANSACTIONNAME
.SetCustomerVatNo
(customer_vat_no);
If the Cus-
tomer’s Tax
Registration
Number
appears on the
invoice to sup-
port tax exempt
transactions it
must be
provided here
C Customer Code/Cus-
tomer Reference Iden-
tifier (CRI)
16-character alpha-
numeric
TRANSACTIONNAME
.SetCri(cri); Value which the
customer may
choose to
provide to the
supplier at the
point of sale –
must be
provided if
given by the cus-
tomer
N Customer Code 17-character alpha-
numeric
TRANSACTIONNAME
.SetCustomerCode
(customer_code);
Optional cus-
tomer code field
that will not be
passed along to
Visa, but will be
included on
Moneris report-
ing
N Invoice Number 17-character alpha-
numeric
TRANSACTIONNAME
.SetInvoiceNumber
(invoice_number);
Optional invoice
number field
that will not be
passed along to
Visa, but will be
included on
Moneris report-
ing
*Y = Required, N= Optional, C = Conditional
Req Variable Name Field Name Size/Type Description
C* Buyer Name buyer_name 30-character alpha-
numeric
Buyer/Receipient
Name
Table 2 Visa - Corporate Card CommonData- Level 2 Request Fields (VSPurcha)
November 2018 Page 409 of 476
![](asset-19a.png)
Moneris Gateway API- Integration Guide
Req Variable Name Field Name Size/Type Description
*only required by
CRAif transaction is
>$150
C* Local tax rate local_tax_rate 4-character decimal Indicates the
detailed tax rate
applied in rela-
tionship to a local
tax amount
EXAMPLE: 8% PST
should be 8.0.
maximum 99.99
*Must be provided
if Local Tax (PST or
QST) applies.
N Duty Amount duty_amount 9-character decimal Duty on total pur-
chase amount
A minus sign
means 'amount is a
credit', plus sign or
no sign means
'amount is a debit'
maximum without
sign is 999999.99
N Invoice Discount
Treatment
discount_treatment 1-character numeric Indicates how the
merchant is man-
aging discounts
Must be one of the
following values:
0 - if no invoice level
discounts apply for this
invoice
1 - if Tax was cal-
culated on Post-Dis-
count totals
2 - if Tax was cal-
culated on Pre-Discount
totals
Page 410 of 476 November 2018
![](asset-19b.png)
Appendix A Definitions of Request Fields
Req Variable Name Field Name Size/Type Description
N Invoice Level Dis-
count Amount
discount_amt 9-character decimal Amount of dis-
count (if provided
at the invoice level
according to the
Invoice Discount
Treatment)
Must be non-zero if
Invoice Discount
Treatment is 1 or 2
Minimum amount
is 0.00 and max-
imum is 999999.99
C* Ship To Postal
Code / Zip Code
ship_to_pos_code 10-character alpha-
numeric
The postal code or
zip code for the des-
tination where
goods will be
delivered
*Required if ship-
ment is involved
Full alpha postal
code - Valid
ANA<space>NAN
format required if
shipping to an
address within
Canada
C Ship From Postal
Code / Zip Code
ship_from_pos_code 10-character alpha-
numeric
The postal code or
zip code from
which items were
shipped
For Canadian
addresses,requires
full alpha postal
code for the mer-
chant with Valid
ANA<space>NAN
format
C* Destination Coun-
try Code
des_cou_code 2-character alphanumeric Code of country
where purchased
goods will be
November 2018 Page 411 of 476
![](asset-19c.png)
Moneris Gateway API- Integration Guide
Req Variable Name Field Name Size/Type Description
delivered
Use ISO 3166-1
alpha-2 format
NOTE: Required if
it appears on the
invoice for an inter-
national trans-
action
Y Unique VAT
Invoice Refer-
ence Number
vat_ref_num 25-character alpha-
numeric
Unique Value
Added Tax Invoice
Reference Number
Must be populated
with the invoice
number and this
cannot be all
spaces or zeroes
Y Tax Treatment tax_treatment 1-character numeric Must be one of the
following values:
0 = Net Prices with tax
calculated at line item
level;
1 = Net Prices with tax
calculated at invoice
level;
2 = Gross prices given
with tax information
provided at line item
level;
3 = Gross prices given
with tax information
provided at invoice
level;
4 = No tax applies
(small merchant) on
the invoice for the trans-
action
N Freight/Shipping
Amount (Ship
Amount)
freight_amount 9-character decimal Freight charges on
total purchase
If shipping is not
provided as a line
Page 412 of 476 November 2018
![](asset-19d.png)
Appendix A Definitions of Request Fields
Req Variable Name Field Name Size/Type Description
item it must be
provided here, if
applicable
Signed monetary
amount: minus
sign means
'amount is a credit',
plus sign or no sign
means 'amount is a
debit', maximum
without sign is
999999.99
C GST HST Freight
Rate
gst_hst_freight_rate 4-character decimal Rate of GST
(excludes PST) or
HST charged on the
shipping amount
(in accordance with
the Tax Treatment)
If Freight/Shipping
Amount is
provided then this
(National GST or
HST) tax rate must
be provided.
Monetary amount,
maximum is 99.99.
Such as 13% HST is
13.00
C GST HST Freight
Amount
gst_hst_freight_
amount
9-character decimal Amount of GST
(excludes PST) or
HST charged on the
shipping amount
If Freight/Shipping
Amount is
provided then this
(National GST or
HST) tax amount
must be provided if
taxTreatment is 0
or 2
Signed monetary
November 2018 Page 413 of 476
![](asset-19e.png)
Moneris Gateway API- Integration Guide
Req Variable Name Field Name Size/Type Description
amount: maximum
without sign is
999999.99.
Req Variable Name Field Name Size/Type Description
C Item Commodity
Code
item_com_code 12-character alpha-
numeric
Line item Com-
modity Code (if this
field is not sent,
then productCode
must be sent)
Y Product Code product_code 12-character alpha-
numeric
Product code for
this line item – mer-
chant’s product
code, man-
ufacturer’s product
code or buyer’s
product code
Typically this will be
the SKU or iden-
tifier by which the
merchant tracks
and prices the item
or service
This should always
be provided for
every line item
Y Item Description item_description 35-character alpha-
numeric
Line item descrip-
tion
Y Item Quantity item_quantity 12-character decimal Quantity invoiced
for this line item
Up to 4 decimal
places supported,
whole numbers are
accepted
Minimum = 0.0001
Table 3 Visa - Line Item Details - Level 3 Request Fields (VSPurchl)
Page 414 of 476 November 2018
![](asset-19f.png)
Appendix A Definitions of Request Fields
Req Variable Name Field Name Size/Type Description
Maximum =
999999999999
Y Item Unit of
Measure
item_uom 2-character alphanumeric Unit of Measure
Use ANSI X-12 EDI
Allowable Units of
Measure and
Codes
Y Item Unit Cost unit_cost 12-character decimal Line item cost per
unit
2-4 decimal places
accepted
Minimum = 0.0001
Maximum =
999999.9999
N VAT Tax Amount vat_tax_amt 12-character decimal Any value-added
tax or other sales
tax amount
Must have 2
decimal places
Minimum = 0.01
Maximum =
999999.99
N VAT Tax Rate vat_tax_rate 4-character decimal Sales tax rate
EXAMPLE: 8% PST
should be 8.0
maximum 99.99
Y Discount Treat-
ment
discount_treatmentL 1-character numeric Must be one of the
following values:
0 if no invoice level dis-
counts apply for this
invoice
1 if Tax was calculated
on Post-Discount totals
November 2018 Page 415 of 476
![](asset-1a0.png)
Moneris Gateway API- Integration Guide
Req Variable Name Field Name Size/Type Description
2 if Tax was calculated
on Pre-Discount totals.
C Discount Amount discount_amtL 12-character decimal Amount of dis-
count, if provided
for this line item
according to the
Line Item Discount
Treatment
Must be non-zero if
Line Item Discount
Treatment is 1 or 2
Must have 2
decimal places
Minimum = 0.01
Maximum =
999999.99
A.4 Definition of Request Fields for Level 2/3 - MasterCard
MCCorpais Objects Description
MCCorpac Corporate Card Common data
MCCorpal Line Item Details
Table 1 Objects - Level 2/3 MasterCard
Req Variable Name Field Name Size/Type Description
N AustinTetraNumber Austin-
Tetra Num-
ber
15-character
alpha-
numeric
Merchant’s Austin-Tetra Num-
ber
N NaicsCode NAICS Code 15-character
alpha-
numeric
North American Industry Clas-
sification System (NAICS) code
assigned to the merchant
N CustomerCode Customer
Code
25-character
alpha-
A control number, such as pur-
chase order number, project
Table 2 MasterCard - Corporate Card Common Data (MCCorpac) - Level 2 Request Fields
Page 416 of 476 November 2018
![](asset-1a1.png)
Appendix A Definitions of Request Fields
Req Variable Name Field Name Size/Type Description
numeric number, department alloc-
ation number or name that
the purchaser supplied the
merchant. Left-justified; may
be spaces
N UniqueInvoiceNumber Unique
Invoice
Number
17-character
alpha-
numeric
Unique number associated
with the individual transaction
provided by the merchant
N CommodityCode Com-
modity
Code
15-character
alpha-
numeric
Code assigned by the mer-
chant that best categorizes
the item(s) being purchased
N OrderDate Order Date 6-character
numeric
The date the item was
ordered. If present, must con-
tain a valid date in the format
YYMMDD.
N CorporationVatNumber Cor-
poration
VAT Num-
ber
20-character
alpha-
numeric
Contains a corporation’s value
added tax (VAT) number
N CustomerVatNumber Customer
VAT Num-
ber
20-character
alpha-
numeric
Contains the VAT number for
the customer/cardholder
used to identify the customer
when purchasing goods and
services from the merchant
N FreightAmount Freight
Amount
12-character
decimal
The freight on the total pur-
chase. Must have 2 decimals
N DutyAmount Duty
Amount
12-character
decimal
The duty on the total pur-
chase, Must have 2 decimals
N DestinationProvinceCode Destination
State /
Province
Code
3-character
alpha-
numeric
State or Province of the coun-
try where the goods will be
delivered. Left justified with
trailing spaces. e.g., ONT -
Ontario
N DestinationCountryCode Destination
Country
Code
3-character
alpha-
numeric
The country code where
goods will be delivered. Left
justified with trailing spaces.
e.g., CAN - Canada
November 2018 Page 417 of 476
![](asset-1a2.png)
Moneris Gateway API- Integration Guide
Req Variable Name Field Name Size/Type Description
N ShipFromPosCode Ship From
Postal
Code
10-character
alpha-
numeric
The postal code or zip code
from which items were
shipped
N ShipToPosCode Destination
Postal
Code
10-character
alpha-
numeric
The postal code or zip code
where goods will be delivered
N AuthorizedContactName Authorized
Contact
Name
36-character
alpha-
numeric
Name of an individual or com-
pany contacted for company
authorized purchases
N AuthorizedContactPhone Authorized
Contact
Phone
17-character
alpha-
numeric
Phone number of an indi-
vidual or company contacted
for company authorized pur-
chases
N AdditionalCardAcceptordata Additional
Card
Acceptor
Data
40-character
alpha-
numeric
Information pertaining to the
card acceptor
N CardAcceptorType Card
Acceptor
Type
8-character
alpha-
numeric
Various classifications of busi-
ness ownership characteristics
This field takes 8 characters.
Each character represents a
different component, as fol-
lows:
1st character represents ‘Busi-
ness Type’ and contains a
code to identify the specific
classification or type of busi-
ness:
1. Corporation
2. Not known
3. Individual/Sole Pro-
prietorship
4. Partnership
5. Asso-
ciation/Estate/Trust
6. Tax Exempt Organ-
izations (501C)
7. International Organ-
ization
Page 418 of 476 November 2018
![](asset-1a3.png)
Appendix A Definitions of Request Fields
Req Variable Name Field Name Size/Type Description
8. Limited Liability Com-
pany (LLC)
9. Government Agency
2nd character represents 'Busi-
ness Owner Type'. Contains a
code to identify specific char-
acteristics about the business
owner.
1 - No application clas-
sification
2 - Female business
owner
3 - Physically han-
dicapped female busi-
ness owner
4 - Physically han-
dicapped male business
owner
0 - Unknown
3rd character represents 'Busi-
ness Certification Type'. Con-
tains a code to identify specific
characteristics about the busi-
ness certification type, such as
small business, dis-
advantaged, or other cer-
tification type:
1 - Not certified
2 - Small Business
Administration (SBA)
certification small busi-
ness
3 - SBA certification as
small disadvantaged
business
4 - Other government
or agency-recognized
certification (such as
Minority Supplier Devel-
opment Council)
November 2018 Page 419 of 476
![](asset-1a4.png)
Moneris Gateway API- Integration Guide
Req Variable Name Field Name Size/Type Description
5 - Self-certified small
business
6 - SBA certification as
small and other gov-
ernment or agency-
recognized certification
7 - SBA certification as
small disadvantaged
business and other gov-
ernment or agency-
recognized certification
8 - Other government
or agency-recognized
certification and self-cer-
tified small business
A - SBA certification as 8
(a)
B - Self-certified small
disadvantaged busi-
ness (SDB)
C - SBA certification as
HUBZone
0 - Unknown
4th character represents 'Busi-
ness Racial/Ethnic Type'. Con-
tains a code identifying the
racial or ethnic type of the
majority owner of the busi-
ness.
1 - African American
2 - Asian Pacific Amer-
ican
3 - Subcontinent Asian
American
4 - Hispanic American
5 - Native American
Indian
6 - Native Hawaiian
7 - Native Alaskan
8 - Caucasian
9 - Other
Page 420 of 476 November 2018
![](asset-1a5.png)
Appendix A Definitions of Request Fields
Req Variable Name Field Name Size/Type Description
0 - Unknown
5th character represents 'Busi-
ness Type Provided Code'
Y - Business type is
provided.
N - Business type was
not provided.
R - Card acceptor
refused to provide busi-
ness type
6th character represents 'Busi-
ness Owner Type Provided
Code'
Y - Business owner type
is provided.
N - Business owner type
was not provided.
R - Card acceptor
refused to provide busi-
ness type
7th character represents 'Busi-
ness Certification Type
Provided Code'
Y - Business certification
type is provided.
N - Business cer-
tification type was not
provided.
R - Card acceptor
refused to provide busi-
ness type
8th character represents 'Busi-
ness Racial/Ethnic Type’
Y - Business racial/eth-
nic type is provided.
N - Business racial/eth-
nic type was not
November 2018 Page 421 of 476
![](asset-1a6.png)
Moneris Gateway API- Integration Guide
Req Variable Name Field Name Size/Type Description
provided.
R - Card acceptor
refused to provide busi-
ness racial/ethnic type
N CardAcceptorTaxId Card
Acceptor
Tax ID
20-character
alpha-
numeric
US Federal tax ID number for
value added tax (VAT) ID.
N CardAc-
ceptorReferenceNumber
Card
Acceptor
Reference
Number
25-character
alpha-
numeric
Code that facilitates card
acceptor/corporation com-
munication and record keep-
ing
N CardAcceptorVatNumber Card
Acceptor
VAT Num-
ber
20-character
alpha-
numeric
Value added tax (VAT) number
for the card acceptor location
used to identify the card
acceptor when collecting and
reporting taxes
C-
*
Tax Tax up to 6
arrays
Can have up to 6 arrays con-
tains different tax details. See
Tax Array below for each field
description.
*This field is conditionally man-
datory — if you use this array,
you must fill in all tax array
fields as listed in the Tax Array
Request Fields below.
Req Variable Name Field Name Size/Type Description
N CustomerCode Customer Code 25-character alpha-
numeric
A control number,
such as purchase
order number, pro-
ject number,
department alloc-
ation number or
name that the pur-
Table 3 MasterCard - Line Item Details (MCCorpal)- Level 3 Request Fields
Page 422 of 476 November 2018
![](asset-1a7.png)
Appendix A Definitions of Request Fields
Req Variable Name Field Name Size/Type Description
chaser supplied the
merchant. Left-jus-
tified; may be
spaces
N LineItemDate Line Item Date 6-character numeric The purchase date
of the line item ref-
erenced in the asso-
ciated Corporate
Card Line Item
Detail.
YYMMDD format
N ShipDate Ship Date 6-character numeric The date the mer-
chandise was
shipped to the des-
tination.
YYMMDD format
N OrderDate Order Date 6-character numeric The date the item
was ordered
YYMMDD format
Y ProductCode Product Code 12-character alpha-
numeric
Line item Product
Code (if this field is
not sent, then
itemComCode)
If the order has a
Freight/Shipping
line item, the pro-
ductCode value
has to be
“Freight/Shipping”
If the order has a
Discount line item,
the productCode
value has to be
“Discount”
Y ItemDescription Item Description 35-character alpha-
numeric
Line Item descrip-
tion
Y ItemQuantity Item Quantity 12-character alpha- Quantity of line
November 2018 Page 423 of 476
![](asset-1a8.png)
Moneris Gateway API- Integration Guide
Req Variable Name Field Name Size/Type Description
numeric item
Y UnitCost Unit Cost 12-character decimal Line item cost per
unit.
Must contain a
minimum of 2
decimal places, up
to 5 decimal places
supported.
Minimum amount
is 0.00001 and max-
imum is
999999.99999
Y ItemUnitMeasure Item Unit Measure 12-character alpha-
numeric
The line item unit
of measurement
code
Y ExtItemAmount Extended Item
Amount
9-character decimal Contains the indi-
vidual item
amount that is nor-
mally calculated as
price multiplied by
quantity
Must contain 2
decimal places
Minimum amount
is 0.00 and max-
imum is 999999.99
N DiscountAmount Discount Amount 9-character decimal Contains the item
discount amount
Must contain 2
decimal places
Minimum amount
is 0.00 and max-
imum is 999999.99
N CommodityCode Commodity Code 15-character alpha-
numeric
Code assigned to
the merchant that
best categorizes
the item(s) being
purchased
Page 424 of 476 November 2018
![](asset-1a9.png)
Appendix A Definitions of Request Fields
Req Variable Name Field Name Size/Type Description
C* Tax Tax Up to 6 arrays Can have up to 6
arrays contains dif-
ferent tax details.
See Tax Array
below for each field
description.
*This field is con-
ditionally man-
datory — if you use
this array, you
must fill in all tax
array fields as listed
in the Tax Array
Request Fields
below.
Req Variable Name Field Name Size/Type Description
M tax_amount Tax Amount 12-character decimal Contains detail tax
amount for pur-
chase of goods or
service
Must be 2 decimal
places
Maximum
999999.99
M tax_rate Tax Rate 5-character decimal Contains the
detailed tax rate
applied in rela-
tionship to a spe-
cific tax amount
EXAMPLE: 5% GST
should be ‘5.0’ or
or 9.975% QST
should be ‘9.975’
May contain up to
3 decimals, min-
imum 0.001, max-
Table 4 Tax Array Request Fields - MasterCard Level 2/3 Transactions
November 2018 Page 425 of 476
![](asset-1aa.png)
Moneris Gateway API- Integration Guide
Req Variable Name Field Name Size/Type Description
imum up to 9999.9
M tax_type Tax Type 4-character alphanumeric Contains tax type
such as
GST,QST,PST,HST
M tax_id Tax ID 20-character alpha-
numeric
Provides an iden-
tification number
used by the card
acceptor with the
tax authority in rela-
tionship to a spe-
cific tax amount
such as GST/HST
number
M tax_included_in_
sales
Tax included in sales
indicator
1-character alphanumeric This is the indicator
used to reflect addi-
tional tax capture
and reporting.
Valid values are:
Y = Tax included in total
purchase amount
N = Tax not included in
total purchase amount
A.5 Definition of Request Fields for Level 2/3 - Amex
Req Variable Name Field Name Size/Type Description
C big04 Purchase Order Num-
ber
22-character alpha-
numeric
The cardholder sup-
plied Purchase Order
Number, which is
entered by the mer-
chant at the point-of-
sale
This entry is used in
the State-
ment/Reporting pro-
cess and may include
Table 1 Amex- Level 2/3 Request Fields - Table 1 - Heading Fields
Page 426 of 476 November 2018
![](asset-1ab.png)
Appendix A Definitions of Request Fields
Req Variable Name Field Name Size/Type Description
accounting inform-
ation specific to the
client
Mandatory if the mer-
chant's customer
provides a Purchase
Order Number
N big05 Release Number 30-character alpha-
numeric
A number that iden-
tifies a release
against a Purchase
Order previously
placed by the parties
involved in the trans-
action
N big10 Invoice Number 8-character alpha-
numeric
Contains the Amex
invoice/reference
number
Y n101 Entity Identifier Code 2-character alpha-
numeric
Supported values:
‘R6’ - Requester
(required)
‘BG’ - Buying Group
(optional)
‘SF’ - Ship From
(optional)
‘ST’ - Ship To (optional)
‘40’ - Receiver (optional)
Y n102 Name 40-character alpha-
numeric n101
code
n102
meaning
R6 Requester
Name
BG Buying Group
Name
SF Ship
FromName
ST Ship To Name
40 ReceiverName
November 2018 Page 427 of 476
![](asset-1ac.png)
Moneris Gateway API- Integration Guide
Req Variable Name Field Name Size/Type Description
N n301 Address 40-character alpha-
numeric
Address
N n401 City 30-character alpha-
numeric
City
N n402 State or Province 2-character alpha-
numeric
State or Province
N n403 Postal Code 15-character alpha-
numeric
Postal Code
Y ref01 Reference Iden-
tification Qualifier
2-character alpha-
numeric
This element may
contain the following
qualifiers for the cor-
responding occur-
rences of the
N1Loop:
n101
value
ref01
denotation
R6 Supported val-
ues:
4C - Shipment
Destination
Code (man-
datory)
CR - Customer
Reference
Number (con-
ditional)
BG n/a
SF n/a
ST n/a
40 n/a
Y ref02 Reference Iden-
tification
15-character alpha-
numeric
VRis the Vendor
IDNumber, other
codes describe the
following:
Page 428 of 476 November 2018
![](asset-1ad.png)
Appendix A Definitions of Request Fields
Req Variable Name Field Name Size/Type Description
ref01
code
ref02
denotation
4C Ship to Zip or
Canadian
Postal Code
(required)
CR Cardmember
Reference
Number
(optional)
Req Variable Name Field Name Size/Type Description
Y it102 Line Item Quantity
Invoiced
10-character decimal Quantity of line
item.
Up to 2 decimal
places supported.
Minimum amount
is 0.0 and max-
imum is
9999999999.
Y it103 Unit or Basis for Meas-
urement Code
2-character alphanumeric The line item unit of
measurement code
Must contain a
code that specifies
the units in which
the value is
expressed or the
manner in which a
measurement is
taken
EXAMPLE: EA =
each, E5=inches
See ANSI X-12 EDI
Allowable Units of
Measure and
Codes for the list of
codes
Table 2 Amex - Level 2/3 Request Fields - Table 2 - Detail Fields
November 2018 Page 429 of 476
![](asset-1ae.png)
Moneris Gateway API- Integration Guide
Req Variable Name Field Name Size/Type Description
Y it104 Unit Price 15-character decimal Line item cost per
unit
Must contain 2
decimal places
Minimum amount
is 0.00 and max-
imum is 999999.99
N it105 Basis or Unit Price
Code
2-character alphanumeric Code identifying
the type of unit
price for an item
EXAMPLE: DR =
dealer, AP = advise
price
See ASC X12 004010
Element 639 for list
of codes
N it10618 Product/Service ID
Qualifier
2-character alphanumeric Supported values:
‘MG’ - Manufacturer’s
Part Number
‘VC’ - Supplier Catalog
Number
‘SK’ - Supplier Stock
Keeping Unit Number
‘UP’ - Universal Product
Code
‘VP’ – Vendor Part Num-
ber
‘PO’ – Purchase Order
Number
‘AN’ – Client Defined
Asset Code
N it10719 Product/Service ID it10618 it10719 -
size/type
VC 20-character
alphanumeric
PO 22-character
alphanumeric
Product/Service ID
corresponds to the
preceding qualifier
defined in it10618
The maximum
length depends on
Page 430 of 476 November 2018
![](asset-1af.png)
Appendix A Definitions of Request Fields
Req Variable Name Field Name Size/Type Description
it10618 it10719 -
size/type
Other 30-character
alphanumeric
the qualifier
defined in it10618
C txi01 Tax Type code 2-character alphanumeric Supported values:
‘CA’ – City Tax
(optional)
‘CT’ – County/Tax
(optional)
‘EV’ – Environmental
Tax (optional)
‘GS’ – Good and Ser-
vices Tax (GST)
(optional)
‘LS’ – State and Local
Sales Tax (optional)
‘LT’ – Local Sales Tax
(optional)
‘PG’ – Provincial Sales
Tax (PST) (optional)
‘SP’ – State/Provincial
Tax a.k.a. Quebec Sales
Tax (QST) (optional)
‘ST’ – State Sales Tax
(optional)
‘TX’ – All Taxes
(required)
‘VA’ – Value-Added Tax
a.k.a. Canadian Har-
monized Sales Tax
(HST) (optional)
C txi02 Monetary Amount 6-character decimal This element may
contain the mon-
etary tax amount
that corresponds
to the Tax Type
Code in txi01
NOTE:
If txi02 is used in man-
datory occurrence
November 2018 Page 431 of 476
![](asset-1b0.png)
Moneris Gateway API- Integration Guide
Req Variable Name Field Name Size/Type Description
txi01=TX, txi02 must
contain the total tax
amount applicable to
the entire invoice
(transaction)
If taxes are not applic-
able for the entire
invoice (transaction),
txi02 must be 0.00.
The maximum
value that can be
entered in this field
is “9999.99”, which
is $9,999.99 (CAD)
A debit is entered
as: 9999.99
A credit is entered
as: –9999.99
C txi03 Percent 10-character decimal Contains the tax
percentage (in
decimal format)
that corresponds
to the tax type
code defined in
txi01
Up to 2 decimal
places supported
C txi06 Tax Exempt Code 1-character alphanumeric This element may
contain the Tax
Exempt Code that
identifies the
exemption status
from sales and tax
that corresponds
to the Tax Type
Code in txi01
Supported values:
1 – Yes (Tax Exempt)
2 – No (Not Tax
Exempt)
4 – Not Exempt/For
Resale
Page 432 of 476 November 2018
![](asset-1b1.png)
Appendix A Definitions of Request Fields
Req Variable Name Field Name Size/Type Description
A – Labor Taxable,
Material Exempt
B – Material Taxable,
Labor Exempt
C – Not Taxable
F – Exempt (Goods /
Services Tax)
G – Exempt (Provincial
Sales Tax)
L – Exempt Local Ser-
vice
R – Recurring Exempt
U – Usage Exempt
Y pam05 Line Item Extended
Amount
8-character decimal Contains the indi-
vidual item amount
that is normally cal-
culated as price mul-
tiplied by quantity
Must contain 2
decimal places
Minimum amount
is 0.00 and max-
imum is 99999.99
Y pid05 Line Item Description 80-character alpha-
numeric
Line Item descrip-
tion
Contains the
description of the
individual item pur-
chased
This field pertain to
each line item in
the transaction
November 2018 Page 433 of 476
![](asset-1b2.png)
Moneris Gateway API- Integration Guide
Req Variable Name Field Name Size/Type Description
C txi01 Tax Type code 2-character alphanumeric Supported values:
‘CA’ – City Tax
(optional)
‘CT’ – County/Tax
(optional)
‘EV’ – Environmental
Tax (optional)
‘GS’ – Good and Ser-
vices Tax (GST)
(optional)
‘LS’ – State and Local
Sales Tax (optional)
‘LT’ – Local Sales Tax
(optional)
‘PG’ – Provincial Sales
Tax (PST) (optional)
‘SP’ – State/Provincial
Tax a.k.a. Quebec Sales
Tax (QST) (optional)
‘ST’ – State Sales Tax
(optional)
‘TX’ – All Taxes
(required)
‘VA’ – Value-Added Tax
a.k.a. Canadian Har-
monized Sales Tax
(HST) (optional)
C txi02 Monetary Amount 6-character decimal This element may
contain the mon-
etary tax amount
that corresponds
to the Tax Type
Code in txi01
NOTE:
If txi02 is used in man-
datory occurrence
txi01=TX, txi02 must
contain the total tax
amount applicable to
the entire invoice
(transaction)
If taxes are not applic-
Table 3 Amex - Level 2/3 Request Fields - Table 3 - Summary Fields
Page 434 of 476 November 2018
![](asset-1b3.png)
Appendix A Definitions of Request Fields
Req Variable Name Field Name Size/Type Description
able for the entire
invoice (transaction),
txi02 must be 0.00.
The maximum
value that can be
entered in this field
is “9999.99”, which
is $9,999.99 (CAD)
A debit is entered
as: 9999.99
A credit is entered
as: –9999.99
C txi03 Percent 10-character decimal Contains the tax
percentage (in
decimal format)
that corresponds
to the tax type
code defined in
txi01
Up to 2 decimal
places supported
C txi06 Tax Exempt Code 1-character alphanumeric Supported values:
1 – Yes (Tax Exempt)
2 – No (Not Tax
Exempt)
4 – Not Exempt/For
Resale
A – Labor Taxable,
Material Exempt
B – Material Taxable,
Labor Exempt
C – Not Taxable
F – Exempt (Goods /
Services Tax)
G – Exempt (Provincial
Sales Tax)
L – Exempt Local Ser-
vice
November 2018 Page 435 of 476
![](asset-1b4.png)
Moneris Gateway API- Integration Guide
Req Variable Name Field Name Size/Type Description
R – Recurring Exempt
U – Usage Exempt
A.6 Definition of Request Fields – Offlinx™
Applies to Offlinx™ integration only
Variable and Field Name Type and Limits Description
Card Match ID String
50-character alphanumeric
Corresponds to the Transaction
IDused for the Offlinx™ Card
MatchPixelTag, a unique identifier
created by the merchant
Must be unique value for each trans-
action
Page 436 of 476 November 2018
![](asset-1b5.png)
Appendix B Definitions of Response Fields
Value Type Limits Get Method
Description
General response fields
Card type String 2-character
alphabetic (min. 1)
receipt.GetCardType();
Represents the type of card in the transaction, e.g., Visa, Mastercard.
Possible values:
lV = Visa
lM = Mastercard
lAX = American Express
lDC = Diner's Card
lNO = Novus/Discover
lSE = Sears
lD = Debit
lC1 = JCB
Transaction
amount
String 9-character
decimal
receipt.GetTransAmount();
Transaction amount that was processed.
Transaction num-
ber
String 255-character
alphanumeric
receipt.GetTxnNumber();
Gateway Transaction identifier often needed for follow-on transactions (such as
Refund and Purchase Correction) to reference the originally processed transaction.
Receipt ID String 50-character
alphanumeric
receipt.GetReceiptId();
Order ID that was specified in the transaction request.
Transaction type String 2-character
alphanumeric
receipt.GetTransType();
l0 = Purchase
l1 = Pre-Authorization
l2 = Completion
l4 = Refund
l11 = Void
Table 109: Receipt object response values
November 2018 Page 437 of 476
![](asset-1b6.png)
Moneris Gateway API- Integration Guide
Value Type Limits Get Method
Description
Reference number String 18-character
numeric
receipt.GetReferenceNum();
Terminal used to process the transaction as well as the shift, batch and sequence
number. This data is typically used to reference transactions on the host systems,
and must be displayed on any receipt presented to the customer.
This information is to be stored by the merchant.
Example: 660123450010690030
l66012345: Terminal ID
l001: Shift number
l069: Batch number
l003: Transaction number within the batch.
Response code String 3-character
numeric
receipt.GetResponseCode();
l< 50: Transaction approved
l≥ 50: Transaction declined
lNull: Transaction incomplete.
For further details on the response codes that are returned, see the Response
Codes document at https://developer.moneris.com.
ISO String 2-character
numeric
receipt.GetISO();
ISO response code
Bank totals Object receipt.GetBankTotals();
Response data returned in a Batch Close and Open Totals request. See "Definitions
of Response Fields" on the previous page.
Message String 100-character
alphanumeric
receipt.GetMessage();
Response description returned from issuer.
The message returned from the issuer is intended for merchant information only,
and is not intended for customer receipts.
Table 109: Receipt object response values (continued)
Page 438 of 476 November 2018
![](asset-1b7.png)
Appendix B Definitions of Response Fields
Value Type Limits Get Method
Description
Authorization
code
String 8-character
alphanumeric
receipt.GetAuthCode();
Authorization code returned from the issuing institution.
Complete String true/false receipt.GetComplete();
Transaction was sent to authorization host and a response was received
Transaction date String Format: yyyy-mm-
dd
receipt.GetTransDate();
Processing host date stamp
Transaction time String Format: ##:##:## receipt.GetTransTime();
Processing host time stamp
Ticket String N/A receipt.GetTicket();
Reserved field.
Timed out String true/false receipt.GetTimedOut();
Transaction failed due to a process timing out.
Is Visa Debit String true/false receipt.GetIsVisaDebit();
Indicates whether the card processed is a Visa Debit.
Batch Close/Open Totals response fields
Processed card
types
String
Array
N/A receipt.GetCreditCards(ecr);
Returns all of the processed card types in the current batch for the terminal ID/ECR
Number from the request.
Terminal IDs String 8-character alpha-
numeric
receipt.GetTerminalIDs();
Returns the terminal ID/ECR Number from the request.
Purchase count String 4-character
numeric
receipt.GetPurchaseCount(ecr,
cardType);
Indicates the # of Purchase, Pre-Authorization Completion and Force Post trans-
actions processed. If none were processed in the batch, then the value returned
will be 0000.
Table 109: Receipt object response values (continued)
November 2018 Page 439 of 476
![](asset-1b8.png)
Moneris Gateway API- Integration Guide
Value Type Limits Get Method
Description
Purchase amount String 11-character alpha-
numeric
receipt.GetPurchaseAmount(ecr,
cardType);
Indicates the dollar amount processed for Purchase, Pre-Authorization Completion
or Force Post transactions. This field begins with a + and is followed by 10 numbers,
the first 8 indicate the amount and the last 2 indicate the penny value.
EXAMPLE: +0000000000 = 0.00 and +0000041625 = 416.25
Refund count String 4-character
numeric
receipt.GetRefundCount(ecr,
cardType);
Indicates the # of Refund or Independent Refund transactions processed. If none
were processed in the batch, then the value returned will be 0000.
Refund amount String 11-character alpha-
numeric
receipt.GetRefundAmount(ecr,
cardType);
Indicates the dollar amount processed for Refund, Independent Refund or ACH
Credit transactions. This field begins with a + and is followed by 10 numbers, the
first 8 indicate the amount and the last 2 indicate the penny value.
Example, +0000000000 = 0.00 and +0000041625 = 416.25
Correction count String 4-character
numeric
receipt.GetCorrectionCount(ecr,
cardType);
Indicates the # of Purchase Correction transactions processed. If none were pro-
cessed in the batch, then the value returned will be 0000.
Correction
amount
String 11-character alpha-
numeric
receipt.GetCorrectionAmount
(ecr,cardType);
Indicates the dollar amount processed for Purchase Correction transactions. This
field begins with a + and is followed by 10 numbers, the first 8 indicate the amount
and the last 2 indicate the penny value.
EXAMPLE: +0000000000 = 0.00 and +0000041625 = 416.25
Recurring Billing Response Fields (see Appendix A, page 1)
Recurring billing
success
String true/false receipt.GetRecurSuccess();
Indicates whether the recurring billing transaction has been successfully set up for
future billing.
Table 109: Receipt object response values (continued)
Page 440 of 476 November 2018
![](asset-1b9.png)
Appendix B Definitions of Response Fields
Value Type Limits Get Method
Description
Recur update suc-
cess
String true/false receipt.GetRecurUpdateSuccess();
Indicates recur update success.
Next recur date String yyyy-mm-dd receipt.GetNextRecurDate();
Indicates next recur billing date.
Recur end date String yyyy-mm-dd receipt.GetRecurEndDate();
Indicates final recur billing date.
Status Check response fields (see )
Status code String 3-character alpha-
numeric
receipt.GetStatusCode();
l< 50: Transaction found and successful
l≥ 50: Transaction not found and not successful
NOTE: the status code is only populated if the connection object's Status Check property is set to
true.
Status message String found/not found receipt.GetStatusMessage();
lFound: 0 ≤ Status Code ≤ 49
lNot Found or null: 50 ≤ Status Code ≤ 999.
NOTE: The status message is only populated if the connection object's Status Check property is
set to true.
AVSresponse fields (see 9.1, page 283)
AVS result code String 1-character alpha-
numeric
receipt.GetAvsResultCode();
Indicates the address verification result. For a full list of possible response codes
refer to Section Appendix B.
CVDresponse fields (see )
CVD result code String 2-character alpha-
numeric
receipt.GetCvdResultCode();
Indicates the CVD validation result. The first byte is the numeric CVD indicator sent
in the request; the second byte is the response code. Possible response codes are
shown in Appendix B
MPIresponse fields (see "MPI" on page1)
Table 109: Receipt object response values (continued)
November 2018 Page 441 of 476
![](asset-1ba.png)
Moneris Gateway API- Integration Guide
Value Type Limits Get Method
Description
Type String 99-character alpha-
numeric
VERes, PARes or error defines what type of response you are receiving .
Success Boolean true/false receipt.GetMpiSuccess();
True if attempt was successful, false if attempt was unsuccessful.
Message String 100-character
alphabetic
receipt.GetMpiMessage();
MPITXN transactions can produce the following values:
lY: Create VBV verification form popup window.
lN: Send purchase or preauth with crypt type 6
lU: Send purchase or preauth with crypt type 7.
MPIACS transactions can produce the following values:
lY or A: (Also receipt.getMpiSuccess()=true) Proceed with cavv pur-
chase or cavv preauth.
lN: Authentication failed or high-risk transaction. It is recommended that you
do not to proceed with the transaction.
Depending on a merchant’s risk tolerance and results from other methods
of fraud detection, transaction may proceed with crypt type 7.
lU or time out: Send purchase or preauth as crypt type 7.
Term URL String 255-character
alphanumeric
URL to which the PARes is returned
MD String 1024-character
alphanumeric
Merchant-defined data that was echoed back
ACSURL String 255-character
alphanumeric
URL that will be for the generated pop-up
Table 109: Receipt object response values (continued)
Page 442 of 476 November 2018
![](asset-1bb.png)
Appendix B Definitions of Response Fields
Value Type Limits Get Method
Description
MPI CAVV String 28-character alpha-
numeric
receipt.GetMpiCavv();
VbV/MCSC/AmericanExpress SafeKey authentication data
MPIE-Commerce
Indicator
String 1-character alpha-
numeric
CAVV result code String 1-character alpha-
numeric
receipt.GetCavvResultCode();
Indicates the Visa CAVV result. For more information, see 8.6.7 Cavv Result Codes
for Verified by Visa.
l0 = CAVV authentication results invalid
l1 = CAVV failed validation; authentication
l2 = CAVV passed validation; authentication
l3 = CAVV passed validation; attempt
l4 = CAVV failed validation; attempt
l7 = CAVV failed validation; attempt (US issued cards only)
l8 = CAVV passed validation; attempt (US issued cards only)
lThe CAVV result code indicates the result of the CAVV validation.
MPI inline form receipt.GetInLineForm());
Vault response fields (see 4.1, page 52)
Data key String 28-character alpha-
numeric
receipt.GetDataKey();
The data key response field is populated when you send a Vault Add Credit Card –
ResAddCC (page 54),Vault Encrypted Add Credit Card – EncResAddCC (page 58),
Vault Tokenize Credit Card – ResTokenizeCC (page 81),Vault Temporary Token Add
– ResTempAdd (page 61) or Vault Add Token – ResAddToken (page 77) transaction.
It is the profile identifier that all future financial Vault transactions will use to asso-
ciate with the saved information.
Vault payment
type
String cc receipt.GetPaymentType();
Indicates the payment type associated with a Vault profile
Expiring card's
Payment type
String cc receipt.GetExpPaymentType();
Indicates the payment type associated with a Vault profile. Applicable to Vault Get
Expiring transaction type.
Table 109: Receipt object response values (continued)
November 2018 Page 443 of 476
![](asset-1bc.png)
Moneris Gateway API- Integration Guide
Value Type Limits Get Method
Description
Vault masked PAN String 20-character
numeric
receipt.GetResMaskedPan();
Returns the first 4 and/or last 4 of the card number saved in the profile.
Expiring card's
Masked PAN
String 20-character
numeric
receipt.GetExpMaskedPan();
Returns the first 4 and/or last 4 of the card number saved in the profile. Applicable
to Vault Get Expiring transaction type.
Vault success String true/false receipt.GetResSuccess();
Indicates whether Vault transaction was successful.
Vault customer ID String 30-character alpha-
numeric
receipt.GetResDataCustId();
Returns the customer ID saved in the profile.
Expiring card's cus-
tomer ID
String 30-character alpha-
numeric
receipt.GetExpCustId();
Returns the customer ID saved in the profile. Applicable to Vault Get Expiring trans-
action type.
Vault phone num-
ber
String 30-character alpha-
numeric
receipt.GetResDataPhone();
Returns the phone number saved in the profile.
Expiring card's
phone number
String 30-character alpha-
numeric
receipt.GetExpPhone();
Returns the phone number saved in the profile. Applicable to Vault Get Expiring
transaction type.
Vault email
address
String 30-character alpha-
numeric
receipt.GetResDataEmail();
Returns the email address saved in the profile.
Table 109: Receipt object response values (continued)
Page 444 of 476 November 2018
![](asset-1bd.png)
Appendix B Definitions of Response Fields
Value Type Limits Get Method
Description
Expiring card's
email address
String 30-character alpha-
numeric
receipt.GetExpEmail();
Returns the email address saved in the profile. Applicable to Vault Get Expiring
transaction type.
Vault note String 30-character alpha-
numeric
receipt.GetResDataNote();
Returns the note saved in the profile.
Expiring card's
note
String 30-character alpha-
numeric
receipt.GetExpNote();
Returns the note saved in the profile. Applicable to Vault Get Expiring transaction
type.
Vault expiry date String 4-character
numeric
receipt.GetResDataExpdate();
Returns the expiry date of the card number saved in the profile. YYMM format.
Expiring card's
expiry date
String 4-character
numeric
receipt.GetExpExpdate();
Returns the expiry date of the card number saved in the profile. YYMM format.
Applicable to Vault Get Expiring transaction type.
Vault E-commerce
indicator
String 1-character
numeric
receipt.GetResDataCryptType();
Returns the e-commerce indicator saved in the profile.
Expiring card's E-
commerce indic-
ator
String 1-character
numeric
receipt.GetExpCryptType();
Returns the e-commerce indicator saved in the profile. Applicable to Vault Get Expir-
ing transaction type.
Vault AVSstreet
number
String 19-character alpha-
numeric
receipt.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 fin-
ancial transaction to the issuer.
Table 109: Receipt object response values (continued)
November 2018 Page 445 of 476
![](asset-1be.png)
Moneris Gateway API- Integration Guide
Value Type Limits Get Method
Description
Expiring card's
AVS street num-
ber
String 19-character alpha-
numeric
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 fin-
ancial transaction to the issuer. Applicable to Vault Get Expiring transaction type.
Vault AVSstreet
name
String 19-character alpha-
numeric
receipt.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 fin-
ancial transaction to the issuer.
Expiring card's
AVS street name
String 19-character alpha-
numeric
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 fin-
ancial transaction to the issuer. Applicable to Vault Get Expiring transaction type.
Vault AVS ZIP
code
String 9-character alpha-
numeric
receipt.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 fin-
ancial transaction to the issuer.
Expiring card's
AVSZIP code
String 9-character alpha-
numeric
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 fin-
ancial transaction to the issuer. Applicable to Vault Get Expiring transaction type.
Vault credit card
number
String 20-character
numeric
receipt.GetResPan();
Returns the full credit card number saved in the Vault profile. Applicable to Vault
Lookup Full transaction only.
Corporate card String true/false receipt.GetCorporateCard();
Indicates whether the card associated with the Vault profile is a corporate card.
Encrypted Mag Swipe response fields (see 6, page 119)
Masked credit
card number
String 20-character alpha-
numeric
receipt.GetMaskedPan();
Table 109: Receipt object response values (continued)
Page 446 of 476 November 2018
![](asset-1bf.png)
Appendix B Definitions of Response Fields
Value Type Limits Get Method
Description
Convenience Fee response fields (see Appendix A, page 1)
Convenience fee
success
String true/false receipt.GetCfSuccess();
Indicates whether the Convenience Fee transaction processed successfully.
Convenience fee
status
String 2-character alpha-
numeric
receipt.GetCfStatus();
Indicates the status of the merchant and convenience fee transactions. The
CfStatus field provides details about the transaction behavior and should be ref-
erenced when contacting Moneris Customer Support.
Possible values are:
l1 or 1F – Completed 1st purchase transaction
l2 or 2F – Completed 2nd purchase transaction
l3 – Completed void transaction
l4A or 4D – Completed refund transaction
l7 or 7F – Completed merchant independent refund transaction
l8 or 8F – Completed merchant refund transaction
l9 or 9F – Completed 1st void transaction
l10 or 10F – Completed 2nd void transaction
l11A or 11D – Completed refund transaction
Convenience fee
amount
String 9-character
decimal
receipt.GetFeeAmount();
The expected Convenience Fee amount. This field will return the amount submitted
by the merchant for a successful transaction. For an unsuccessful transaction, it will
return the expected convenience fee amount
Convenience fee
rate
String 9-character
decimal
receipt.GetFeeRate();
The convenience fee rate that has been defined on the merchant’s profile. For
example:
1.00 – a fixed amount or
10.0 - a percentage amount
Table 109: Receipt object response values (continued)
November 2018 Page 447 of 476
![](asset-1c0.png)
Moneris Gateway API- Integration Guide
Value Type Limits Get Method
Description
Convenience fee
type
String AMT/PCT receipt.GetFeeType();
The type of convenience fee that has been defined on the merchant’s profile.
Available options are:
AMT – fixed amount
PCT – percentage
Table 109: Receipt object response values (continued)
Code Description
< 50 Transaction approved
≥ 50 Transaction declined
NULL Transaction was not sent for authorization
Table 110: Financial transaction response codes
For more details on the response codes that are returned, see the Response Codes document available
at https://developer.moneris.com
Code Description
001 Successfully registered CC details.
Successfully updated CC details.
Successfully deleted CC details.
Successfully located CC details.
Successfully located # expiring cards.
(NOTE: # = the number of cards located)
983 Cannot find previous
986 Incomplete: timed out
987 Invalid transaction
988 Cannot find expiring cards
Null Error: Malformed XML
Table 111: Vault Admin Responses
Page 448 of 476 November 2018
![](asset-1c1.png)
Appendix B Definitions of Response Fields
November 2018 Page 449 of 476
![](asset-1c3.png)
Appendix C Error Messages
Error messages that are returned if the gateway is unreachable
Global Error Receipt
You are not connecting to our servers. This can be caused by a firewall or your internet con-
nection.
Response Code = NULL
The response code can be returned as null for a variety of reasons. The majority of the time,
the explanation is contained within the Message field.
When a ‘NULL’ response is returned, it can indicate that the issuer, the credit card host, or the
gateway is unavailable. This may be because they are offline or because you are unable to con-
nect to the internet.
A ‘NULL’ can also be returned when a transaction message is improperly formatted.
Error messages that are returned in the Message field of the response
XML Parse Error in Request: <System specific detail>
An improper XML document was sent from the API to the servlet.
XML Parse Error in Response: <System specific detail>
An improper XML document was sent back from the servlet.
Transaction Not Completed Timed Out
Transaction timed out before the host responds to the gateway.
Request was not allowed at this time
The host is disconnected.
Could not establish connection with the gateway: <System specific detail>
Gateway is not accepting transactions or server does not have proper access to internet.
Input/Output Error: <System specific detail>
Servlet is not running.
The transaction was not sent to the host because of a duplicate order id
Tried to use an order id which was already in use.
The transaction was not sent to the host because of a duplicate order id
Expiry Date was sent in the wrong format.
Vault error messages
Can not find previous
Data key provided was not found in our records or profile is no longer active.
Invalid Transaction
Transaction cannot be performed because improper data was sent.
or
Mandatory field is missing or an invalid SEC code was sent.
Malformed XML
Parse error.
Incomplete
Timed out.
or
Cannot find expiring cards.
November 2018 Page 451 of 476
![](asset-1c5.png)
Appendix D Process Flow for Basic Pre-Auth, Re-Auth
and Completion Transactions
November 2018 Page 453 of 476
![](asset-1c6.png)
Appendix E Merchant Checklists for INTERAC® Online
Payment Certification Testing
Merchant Information
Name and URL Merchant Name (English)
Homepage URL (English)
Merchant Name (French)
Homepage URL (French)
Number Merchant Number
Transaction fee cat-
egory
(Circle one)
Government
Education
General
Checklist for Front-End Tests
Case # Date Completed Remarks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
November 2018 CanadaOnly Page 454 of 476
![](asset-1c7.png)
Moneris Gateway API- Integration Guide
Case # Date Completed Remarks
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Merchant Requirements
Done Requirement
Checkout page
Table 112: Checklist for web display requirements
Page 455 of 476 Canada Only November 2018
![](asset-1c8.png)
Appendix E Merchant Checklists for INTERAC® Online Payment Certification Testing
Done Requirement
Displays the INTERAC Online design (logo), wordmark (text "INTERAC Online) or
both
Design and Wordmark Requirements (any page)
Other payment option logos:
lDisplays the INTERAC Online design (logo) if the merchant displays the
trademarks or logos of other payment options.
lDesign is equal in size and no less prominent than other payment
option trademarks.
INTERAC wordmark:
lINTERAC is always either in capital letters or italics (as in "the INTERAC
Online service")
lIn the first use of the INTERAC Online wordmark, INTERAC is followed by
the ® notation in superscript. For example, "Interac®" (English) or
<<InteracMD>> (French).
lOn the same page as the first occurence of the wordmark, the following
language-appropriate footnote appears:
l® Trademark of Interac Inc. Used under licence"
lMDMarque de commerce d'Interac Inc. Utilisée sous licence
Version of design
Uses the two-colour design on the web:
lHorizontal version—height no shorter than 25 pixels (width-to-height
ratio of 2:37:1)
lVertical version—width no narrower than 30 pixels (widteh-to-height
ratio of 1:1:37)
"Learn more" information
Provides consumers with a link to www.interaconline.com/learn (preferably on
the checkout page)
Confirmation page
States that the transaction is successful
Displays the financial institution's name and confirmation number
Provides ability to print
Table 112: Checklist for web display requirements (continued)
November 2018 CanadaOnly Page 456 of 476
![](asset-1c9.png)
Moneris Gateway API- Integration Guide
Done Requirement
Error page
Indicates that payment was unsuccsessful
States that the order is cancelled or displays other payment options
Timeout message
Is displayed if consumer has less than 30 minutes to complete payment
Payment
Displays the total in Canadian dollars
Table 112: Checklist for web display requirements (continued)
Done Requirement
Merchant
Uses no less than 128-bit SSL encryption when collecting personal information
Protects consumer information in accordance with applicable federal and provincial privacy
legislation
Adheres to the Canadian Code of Practice for Consumer Protection in Electronic Commerce
Provided screenshots
Checkout page (where customer selects INTERAC Online option)
Confirmation page (one of the test case 1, 2, or 3)
Error page (test case 4)
Table 113: Checklist for security/privacy requirements
Page 457 of 476 Canada Only November 2018
![](asset-1ca.png)
Appendix F Third-Party Service Provider Checklists for
INTERAC® Online Payment Certification Testing
Third-Party Service Provider Information
Name English
French
Merchant Web
Application
Solution Name
Version
Acquirer
Interaconline.com/Interacenlgne.com Web Site Listing Information
See http://www.interaconline.com/merchants_thirdparty.php for examples.
English contact inform-
ation
5 lines maximum. 35 characters/line maximum. For example, contact name
and title, department, telephone, web site, email.
English logo File type: PNG. Maximum size: 120x120 pixels.
French contact inform-
ation
5 lines maximum. 35 characters/line maximum. For example, contact name
and title, department, telephone, web site, email.
French logo File type: PNG. Maximum size: 120x120 pixels.
November 2018 CanadaOnly Page 458 of 476
![](asset-1cb.png)
Moneris Gateway API- Integration Guide
Case # Date Completed Remarks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Table 114: Checklist for front-end tests
Page 459 of 476 Canada Only November 2018
![](asset-1cc.png)
Appendix F Third-Party Service Provider Checklists for INTERAC® Online Payment Cer-
tification Testing
Case # Date Completed Remarks
30
31
32
33
34
35
36
37
38
39
Table 114: Checklist for front-end tests
Merchant Requirements
Done Requirement
Checkout page
Displays the INTERAC Online design (logo), wordmark (text "INTERAC Online) or
both
Design and Wordmark Requirements (any page)
Other payment option logos:
lDisplays the INTERAC Online design (logo) if the merchant displays the
trademarks or logos of other payment options.
lDesign is equal in size and no less prominent than other payment
option trademarks.
Table 115: Checklist for web display requirements
November 2018 CanadaOnly Page 460 of 476
![](asset-1cd.png)
Moneris Gateway API- Integration Guide
Done Requirement
INTERAC wordmark:
lINTERAC is always either in capital letters or italics (as in "the INTERAC
Online service")
lIn the first use of the INTERAC Online wordmark, INTERAC is followed by
the ® notation in superscript. For example, "Interac®" (English) or
<<InteracMD>> (French).
lOn the same page as the first occurence of the wordmark, the following
language-appropriate footnote appears:
l® Trademark of Interac Inc. Used under licence"
lMDMarque de commerce d'Interac Inc. Utilisée sous licence
Version of design
Uses the two-colour design on the web:
lHorizontal version—height no shorter than 25 pixels (width-to-height
ratio of 2:37:1)
lVertical version—width no narrower than 30 pixels (widteh-to-height
ratio of 1:1:37)
"Learn more" information
Provides consumers with a link to www.interaconline.com/learn (preferably on
the checkout page)
Confirmation page
States that the transaction is successful
Displays the financial institution's name and confirmation number
Provides the ability to print
Error page
Indicates that payment was unsuccsessful
States that the order is cancelled or displays other payment options
Timeout message
Is displayed if consumer has less than 30 minutes to complete payment
Payment
Displays the total in Canadian dollars
Table 115: Checklist for web display requirements (continued)
Page 461 of 476 Canada Only November 2018
![](asset-1ce.png)
Appendix F Third-Party Service Provider Checklists for INTERAC® Online Payment Cer-
tification Testing
Done Requirement
Merchant
Uses no less than 128-bit SSL encryption when collecting personal information
Protects consumer information in accordance with applicable federal and provincial privacy
legislation
Adheres to the Canadian Code of Practice for Consumer Protection in Electronic Commerce
Table 116: Checklist for security/privacy requirements
Done Requirement
Provided screenshots
Checkout page (where customer selects INTERAC Online option)
Confirmation page (one of the test case 1, 2, or 3)
Error page (test case 4)
Table 117: Checklist for required screenshots
November 2018 CanadaOnly Page 462 of 476
![](asset-1cf.png)
Appendix G Merchant Checklists for INTERAC® Online
Payment Certification
Merchant Information
Name and URL Merchant Name (English)
Homepage URL (English)
Merchant Name (French)
Homepage URL (French)
Number Merchant Number
Transaction fee cat-
egory
(Circle one)
Government
Education
General
Third-party service
provider
Company name
Service provider's
merchant web
application
Solution name
Version
Merchant Requirements
Done Requirement
Checkout page
Displays the INTERAC Online design (logo), wordmark (text "INTERAC Online) or
both
Design and Wordmark Requirements (any page)
Other payment option logos:
lDisplays the INTERAC Online design (logo) if the merchant displays the
trademarks or logos of other payment options.
lDesign is equal in size and no less prominent than other payment
option trademarks.
Table 118: Checklist for web display requirements
November 2018 CanadaOnly Page 463 of 476
![](asset-1d0.png)
Moneris Gateway API- Integration Guide
Done Requirement
INTERAC wordmark:
lINTERAC is always either in capital letters or italics (as in "the INTERAC
Online service")
lIn the first use of the INTERAC Online wordmark, INTERAC is followed by
the ® notation in superscript. For example, "Interac®" (English) or
<<InteracMD>> (French).
lOn the same page as the first occurence of the wordmark, the following
language-appropriate footnote appears:
l® Trademark of Interac Inc. Used under licence"
lMDMarque de commerce d'Interac Inc. Utilisée sous licence
Version of design
Uses the two-colour design on the web:
lHorizontal version—height no shorter than 25 pixels (width-to-height
ratio of 2:37:1)
lVertical version—width no narrower than 30 pixels (widteh-to-height
ratio of 1:1:37)
"Learn more" information
Provides consumers with a link to www.interaconline.com/learn (preferably on
the checkout page)
Confirmation page
States that the transaction is successful
Displays the financial institution's name and confirmation number
Provides ability to print
Error page
Indicates that payment was unsuccsessful
States that the order is cancelled or displays other payment options
Timeout message
Is displayed if consumer has less than 30 minutes to complete payment
Payment
Displays the total in Canadian dollars
Table 118: Checklist for web display requirements (continued)
Page 464 of 476 Canada Only November 2018
![](asset-1d1.png)
Appendix G Merchant Checklists for INTERAC® Online Payment Certification
Done Requirement
Merchant
Uses no less than 128-bit SSL encryption when collecting personal information
Protects consumer information in accordance with applicable federal and provincial privacy
legislation
Adheres to the Canadian Code of Practice for Consumer Protection in Electronic Commerce
Provided screenshots
Checkout page (where customer selects INTERAC Online option)
Confirmation page (one of the test case 1, 2, or 3)
Error page (test case 4)
Table 119: Checklist for security/privacy requirements
November 2018 CanadaOnly Page 465 of 476
![](asset-1d2.png)
Appendix H INTERAC® Online Payment Certification
Test Case Detail
lH.1 Common Validations
lH.2 Test Cases
lH.3 Merchant front-end test case values
H.1 Common Validations
The Merchant sends a request to the INTERAC Online Merchant Test Tool, which validates the fields as fol-
lows:
lAll mandatory fields are present.
lAll fields are valid according to their definition in the INTERAC Online Functional Specifications
(including field lengths, valid characters and so on).
lMerchant number is that of a valid registered merchant.
lFunded URL matches one of the merchant's registered funded URLs that were provided during
merchant registration.
lThe not funded URL matches one of the merchant's registered Not Funded URLs that were
provided during merchant registration.
lNo additional fields are present.
H.2 Test Cases
Objective To test that the merchant can do all of the following:
lSend a valid request to the Gateway page
lReceive a valid confirmation of funding from the Issuer Online Banking applic-
ation
lIssue a request for purchase completion to the acquirer
lReceive an approved response from the acquirer.
Pre-requisites None
Configuration Merchant sends form posts to the Merchant Test Tool, which in turn responds to
either the Funded or Not Funded URL.
The Merchant is connected to an acquirer emulator, which can be set to confirm any
request for payment confirmation. (That is, the back-end process of sending a 0200
Message to the issuer is emulated to always accept the purchase request).
Special tools
required
None
Table 120: Cases 1-3
November 2018 CanadaOnly Page 466 of 476
![](asset-1d3.png)
Moneris Gateway API- Integration Guide
Input data
requirements
Acquirer must have registered the merchant using the administration system, and
have supplied the following:
lIDEBIT_FUNDEDURL(S)
lIDEBIT_NOTFUNDEDURL(S)
lHTTP REFERERURL(S)
Data will be provided by the Merchant Test Tool.
Execution
strategy
Initiate a payment at the merchant. The two least significant digits of the dollar amount
must be equal to the test case number. For example, if you are executing test case 3,
the format of the amount must be ### ### #03.##.
Expected out-
come
The merchant indicates to the customer that the purchase was completed and
presents a confirmation screen that includes (depending on the test case) the correct
amount, the issuer name and the issuer confirmation number.
Test case 1
lIssuer name: 123Bank
lIssuer confirmation number: CONF#123
Test case 2
lIssuer name: Bank Éàêëï#$.,-/=?@'
lIssuer confirmation number: #$.,-/=?@'UPdn9
Test case 3
lIssuer name: B
lIssuer confirmation number: C
Applicable
logs
lMerchant Test Tool logs
lScreen capture of the merchant's confirmation page.
Table 120: Cases 1-3 (continued)
Objective To test that the merchant handles a rejection in response to the acquirer
Pre-requisites None
Configuration Same as test cases 1-3 except that the acquirer emulator must be set to decline the
request for mayment confirmation. (That is, to emulate the scenario in which an issuer
sends a delcine in the 0210 response to the acquirer's 0200 message.)
Table 121: Case 4
Page 467 of 476 Canada Only November 2018
![](asset-1d4.png)
Appendix H INTERAC® Online Payment Certification Test Case Detail
Special tools
required
None
Input data
requirements
Acquirer must have registered the merchant using the administration system, and
have supplied the following:
lIDEBIT_FUNDEDURL(S)
lIDEBIT_NOTFUNDEDURL(S)
lHTTP REFERERURL(S)
Data will be provided by the Merchant Test Tool.
Execution
strategy
Initiate a payment at the merchant for any amount where the two least significant dol-
lar digits are 04. (That is, of the form ### ### #04.##.)
Expected out-
come
The merchant indicates to the customer that the purchase was declined. Neither the
issuer name nor the issuer confirmation number are displayed.
Applicable
logs
Merchant Test Tool logs
Table 121: Case 4 (continued)
Objective To test that a merchant safely handles redirections to the Funded URL with invalid
data, and treats the transaction as funded.
Pre-requisites None
Configuration None.
The acquirer emulator is not needed because the merchant does not submit any
requests for payment confirmation.
Special tools
required
None
Input data
requirements
Acquirer must have registered the merchant using the administration system, and
have supplied the following:
lIDEBIT_FUNDEDURL(S)
lIDEBIT_NOTFUNDEDURL(S)
lHTTP REFERERURL(S)
Data will be provided by the Merchant Test Tool.
Execution
strategy
Initiate a payment at the merchant. The two least significant digits of the dollar amount
must be equal to the test case number. For example, if you are executing test case 13,
the format of the amount must be ### ### #13.##.
Table 122: Cases 5-22
November 2018 CanadaOnly Page 468 of 476
![](asset-1d5.png)
Moneris Gateway API- Integration Guide
Expected out-
come
The merchant indicates to the customer that the purchase was declined. Neither the
issuer name nor the issuer confirmation number are displayed.
Applicable
logs
Merchant Test Tool logs
Table 122: Cases 5-22 (continued)
Objective To test that a merchant can receive a valid redirection from the issuer that indicates the
payment was not funded.
Pre-requisites None
Configuration None.
The acquirer emulator is not needed because the merchant does not submit any
requests for payment confirmation.
Special tools
required
None
Input data
requirements
Acquirer must have registered the merchant using the administration system, and
have supplied the following:
lIDEBIT_FUNDEDURL(S)
lIDEBIT_NOTFUNDEDURL(S)
lHTTP REFERERURL(S)
Data is provided by the Merchant Test Tool.
Execution
strategy
Initiate a payment at the merchant for any amount where the two least significant dol-
lar digits are 23. (That is, of the form ### ### #23.##.)
Expected out-
come
The merchant indicates to the customer that the purchase was declined. Neither the
issuer name nor the issuer confirmation number are displayed.
Applicable
logs
Merchant Test Tool logs
Table 123: Case 23
Objective To test that a merchant safely handles redirections to the Not Funded URL with invalid
data, and treats the transaction as not funded.
Pre-requisites None
Configuration None.
The acquirer emulator is not needed because the merchant does not submit any
requests for payment confirmation.
Table 124: Cases 24-39
Page 469 of 476 Canada Only November 2018
![](asset-1d6.png)
Appendix H INTERAC® Online Payment Certification Test Case Detail
Special tools
required
None
Input data
requirements
Acquirer must have registered the merchant using the administration system, and
have supplied the following:
lIDEBIT_FUNDEDURL(S)
lIDEBIT_NOTFUNDEDURL(S)
lHTTP REFERERURL(S)
Data is provided by the Merchant Test Tool.
Execution
strategy
Initiate a payment at the merchant. The two least significant digits of the dollar amount
must be equal to the test case number. For example, if you are executing test case 27,
the format of the amount must be ### ### #27.##.
Expected out-
come
The merchant indicates to the customer that the purchase was declined. Neither the
issuer name nor the issuer confirmation number are displayed.
Applicable
logs
Merchant Test Tool logs
Table 124: Cases 24-39 (continued)
H.3 Merchant front-end test case values
These values are automatically sent by the INTERAC Online Merchant Test Tool. They are provided here
for reference only.
Redirection URL Funded
ISSLANG en
TRACK2 3728024906540591206=12010123456789XYZ
ISSCONF CONF#123
ISSNAME 123Bank
INVOICE (Same as supplied by merchant)
MERCHDATA (Same as supplied by merchant)
VERSION 1
Table 125: Test cases 1 and 4—Funded URL
Redirection URL Funded
ISSLANG en
Table 126: Test case 2—Funded URL
November 2018 CanadaOnly Page 470 of 476
![](asset-1d7.png)
Moneris Gateway API- Integration Guide
TRACK2 5268051119993326=29129999999999999000
ISSCONF #$.,-/=?@'UPdn9
ISSNAME 987Bank Éàêëï#$.,-/=?@'Àôùûüÿç
INVOICE (Same as supplied by merchant)
MERCHDATA (Same as supplied by merchant)
VERSION 1
Table 126: Test case 2—Funded URL
Redirection URL Funded
ISSLANG fr
TRACK2 453781122255=1001ABC11223344550000000
ISSCONF C
ISSNAME B
INVOICE (Same as supplied by merchant)
MERCHDATA (Same as supplied by merchant)
VERSION 123
Table 127: Test case 3—Funded URL
Test
case Purpose Field Value
5 missing field IDEBIT_INVOICE (missing)
6 missing field IDEBIT_MERCHDATA (missing)
7 missing field IDEBIT_ISSLANG (missing)
8 missing field IDEBIT_TRACK2 (missing)
9 missing field IDEBIT_ISSCONF (missing)
10 missing field IDEBIT_ISSNAME (missing)
11 missing field IDEBIT_VERSION (missing)
12 missing field IDEBIT_TRACK2, IDEBIT_
ISSCONF, IDEBIT_ISSNAME
(missing)
13 wrong value IDEBIT_INVOICE XXX
14 wrong value IDEBIT_MERCHDATA XXX
Table 128: Test cases 5-22—invalid fields, Funded URL
Page 471 of 476 Canada Only November 2018
![](asset-1d8.png)
Appendix H INTERAC® Online Payment Certification Test Case Detail
Test
case Purpose Field Value
15 invalid value IDEBIT_ISSLANG de
16 value too long IDEBIT_TRACK2 3728024906540591206=12010123456789XYZA
17 invalid check
digit
IDEBIT_TRACK2 3728024906540591207=12010123456789XYZ
18 field too long IDEBIT_ISSCONF Too long confirm
19 invalid character IDEBIT_ISSCONF CONF<123
20 field too long IDEBIT_ISSNAME Very, very, very long issuer name
21 invalid character IDEBIT_ISSNAME 123<Bank
22 invalid value IDEBIT_VERSION 2
Table 128: Test cases 5-22—invalid fields, Funded URL (continued)
Redirection URL Not funded
ISSLANG en
INVOICE (Same as supplied by merchant)
MERCHDATA (Same as supplied by merchant)
VERSION 1
Table 129: Test case 23—valid data, Not Funded URL
Test
case Purpose Field Value
24 missing field IDEBIT_INVOICE (missing)
25 missing field IDEBIT_MERCHDATA (missing)
26 missing field IDEBIT_ISSLANG (missing)
27 IDEBIT_TRACK2 is
present and valid
IDEBIT_TRACK2 3728024906540591206=12010123456789XYZ
28 IDEBIT_ISSCONF is
present and valid
IDEBIT_ISSCONF CONF#123
29 IDEBIT_ISSNAME is
present and valid
IDEBIT_ISSNAME 12Bank
30 missing field IDEBIT_VERSION (missing)
Table 130: Test cases 5-22—invalid fields, Funded URL
November 2018 CanadaOnly Page 472 of 476
![](asset-1d9.png)
Moneris Gateway API- Integration Guide
Test
case Purpose Field Value
31 wrong value IDEBIT_INVOICE XXX
32 invalid value IDEBIT_INVOICE invalid </html> tricky data
33 wrong value IDEBIT_MERCHDATA XXX
34 invalid value IDEBIT_MERCHDATA <2000 characters in the range hex 20-7E
35 invalid value IDEBIT_ISSLANG de
36 invalid IDEBIT_
TRACK2 is present
IDEBIT_TRACK2 INVALIDTRACK2, incorrect format and too
long
37 invalid IDEBIT_
ISSCONF is present
IDEBIT_ISSCONF Too long confirm
38 invalid IDEBIT_
ISSNAME is present
IDEBIT_ISSNAME Very, very, very long issuer name
39 invalid value IDEBIT_VERSION 2
Table 130: Test cases 5-22—invalid fields, Funded URL (continued)
Page 473 of 476 Canada Only November 2018
![](asset-1db.png)
Copyright Notice
Copyright © November 2018 Moneris Solutions, 3300 Bloor Street West, Toronto, Ontario, M8X 2X2
All Rights Reserved. This manual shall not wholly or in part, in any form or by any means, electronic,
mechanical, including photocopying, be reproduced or transmitted without the authorized, written con-
sent of Moneris Solutions.
This document has been produced as a reference guide to assist Moneris client’s hereafter referred to as
merchants. Every effort has been made to the make the information in this reference guide as accurate
as possible. The authors of Moneris Solutions shall have neither liability nor responsibility to any person
or entity with respect to any loss or damage in connection with or arising from the information contained
in this reference guide.
Trademarks
Moneris and the Moneris Solutions logo are registered trademarks of Moneris Solutions Corporation.
Any software, hardware and or technology products named in this document are claimed as trademarks
or registered trademarks of their respective companies.
Printed in Canada.
10987654321
November 2018 Page 475 of 476