@@ -223,26 +223,26 @@ public function getLang(): string
223223 * @param string $value
224224 * @return AbstractRequest
225225 */
226- public function setSecureKey (string $ value ): AbstractRequest
226+ public function setLang (string $ value ): AbstractRequest
227227 {
228- return $ this ->setParameter ('secureKey ' , $ value );
228+ return $ this ->setParameter ('lang ' , $ value );
229229 }
230230
231231 /**
232- * @return string
232+ * @param string $value
233+ * @return AbstractRequest
233234 */
234- public function getSecureKey ( ): string
235+ public function setSecureKey ( string $ value ): AbstractRequest
235236 {
236- return $ this ->getParameter ('secureKey ' );
237+ return $ this ->setParameter ('secureKey ' , $ value );
237238 }
238239
239240 /**
240- * @param string $value
241- * @return AbstractRequest
241+ * @return string
242242 */
243- public function setLang ( string $ value ): AbstractRequest
243+ public function getSecureKey ( ): string
244244 {
245- return $ this ->setParameter ( ' lang ' , $ value );
245+ return $ this ->getParameter ( ' secureKey ' );
246246 }
247247
248248 /**
@@ -353,32 +353,33 @@ protected function getAuthorizeRequestParams(): array
353353
354354 /**
355355 * @return array
356- * @throws \Omnipay\Common\Exception\InvalidRequestException
357356 */
358357 protected function getSalesRequestParamsFor3d (): array
359358 {
360359 $ params ['apiversion ' ] = $ this ->version ;
361360 $ params ['mode ' ] = $ this ->getTestMode ();
362361 $ params ['terminalprovuserid ' ] = $ this ->getUserName ();
363- $ params ['terminaluserid ' ] = str_repeat ( ' 0 ' , 9 - strlen ( $ this ->getTerminalId ()) );
364- $ params ['terminalid ' ] = str_repeat ( ' 0 ' , 9 - strlen ( $ this ->getTerminalId ()) );
362+ $ params ['terminaluserid ' ] = $ this ->getUserName ( );
363+ $ params ['terminalid ' ] = $ this ->getTerminalId ();
365364 $ params ['terminalmerchantid ' ] = $ this ->getMerchantId ();
366- $ params ['orderid ' ] = $ this ->getOrderId ();
367- $ params ['customeremailaddress ' ] = $ this ->getCard ()->getEmail ();
368- $ params ['customeripaddress ' ] = $ this ->getClientIp ();
369- $ params ['txnamount ' ] = $ this ->getAmount ();
365+ $ params ['txntype ' ] = 'sales ' ;
366+ $ params ['txnamount ' ] = $ this ->getAmountInteger ();
370367 $ params ['txncurrencycode ' ] = $ this ->currency_list [$ this ->getCurrency ()];
371368 $ params ['txninstallmentcount ' ] = $ this ->getInstallment ();
369+ $ params ['customeremailaddress ' ] = $ this ->getCard ()->getEmail ();
370+ $ params ['customeripaddress ' ] = $ this ->getClientIp ();
371+ $ params ['orderid ' ] = $ this ->getOrderId ();
372372 $ params ['successurl ' ] = $ this ->getReturnUrl ();
373373 $ params ['errorurl ' ] = $ this ->getCancelUrl ();
374374 $ params ['lang ' ] = $ this ->getLang ();
375- $ params ['txntimestamp ' ] = time ();
376- $ params ['txntimeoutperiod ' ] = "60 " ;
377- $ params ['addcampaigninstallment ' ] = "N " ;
378- $ params ['totallinstallmentcount ' ] = "0 " ;
379- $ params ['installmentonlyforcommercialcard ' ] = "0 " ;
380- $ params ['txntype ' ] = 'sales ' ;
381- $ params ['secure3dsecuritylevel ' ] = '3d ' ;
375+ $ params ['txntimestamp ' ] = date ("d/m/Y H:i:s " );
376+ $ params ['refreshtime ' ] = 5 ;
377+ $ params ['cardnumber ' ] = $ this ->getCard ()->getNumber ();
378+ $ params ['cardexpiredatemonth ' ] = $ this ->getCard ()->getExpiryMonth ();
379+ $ params ['cardexpiredateyear ' ] = $ this ->getCard ()->getExpiryYear ();
380+ $ params ['cardexpiredateyear ' ] = $ this ->getCard ()->getExpiryYear ();
381+ $ params ['cardcvv2 ' ] = $ this ->getCard ()->getCvv ();
382+ $ params ['secure3dsecuritylevel ' ] = '3D ' ;
382383
383384 $ hashData = strtoupper (sha1 ($ this ->getTerminalId () . $ params ['orderid ' ] . $ params ['txnamount ' ] . $ params ['successurl ' ] . $ params ['errorurl ' ] . $ params ['txntype ' ] . $ params ['txninstallmentcount ' ] . $ this ->getSecureKey () . $ this ->getSecurityHash ()));
384385 $ params ['secure3dhash ' ] = $ hashData ;
0 commit comments