@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | |
15 | 15 | $result = $this->payment_request($amount, $callbackUrl); |
16 | 16 | |
17 | - if(isset($detail['auto_redirect']) && $detail['auto_redirect'] == false && $result['status'] == 1) { |
|
17 | + if (isset($detail['auto_redirect']) && $detail['auto_redirect'] == false && $result['status'] == 1) { |
|
18 | 18 | $result['token'] = $result['invoice_key']; |
19 | 19 | $result['url'] = config('gateway.information')['poolam']['api_url'] . "pay/" . $result['token']; |
20 | 20 | return $result; |
21 | 21 | |
22 | - } elseif($result['status'] == 1) { |
|
22 | + } elseif ($result['status'] == 1) { |
|
23 | 23 | $this->updateTransactionData($transaction->id, ['token' => $result['invoice_key']]); |
24 | - header( 'Location: ' . config('gateway.information')['poolam']['api_url'] . "pay/" . $result['invoice_key']); |
|
24 | + header('Location: ' . config('gateway.information')['poolam']['api_url'] . "pay/" . $result['invoice_key']); |
|
25 | 25 | die(); |
26 | 26 | |
27 | 27 | } |
@@ -45,25 +45,25 @@ discard block |
||
45 | 45 | return $check; |
46 | 46 | } |
47 | 47 | |
48 | - protected function check_payment($inv_key){ |
|
48 | + protected function check_payment($inv_key) { |
|
49 | 49 | $ch = curl_init(); |
50 | - curl_setopt($ch,CURLOPT_URL,config('gateway.information')['poolam']['api_url'] . 'check/'.$inv_key); |
|
51 | - curl_setopt($ch,CURLOPT_POSTFIELDS,"api_key=" . config('gateway.information')['poolam']['api_key']); |
|
50 | + curl_setopt($ch, CURLOPT_URL, config('gateway.information')['poolam']['api_url'] . 'check/' . $inv_key); |
|
51 | + curl_setopt($ch, CURLOPT_POSTFIELDS, "api_key=" . config('gateway.information')['poolam']['api_key']); |
|
52 | 52 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); |
53 | - curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); |
|
53 | + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
|
54 | 54 | $res = curl_exec($ch); |
55 | 55 | curl_close($ch); |
56 | - return json_decode($res,1); |
|
56 | + return json_decode($res, 1); |
|
57 | 57 | } |
58 | 58 | |
59 | - protected function payment_request($amount,$redirect){ |
|
59 | + protected function payment_request($amount, $redirect) { |
|
60 | 60 | $ch = curl_init(); |
61 | - curl_setopt($ch,CURLOPT_URL,config('gateway.information')['poolam']['api_url'] . 'request'); |
|
62 | - curl_setopt($ch,CURLOPT_POSTFIELDS,"api_key=" . config('gateway.information')['poolam']['api_key'] . "&amount=$amount&return_url=$redirect"); |
|
63 | - curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, FALSE); |
|
64 | - curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); |
|
61 | + curl_setopt($ch, CURLOPT_URL, config('gateway.information')['poolam']['api_url'] . 'request'); |
|
62 | + curl_setopt($ch, CURLOPT_POSTFIELDS, "api_key=" . config('gateway.information')['poolam']['api_key'] . "&amount=$amount&return_url=$redirect"); |
|
63 | + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); |
|
64 | + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
|
65 | 65 | $res = curl_exec($ch); |
66 | 66 | curl_close($ch); |
67 | - return json_decode($res,1); |
|
67 | + return json_decode($res, 1); |
|
68 | 68 | } |
69 | 69 | } |