Skip to content

Commit

Permalink
Merge pull request #1 from MohamadSH/patch-1
Browse files Browse the repository at this point in the history
Laravel 6
  • Loading branch information
sohrabafard authored Dec 15, 2019
2 parents 662507f + 8b8ded0 commit 54db529
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/BehpardakhtGateWay.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use DateTime;
use AlaaTV\Gateways\RedirectData;
use Illuminate\Support\Facades\Input;
use AlaaTV\Gateways\Contracts\{OnlineGateway, IranianCurrency, OnlinePaymentVerificationResponseInterface};
use Illuminate\Http\Request;

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

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

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

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

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

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

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

Expand All @@ -156,4 +156,4 @@ private function verify()
throw $e;
}
}
}
}

0 comments on commit 54db529

Please sign in to comment.