How to set CAD as default currency if country code CA? It is USD now.

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.

  • Hello,
    Please setup a CAD store_id through the contact center. Any currency you send there will be CAD and treated as such. For USD, please setup a Canadian Store_ID with a USA Bank account (through our call centre), there you can send the the USD in USD amounts.

    For multi-currency, if you want to have a single CAD store_id and be able to convert any amount into CAD funds and settle in CAD funds, then multi currency is the way to go.

    I hope the above helps you.
  • 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:

    Hi Ozlem, That is the latest API but we no longer have a gateway in USA. All transactions must be sent to our Canadian Gateway.

    To send a transaction to our Canadian Gateway, this line of code will always be set as in this example:
    $mpgRequest->setProcCountryCode("CA"); //will always be set to CA as Moneris processes in Canada only.

    There is no flag/no set method for currency type in the API.

    If you feel that you need different code sample of mpgclasses.php file, you can also see the github page. https://github.com/moneris

    Thank you. Please let me know if there is anything further.
  • In reply to ND_Moneris:

    Hello,

    setProcCountryCode is CA already.

    $mpgRequest->setProcCountryCode("CA");

    I have checked all of the mpgClasses.php and they are very similar and consist of US cases.

    I have also implemented the last updated mpgClassses.php lib to my existing integration but unfortunately, I couldn't get test payments in CAD.

    This is important so I will awaiting for your response.
  • In reply to drmelfi:

    Hello again,

    Ok. Our basic code set (which you are using) does not discriminate on currency. We let you discriminate by currency at account level. Therefore to process the CAD and USD your code is the same now for both. The only thing that chnages is that you will have 1 store_id for CAD and another StoreID for USD linked to Canadian USD Currency Bank Account.

    Our old code set had USD and CAD libraries, but that is not hte case anymore. We had a unified API with CAD & USD, then we left USA as the market and now only use CAD code.

    How are you judging/deciding that you are doing US cases and how are you judging that you are not getting CAD test cases? What are you making your decisions on? Can you explain your thought process to me please?
  • In reply to ND_Moneris:

    Hello,

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

  • In reply to drmelfi:

    You are looking at a one dollar amount in Canadian Currency.

    Every transaction that you see in the merchant resource center (screen shot above) is in the Canadian currency. $ is the correct designation. $ = Canadian currency. We do not put CAD next to amount as every account by default is.
  • In reply to ND_Moneris:

    Thank you for the clarification. As a result, everything is fine.