How to set CAD as default currency if country code CA? It is USD now. There is no currency section in the API. The only currency is multi-currency and it converts the USD amount to CAD now. I want to charge CAD directly.
In reply to ND_Moneris:
Hello,
Unfortunately, this is not correct.
Please have a look at the following php example that you provide here: developerdotmonerisdotcom Purchase api document.
require "../../mpgClasses.php";
/**************************** Request Variables *******************************/
$store_id='store5';$api_token='yesguy';
/************************* Transactional Variables ****************************/
$type='purchase';$cust_id='cust id';$order_id='ord-'.date("dmy-G:i:s");$amount='1.00';$pan='4242424242424242';$expiry_date='1111';$crypt='7';$dynamic_descriptor='123';$status_check = 'false';
/*********************** Transactional Associative Array **********************/
$txnArray=array('type'=>$type, 'order_id'=>$order_id, 'cust_id'=>$cust_id, 'amount'=>$amount, 'pan'=>$pan, 'expdate'=>$expiry_date, 'crypt_type'=>$crypt, 'dynamic_descriptor'=>$dynamic_descriptor );
/**************************** Transaction Object *****************************/
$mpgTxn = new mpgTransaction($txnArray);
/****************************** Request Object *******************************/
$mpgRequest = new mpgRequest($mpgTxn);$mpgRequest->setProcCountryCode("CA"); //"US" for sending transaction to US environment$mpgRequest->setTestMode(true); //false or comment out this line for production transactions
/***************************** HTTPS Post Object *****************************/
/* Status Check Example$mpgHttpPost =new mpgHttpsPostStatus($store_id,$api_token,$status_check,$mpgRequest);*/
$mpgHttpPost =new mpgHttpsPost($store_id,$api_token,$mpgRequest);
/******************************* Response ************************************/
$mpgResponse=$mpgHttpPost->getMpgResponse();
print("\nCardType = " . $mpgResponse->getCardType());print("\nTransAmount = " . $mpgResponse->getTransAmount());print("\nTxnNumber = " . $mpgResponse->getTxnNumber());print("\nReceiptId = " . $mpgResponse->getReceiptId());print("\nTransType = " . $mpgResponse->getTransType());print("\nReferenceNum = " . $mpgResponse->getReferenceNum());print("\nResponseCode = " . $mpgResponse->getResponseCode());print("\nISO = " . $mpgResponse->getISO());print("\nMessage = " . $mpgResponse->getMessage());print("\nIsVisaDebit = " . $mpgResponse->getIsVisaDebit());print("\nAuthCode = " . $mpgResponse->getAuthCode());print("\nComplete = " . $mpgResponse->getComplete());print("\nTransDate = " . $mpgResponse->getTransDate());print("\nTransTime = " . $mpgResponse->getTransTime());print("\nTicket = " . $mpgResponse->getTicket());print("\nTimedOut = " . $mpgResponse->getTimedOut());print("\nStatusCode = " . $mpgResponse->getStatusCode());print("\nStatusMessage = " . $mpgResponse->getStatusMessage());
When we run this code, we see in the dashboard that 1 dolor has been charged.
However, there is no currency parameter in above code.
Please send the correct PHP API doc for Moneris integration.
Ozlem
In reply to drmelfi:
#1- I updated my mpgClasses.php with the latest version.
Last mpgClasses.php Github link
#2- I have copied test credentials from here. I used Canadian credentials.
$store_id='monca02432';
$api_token='qLwnwJ3n8UsyBE7ULRpn';
#3- I used Canada Code Sample here: Purchase PHP Canada Code Sample
#4- I have made a test transaction.
#5- I checked my transaction from your dashboard. Here: Moneris Canada Dashboard
#6- As you see in the image below, currency is $.
In other words, I followed very basic steps but still I couldn't see Canadian currency.
Thank you.