Hi,
We have business requirement
1. Validate/Verify customer address,zipcode (AVS) information from bank before we lock fund in Pre-authorization.
2. If we get positive response from step 1 then we need to send another request with Customer's CVD & AVS to lock fund for transaction.
I gone through some PHP API like Pre-Authorization with CVD & AVS but here AVS is optional. It is not mandatory to send AVS information in single request to Moneris payment server.
Our current process following this PHP API but problem is AVS is mandatory in our software (But it is optional from Moneris side). We are sending CVD & AVS information with Pre-authorization and Moneris approve this transaction and hold the fund but it is failed in our side because we were unable to validate customer's AVS at our end.
Do Moneris has PHP API which will able to achieve our business requirement ? Any API which validate customer AVS information before holding fund ?
I appreciate your support
Thanks!!
Baljeet Singh
In reply to RR_Moneris:
In reply to Baljeet:
Hi Renaud,
Now I am using updated Unified API PHP version but still I am not able to figure out whether is it valid AVS or not.
Here is my payment page url
https://canoncanada--tst.custhelp.com/cgi-bin/canoncanada.cfg/php/custom/cardverification.php
I am using the following credentials on this page
Card Number - 4242424242424242 , Exp Date - 2410, CVV = 198 , Total Charge = $5.00, Street # = 201, Street Name = Michigan Ave, Postal Code = M1M1M1
Here is the response I am getting
CardType = V TransAmount = 0.00 TxnNumber = 333268-0_11 ReceiptId = CAN-ORDER-210818172049 TransType = 06 ReferenceNum = 660148420019350470 ResponseCode = 027 ISO = 01 Message = APPROVED * = IsVisaDebit = false AuthCode = 000000 Complete = true TransDate = 2018-08-21 TransTime = 17:20:49 Ticket = null TimedOut = false IssuerId =
Here I am not getting AVS or CVD response from where I can verified this is valid address for this card. As I have told you, we have requirement to validate customer card with their address (AVS) before we charge him. I am also not able to see TransAmount response. Currently it is 0.00. Does card validation response display amount ? Can you please check my code and figure out If I am missing something. I am attaching my PHP Code file. Please have a look and figure out solution.
<?php require "../../mpgClasses.php"; foreach($_POST as $key => $value) $$key = $value; if(isset($_POST['incident_id'])) { /************************ Request Variables **********************************/ $store_id='store5'; $api_token='yesguy'; /************************ Transaction Variables ******************************/ $cust_id = 'CAN1234'; $order_id = 'CAN-ORDER-'.date("dmyHis"); $crypt_type = '7'; $amount = $trans_amount; $pan = $card_number; //Credit Card Number For Testing 4242424242424242 $expdate = $exp_year.$exp_month; //Card Expiry Date in YYMM Format /************************ Transaction Array **********************************/ $txnArray=array('type'=>'card_verification', 'order_id'=>$order_id, 'cust_id'=>$cust_id, 'amount'=>$amount, 'pan'=>$pan, 'expdate'=>$expdate, 'crypt_type'=>$crypt_type ); $mpgTxn = new mpgTransaction($txnArray); /************************** AVS Variables *****************************/ $avs_street_number = $street_number; //'201'; $avs_street_name = $street_name; //'Michigan Ave'; $avs_zipcode = $postal_code; //'M1M1M1'; /************************** CVD Variables *****************************/ $cvd_indicator = '1'; $cvd_value = $secure_code; /********************** AVS Associative Array *************************/ $avsTemplate = array( 'avs_street_number'=>$avs_street_number, 'avs_street_name' =>$avs_street_name, 'avs_zipcode' => $avs_zipcode ); /********************** CVD Associative Array *************************/ $cvdTemplate = array( 'cvd_indicator' => $cvd_indicator, 'cvd_value' => $cvd_value ); /************************** AVS Object ********************************/ $mpgAvsInfo = new mpgAvsInfo ($avsTemplate); $mpgTxn->setAvsInfo($mpgAvsInfo); /************************** CVD Object ********************************/ $mpgCvdInfo = new mpgCvdInfo ($cvdTemplate); $mpgTxn->setCvdInfo($mpgCvdInfo); /*********************** 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 /************************ mpgHttpsPost Object ******************************/ $mpgHttpPost = new mpgHttpsPost($store_id,$api_token,$mpgRequest); /************************ Response Object **********************************/ $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("\nIssuerId = " . $mpgResponse->getIssuerId()); } ?>