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