diff --git a/Examples/CA/TestCavvPreAuth.php b/Examples/CA/TestCavvPreAuth.php index cf90d38..593b429 100644 --- a/Examples/CA/TestCavvPreAuth.php +++ b/Examples/CA/TestCavvPreAuth.php @@ -91,7 +91,6 @@ print("\nIssuerId = " . $mpgResponse->getIssuerId()); print("\nThreeDSVersion = " . $mpgResponse->getThreeDSVersion()); print("\nSourcePanLast4 = " . $mpgResponse->getSourcePanLast4()); -print("\nAdviceCode = " . $mpgResponse->getAdviceCode()); ?> diff --git a/Examples/CA/TestMpiThreeDSAuthentication.php b/Examples/CA/TestMpiThreeDSAuthentication.php index 170272c..f11f93c 100644 --- a/Examples/CA/TestMpiThreeDSAuthentication.php +++ b/Examples/CA/TestMpiThreeDSAuthentication.php @@ -9,7 +9,7 @@ $mpiThreeDSAuthentication = new MpiThreeDSAuthentication(); $mpiThreeDSAuthentication->setOrderId("ord-110920-10:36:43"); //must be the same one that was used in MpiCardLookup call $mpiThreeDSAuthentication->setCardholderName("Moneris Test"); -$mpiThreeDSAuthentication->setPan("4740611374762707"); +$mpiThreeDSAuthentication->setPan("340087427838525"); //$mpiThreeDSAuthentication->setDataKey("8OOXGiwxgvfbZngigVFeld9d2"); //Optional - For Moneris Vault and Hosted Tokenization tokens in place of setPan $mpiThreeDSAuthentication->setExpdate("2310"); $mpiThreeDSAuthentication->setAmount("1.00"); @@ -17,7 +17,7 @@ $mpiThreeDSAuthentication->setRequestType("01"); //(01=payment|02=recur) $mpiThreeDSAuthentication->setPurchaseDate("20200911035249"); //(YYYYMMDDHHMMSS) $mpiThreeDSAuthentication->setNotificationURL("https://yournotificationurl.com"); //(Website where response from RRes or CRes after challenge will go) -$mpiThreeDSAuthentication->setChallengeWindowSize("03"); //(01 = 250 x 400, 02 = 390 x 400, 03 = 500 x 600, 04 = 600 x 400, 05 = Full screen) +$mpiThreeDSAuthentication->setChallengeWindowSize("03"); //(01 = 250 x 400, 02 = 390 x 400, 03 = 500 x 600, 04 = 600 x 400, 05 = Full screen) $mpiThreeDSAuthentication->setBrowserUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36\\"); $mpiThreeDSAuthentication->setBrowserJavaEnabled("true"); //(true|false) @@ -41,8 +41,25 @@ $mpiThreeDSAuthentication->setEmail("test@email.com"); $mpiThreeDSAuthentication->setRequestChallenge("Y"); //(Y|N Requesting challenge regardless of outcome) -/****************************** Transaction Object *******************************/ +$mpiThreeDSAuthentication->setMessageCategory("01"); +$mpiThreeDSAuthentication->setDeviceChannel("02"); +$mpiThreeDSAuthentication->setDecoupledRequestIndicator("Y"); +$mpiThreeDSAuthentication->setDecoupledRequestMaxTime("00010"); +$mpiThreeDSAuthentication->setDecoupledRequestAsyncUrl("https://yourasyncnotificationurl.com"); +$mpiThreeDSAuthentication->setRiIndicator("03"); +// $mpiThreeDSAuthentication->setRecurringFrequency("031"); +// $mpiThreeDSAuthentication->setRecurringExpiry("20251230"); + +$paiTemplate = array( + 'prior_request_auth_data'=>"d7c1ee99-9478-44a6-b1f2-391e29c6b340", + 'prior_request_ref'=>"d7c1ee99-9478-44a6-b1f2-391e29c6b340", + 'prior_request_auth_method'=>"01", + 'prior_request_auth_timestamp'=>"201710282113" +); +// $mpiThreeDSAuthentication->setPriorAuthenticationInfo( $paiTemplate ); + +/****************************** Transaction Object *******************************/ $mpgTxn = new mpgTransaction($mpiThreeDSAuthentication); /******************************* Request Object **********************************/ @@ -51,8 +68,8 @@ $mpgRequest->setProcCountryCode("CA"); //"US" for sending transaction to US environment $mpgRequest->setTestMode(true); //false or comment out this line for production transactions +//print_r($mpgRequest); /****************************** HTTPS Post Object *******************************/ - $mpgHttpPost =new mpgHttpsPost($store_id,$api_token,$mpgRequest); /************************************* Response *********************************/ @@ -65,9 +82,16 @@ print("\nMessageType = " . $mpgResponse->getMpiMessageType()); print("\nTransStatus = " . $mpgResponse->getMpiTransStatus()); +print("\nTransStatusReason = " . $mpgResponse->getMpiTransStatusReason()); print("\nChallengeURL = " . $mpgResponse->getMpiChallengeURL()); print("\nChallengeData = " . $mpgResponse->getMpiChallengeData()); print("\nThreeDSServerTransId = " . $mpgResponse->getMpiThreeDSServerTransId()); +print("\nThreeDSVersion = " . $mpgResponse->getThreeDSVersion()); +print("\nThreeDSDSTransID = " . $mpgResponse->getMpiDSTransId()); +print("\nThreeDSAcsTransID = " . $mpgResponse->getMpiThreeDSAcsTransID()); +print("\nThreeDSAuthTimeStamp = " . $mpgResponse->getMpiThreeDSAuthTimeStamp()); +print("\nAuthenticationType = " . $mpgResponse->getMpiAuthenticationType()); +print("\nCardholderInfo = " . $mpgResponse->getMpiCardholderInfo()); //In Frictionless flow, you may receive TransStatus as "Y", //in which case you can then proceed directly to Cavv Purchase/Preauth with values below' diff --git a/Examples/CA/TestPreAuth.php b/Examples/CA/TestPreAuth.php index ee735f6..e25a1e5 100644 --- a/Examples/CA/TestPreAuth.php +++ b/Examples/CA/TestPreAuth.php @@ -10,8 +10,8 @@ $type='preauth'; $cust_id='cust id'; $order_id='ord-'.date("dmy-G:i:s"); -$amount='4840.00'; -$pan='5454545454545454'; +$amount='6000.00'; +$pan='4622943127023886'; $expdate='2212'; $crypt='7'; $dynamic_descriptor='123'; @@ -82,7 +82,6 @@ print("\nTimedOut = " . $mpgResponse->getTimedOut()); print("\nIssuerId = " . $mpgResponse->getIssuerId()); print("\nSourcePanLast4 = " . $mpgResponse->getSourcePanLast4()); -print("\nAdviceCode = " . $mpgResponse->getAdviceCode()); // $installmentResults = $mpgResponse->getInstallmentResults(); diff --git a/Examples/CA/TestPurchase.php b/Examples/CA/TestPurchase.php index 470c187..d31e549 100644 --- a/Examples/CA/TestPurchase.php +++ b/Examples/CA/TestPurchase.php @@ -11,8 +11,8 @@ $type='purchase'; $order_id='Test'.date("dmy-G:i:s"); -$amount='4840.00'; -$pan='5454545454545454'; +$amount='6000.00'; +$pan='4622943127023886'; $expdate='2212'; $crypt='7'; $dynamic_descriptor='123'; @@ -98,8 +98,6 @@ print("\nHostId = " . $mpgResponse->getHostId()); print("\nIssuerId = " . $mpgResponse->getIssuerId()); print("\nSourcePanLast4 = " . $mpgResponse->getSourcePanLast4()); -print("\nAdviceCode = " . $mpgResponse->getAdviceCode()); - // $installmentResults = $mpgResponse->getInstallmentResults(); diff --git a/changeLog b/changeLog index 8caa147..3bf91f9 100644 --- a/changeLog +++ b/changeLog @@ -1,3 +1,6 @@ +Version 1.0.30: + -Added 3DS2.2 functionality + Version 1.0.29: -Added NT to the ResIndependentRefund and ResForcePost transactions. diff --git a/mpgClasses.php b/mpgClasses.php index 9abd115..29fd122 100644 --- a/mpgClasses.php +++ b/mpgClasses.php @@ -17,7 +17,7 @@ class mpgGlobals 'MONERIS_MPI_FILE' => '/mpi/servlet/MpiServlet', 'MONERIS_MPI_2_FILE' => '/mpi2/servlet/MpiServlet', 'MONERIS_US_MPI_FILE' => '/mpi/servlet/MpiServlet', - 'API_VERSION' => 'PHP NA - 1.0.22', + 'API_VERSION' => 'PHP NA - 1.0.30', 'CONNECT_TIMEOUT' => '20', 'CLIENT_TIMEOUT' => '35' ); @@ -42,7 +42,7 @@ class httpsPost var $clientTimeOut; var $apiVersion; var $response; - var $debug = false; //default is false for production release + var $debug = true; //default is false for production release public function __construct($url, $dataToSend) { @@ -884,12 +884,6 @@ public function getPaymentType() return $this->getMpgResponseValue($this->responseData,'PaymentType'); } - //MAC CODE - public function getAdviceCode() - { - return $this->getMpgResponseValue($this->responseData,'AdviceCode'); - } - //------------------------------------------------------------------------------------// public function getResolveData() @@ -1692,6 +1686,31 @@ public function getThreeDSVersion() { return $this->getMpgResponseValue($this->responseData,"ThreeDSVersion"); } + + public function getMpiThreeDSAcsTransID() + { + return $this->getMpgResponseValue($this->responseData,"ThreeDSAcsTransID"); + } + + public function getMpiThreeDSAuthTimeStamp() + { + return $this->getMpgResponseValue($this->responseData,"ThreeDSAuthTimeStamp"); + } + + public function getMpiAuthenticationType() + { + return $this->getMpgResponseValue($this->responseData,"AuthenticationType"); + } + + public function getMpiCardholderInfo() + { + return $this->getMpgResponseValue($this->responseData,"CardholderInfo"); + } + + public function getMpiTransStatusReason() + { + return $this->getMpgResponseValue($this->responseData,"TransStatusReason"); + } public function getMpiInLineForm() { @@ -2630,12 +2649,10 @@ public function getURL() $hostId = "MONERIS".$this->procCountryCode.$this->testMode."_HOST"; $pathId = "MONERIS".$this->procCountryCode.$this->isMPI."_FILE"; - $url = $gArray['MONERIS_PROTOCOL']."://". $gArray[$hostId].":". $gArray['MONERIS_PORT']. $gArray[$pathId]; - return $url; } @@ -3610,7 +3627,7 @@ public function getURL() $gArray['MONERIS_PORT']. $gArray[$pathId]; - //echo "PostURL: " . $url; +// echo "PostURL: " . $url; return $url; } @@ -6915,7 +6932,17 @@ class MpiThreeDSAuthentication extends Transaction { "browser_screen_width" => null, "browser_language" => null, "email" => null, - "request_challenge" => null + "request_challenge" => null, + "message_category" => null, + "device_channel" => null, + "decoupled_request_indicator" => null, + "decoupled_request_max_time" => null, + "decoupled_request_async_url" => null, + "ri_indicator" => null, + "prior_authentication_info" => null, + "recurring_expiry" => null, + "recurring_frequency" => null + ); public function __construct() @@ -7069,6 +7096,50 @@ public function setRequestChallenge($request_challenge) { $this->data["request_challenge"] = $request_challenge; } + + public function setMessageCategory($message_category) + { + $this->data["message_category"] = $message_category; + } + + public function setDeviceChannel($device_channel) + { + $this->data["device_channel"] = $device_channel; + } + + public function setDecoupledRequestIndicator($decoupled_request_indicator) + { + $this->data["decoupled_request_indicator"] = $decoupled_request_indicator; + } + + public function setDecoupledRequestMaxTime($decoupled_request_max_time) + { + $this->data["decoupled_request_max_time"] = $decoupled_request_max_time; + } + + public function setDecoupledRequestAsyncUrl($decoupled_request_async_url) + { + $this->data["decoupled_request_async_url"] = $decoupled_request_async_url; + } + + public function setRiIndicator($ri_indicator) + { + $this->data["ri_indicator"] = $ri_indicator; + } + + public function setPriorAuthenticationInfo($priorAuthenticationInfo) + { + $this->data["prior_authentication_info"] = $priorAuthenticationInfo; + } + public function setRecurringExpiry($recurringExpiry) + { + $this->data["recurring_expiry"] = $recurringExpiry; + } + + public function setRecurringFrequency($recurringFrequency) + { + $this->data["recurring_frequency"] = $recurringFrequency; + } } class MpiCavvLookup extends Transaction { @@ -7379,4 +7450,5 @@ function getPlanResponse() { return $this->PlanResponse; } } + ?>