Skip to content

Commit bd93bd7

Browse files
Update Zibal.php
1 parent bdf2462 commit bd93bd7

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/Drivers/Zibal.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ class Zibal implements Bank
1313
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
1414
* @throws \Exception
1515
*/
16-
public function request($api, $amount, $callbackURL)
16+
public function request($api, $amount, $callbackURL, $info_user)
1717
{
18-
$request = Http::withOptions(['verify' => config('payments.http_verify')])
19-
->withHeaders($this->setHeaders())
20-
->post('https://gateway.zibal.ir/v1/request', $this->setParams($amount, $callbackURL));
18+
$request = Http::withHeaders($this->setHeaders())
19+
->post('https://gateway.zibal.ir/v1/request', $this->setParams($amount, $callbackURL, $info_user));
2120
$response = json_decode($request->getBody()->getContents(), true);
2221
if ($response['result'] !== 100) {
2322
return ['message' => $response['message'], 'code' => $response['result']];
@@ -37,8 +36,7 @@ public function request($api, $amount, $callbackURL)
3736
*/
3837
public function verify($params)
3938
{
40-
$request = Http::withOptions(['verify' => config('payments.http_verify')])
41-
->withHeaders($this->setHeaders())->post('https://gateway.zibal.ir/v1/verify', [
39+
$request = Http::withHeaders($this->setHeaders())->post('https://gateway.zibal.ir/v1/verify', [
4240
"merchant" => config('payments.Api_key.Zibal'),
4341
"trackId" => $params
4442
]);
@@ -57,13 +55,13 @@ public function verify($params)
5755
* @param $callbackURL
5856
* @return array
5957
*/
60-
private function setParams ($amount, $callbackURL) {
58+
private function setParams ($amount, $callbackURL, $info_user) {
6159
return [
6260
"merchant"=> config('payments.Test_payment') == false ? config('payments.drivers.Zibal.key') : 'zibal',
6361
"callbackUrl"=> $callbackURL,
6462
"amount"=> config('payments.currency') == 'rtt' ? $amount * 10 : $amount,
6563
"orderId"=> time(),
66-
"mobile"=> Auth::user()->mobile
64+
"mobile"=> $info_user['mobile']
6765
];
6866
}
6967

0 commit comments

Comments
 (0)