Skip to content

Commit cc6a234

Browse files
committed
fixed type casting in setGatewayToken method
1 parent e0c9764 commit cc6a234

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

src/Adapter/Mellat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function requestToken()
6767
$response = explode(',', $response->return);
6868

6969
if ($response[0] == 0) {
70-
$this->getTransaction()->setGatewayToken($response[1]); // update transaction reference id
70+
$this->getTransaction()->setGatewayToken(strval($response[1])); // update transaction reference id
7171

7272
return $response[1];
7373
} else {

src/Adapter/Parsian.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ class Parsian extends AdapterAbstract implements AdapterInterface
1717
protected $WSDLSale = 'https://pec.shaparak.ir/NewIPGServices/Sale/SaleService.asmx?WSDL';
1818
protected $WSDLConfirm = 'https://pec.shaparak.ir/NewIPGServices/Confirm/ConfirmService.asmx?WSDL';
1919
protected $WSDLReversal = 'https://pec.shaparak.ir/NewIPGServices/Reverse/ReversalService.asmx';
20+
protected $WSDLMultiplex = 'https://pec.shaparak.ir/NewIPGServices/MultiplexedSale/OnlineMultiplexedSalePaymentService.asmx?wsdl';
21+
2022
protected $endPoint = 'https://pec.shaparak.ir/NewIPG/';
2123

2224
protected $testWSDLSale = 'http://banktest.ir/gateway/parsian-sale/ws?wsdl';
2325
protected $testWSDLConfirm = 'http://banktest.ir/gateway/parsian-confirm/ws?wsdl';
2426
protected $testWSDLReversal = 'http://banktest.ir/gateway/parsian-reverse/ws?wsdl';
27+
protected $testWSDLMultiplex = 'http://banktest.ir/parsian/NewIPGServices/MultiplexedSale/OnlineMultiplexedSalePaymentService.asmx?wsdl';
28+
2529
protected $testEndPoint = 'http://banktest.ir/gateway/parsian/gate';
2630

2731
protected $reverseSupport = true;
@@ -78,7 +82,7 @@ protected function requestToken()
7882

7983
if (isset($response->SalePaymentRequestResult->Status, $response->SalePaymentRequestResult->Token)) {
8084
if ($response->SalePaymentRequestResult->Status == 0) {
81-
$this->getTransaction()->setGatewayToken($response->SalePaymentRequestResult->Token); // update transaction reference id
85+
$this->getTransaction()->setGatewayToken(strval($response->SalePaymentRequestResult->Token)); // update transaction reference id
8286

8387
return $response->SalePaymentRequestResult->Token;
8488
} else {
@@ -262,7 +266,13 @@ protected function getWSDL(): string
262266
return $this->testWSDLReversal;
263267
}
264268
break;
269+
case 'multiplex':
270+
if (config('larapay.mode') == 'production') {
271+
return $this->WSDLMultiplex;
272+
} else {
273+
return $this->testWSDLMultiplex;
274+
}
275+
break;
265276
}
266-
267277
}
268278
}

src/Adapter/Payir.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected function requestToken(): string
5858
if (isset($resultObj->status)) {
5959

6060
if ($resultObj->status == 1) {
61-
$this->getTransaction()->setGatewayToken($resultObj->transId); // update transaction reference id
61+
$this->getTransaction()->setGatewayToken(strval($resultObj->transId)); // update transaction reference id
6262

6363
return $resultObj->transId;
6464
} else {

src/Adapter/Saman.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected function requestToken(): string
6161
XLog::info('RequestToken response', ['response' => $response]);
6262

6363
if (strlen($response) > 10) { // got string token
64-
$this->getTransaction()->setGatewayToken($response); // update transaction reference id
64+
$this->getTransaction()->setGatewayToken(strval($response)); // update transaction reference id
6565

6666
return $response;
6767
} else {

src/Adapter/Zarinpal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function requestToken(): string
6464
if (isset($response->Status)) {
6565

6666
if ($response->Status == 100) {
67-
$this->getTransaction()->setGatewayToken($response->Authority); // update transaction reference id
67+
$this->getTransaction()->setGatewayToken(strval($response->Authority)); // update transaction reference id
6868

6969
return $response->Authority;
7070
} else {

0 commit comments

Comments
 (0)