Skip to content

Commit

Permalink
Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sohrabafard authored Dec 15, 2019
1 parent 54db529 commit 6e418b9
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/BehpardakhtGateWay.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use DateTime;
use AlaaTV\Gateways\RedirectData;
use AlaaTV\Gateways\Contracts\{OnlineGateway, IranianCurrency, OnlinePaymentVerificationResponseInterface};
use Illuminate\Http\Request;

class BehpardakhtGateWay implements OnlineGateway
{
Expand Down Expand Up @@ -54,7 +53,7 @@ public function generatePaymentPageUriObject($refId): RedirectData

public function getAuthorityValue(): string
{
return Request::input('RefId', '');
return \Request::input('RefId', '');
}

public function verifyPayment(IranianCurrency $amount, $authority): OnlinePaymentVerificationResponseInterface
Expand All @@ -71,18 +70,18 @@ public function verifyPayment(IranianCurrency $amount, $authority): OnlinePaymen
* "_token" => "CATNE2rXs0TWtSh2I4aFNyqpYMOq15cLGwVgcKpD"`
* ]
*/
// if ($amount->rials() !== Request::input('FinalAmount')) {
// if ($amount->rials() !== \Request::input('FinalAmount')) {
// return 'fake request.';
// }
/*
$refId = Request::input('RefId');
$trackingCode = Request::input('SaleReferenceId');
$cardNumber = Request::input('CardHolderPan');
$resCode = Request::input('ResCode');
$saleOrderId = Request::input('SaleOrderId');*/
$refId = \Request::input('RefId');
$trackingCode = \Request::input('SaleReferenceId');
$cardNumber = \Request::input('CardHolderPan');
$resCode = \Request::input('ResCode');
$saleOrderId = \Request::input('SaleOrderId');*/

if (Request::input('ResCode') != 0) {
return VerificationResponse::instance(request()->all(), false, Request::input('ResCode'));
if (\Request::input('ResCode') != 0) {
return VerificationResponse::instance(request()->all(), false, \Request::input('ResCode'));
}

$response = $this->verify();
Expand All @@ -97,7 +96,7 @@ public function verifyPayment(IranianCurrency $amount, $authority): OnlinePaymen
return VerificationResponse::instance(request()->all(), false, $response->return);
}

return VerificationResponse::instance(request()->all(), true, Request::input('ResCode'));
return VerificationResponse::instance(request()->all(), true, \Request::input('ResCode'));
}

protected function settleRequest()
Expand Down Expand Up @@ -128,9 +127,9 @@ private function getVerificationParams(): array
'terminalId' => config('behpardakht.terminalId'),
'userName' => config('behpardakht.username'),
'userPassword' => config('behpardakht.password'),
'orderId' => Request::input('SaleOrderId'),
'saleOrderId' => Request::input('SaleOrderId'),
'saleReferenceId' => Request::input('SaleReferenceId'),
'orderId' => \Request::input('SaleOrderId'),
'saleOrderId' => \Request::input('SaleOrderId'),
'saleReferenceId' => \Request::input('SaleReferenceId'),
];
}

Expand Down

0 comments on commit 6e418b9

Please sign in to comment.