@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | spl_autoload_register(function($class) |
33 | 33 | { |
34 | - $file = dirname(__DIR__). DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; |
|
34 | + $file = dirname(__DIR__) . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; |
|
35 | 35 | |
36 | 36 | return ( ! is_file($file)) ?: require $file; |
37 | 37 | }); |
38 | 38 | \ No newline at end of file |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @param string $publicKeyId llave publica |
60 | 60 | * Requeridas. |
61 | 61 | */ |
62 | - public function __construct ($keyId,$publicKeyId) |
|
62 | + public function __construct($keyId, $publicKeyId) |
|
63 | 63 | { |
64 | 64 | |
65 | 65 | try { |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | * Efectúa un pago con tarjeta de crédito, una vez procesado retornar una respuesta. |
93 | 93 | * https://github.com/abr4xas/php-instapago/blob/master/help/DOCUMENTACION.md#crear-un-pago |
94 | 94 | */ |
95 | - public function payment($amount,$description,$cardHolder,$cardHolderId,$cardNumber,$cvc,$expirationDate,$statusId,$ipAddres) |
|
95 | + public function payment($amount, $description, $cardHolder, $cardHolderId, $cardNumber, $cvc, $expirationDate, $statusId, $ipAddres) |
|
96 | 96 | { |
97 | 97 | try { |
98 | - $params = array($amount,$description,$cardHolder,$cardHolderId,$cardNumber,$cvc,$expirationDate,$statusId,$ipAddres); |
|
98 | + $params = array($amount, $description, $cardHolder, $cardHolderId, $cardNumber, $cvc, $expirationDate, $statusId, $ipAddres); |
|
99 | 99 | $this->checkRequiredParams($params); |
100 | 100 | |
101 | 101 | $this->amount = $amount; |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | $this->cardHolder = $cardHolder; |
104 | 104 | $this->cardHolderId = $cardHolderId; |
105 | 105 | $this->cardNumber = $cardNumber; |
106 | - $this->cvc = $cvc; |
|
106 | + $this->cvc = $cvc; |
|
107 | 107 | $this->expirationDate = $expirationDate; |
108 | - $this->statusId = $statusId; |
|
109 | - $this->ipAddres = $ipAddres; |
|
108 | + $this->statusId = $statusId; |
|
109 | + $this->ipAddres = $ipAddres; |
|
110 | 110 | |
111 | 111 | $url = $this->root . 'payment'; // endpoint |
112 | 112 | |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | * https://github.com/abr4xas/php-instapago/blob/master/help/DOCUMENTACION.md#completar-pago |
148 | 148 | */ |
149 | 149 | |
150 | - public function continuePayment($amount,$idPago) |
|
150 | + public function continuePayment($amount, $idPago) |
|
151 | 151 | { |
152 | 152 | try { |
153 | - $params = array($amount,$idPago); |
|
153 | + $params = array($amount, $idPago); |
|
154 | 154 | $this->checkRequiredParams($params); |
155 | 155 | |
156 | 156 | $this->amount = $amount; |
@@ -234,10 +234,10 @@ discard block |
||
234 | 234 | $url = $this->root . 'payment'; // endpoint |
235 | 235 | |
236 | 236 | $myCurl = curl_init(); |
237 | - curl_setopt($myCurl, CURLOPT_URL, $url.'?'.'KeyID='. $this->keyId .'&PublicKeyId='. $this->publicKeyId .'&id=' . $this->idPago); |
|
237 | + curl_setopt($myCurl, CURLOPT_URL, $url . '?' . 'KeyID=' . $this->keyId . '&PublicKeyId=' . $this->publicKeyId . '&id=' . $this->idPago); |
|
238 | 238 | curl_setopt($myCurl, CURLOPT_RETURNTRANSFER, 1); |
239 | 239 | $server_output = curl_exec($myCurl); |
240 | - curl_close ($myCurl); |
|
240 | + curl_close($myCurl); |
|
241 | 241 | $obj = json_decode($server_output); |
242 | 242 | $result = $this->checkResponseCode($obj); |
243 | 243 | |
@@ -263,12 +263,12 @@ discard block |
||
263 | 263 | public function curlTransaccion($url, $fields) |
264 | 264 | { |
265 | 265 | $myCurl = curl_init(); |
266 | - curl_setopt($myCurl, CURLOPT_URL,$url ); |
|
266 | + curl_setopt($myCurl, CURLOPT_URL, $url); |
|
267 | 267 | curl_setopt($myCurl, CURLOPT_POST, 1); |
268 | - curl_setopt($myCurl, CURLOPT_POSTFIELDS,http_build_query($fields)); |
|
268 | + curl_setopt($myCurl, CURLOPT_POSTFIELDS, http_build_query($fields)); |
|
269 | 269 | curl_setopt($myCurl, CURLOPT_RETURNTRANSFER, true); |
270 | - $server_output = curl_exec ($myCurl); |
|
271 | - curl_close ($myCurl); |
|
270 | + $server_output = curl_exec($myCurl); |
|
271 | + curl_close($myCurl); |
|
272 | 272 | $obj = json_decode($server_output); |
273 | 273 | return $obj; |
274 | 274 | } |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | throw new InstapagoException('Ha Ocurrido un error al procesar los parámetros de entrada. Revise los datos enviados y vuelva a intentarlo.'); |
297 | 297 | }elseif ($code == 201) { |
298 | 298 | return [ |
299 | - 'code' => $code , |
|
299 | + 'code' => $code, |
|
300 | 300 | 'msg_banco' => $obj->message, |
301 | 301 | 'voucher' => html_entity_decode($obj->voucher), |
302 | 302 | 'id_pago' => $obj->id, |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | private function checkRequiredParams(Array $params) |
316 | 316 | { |
317 | 317 | foreach ($params as $param) { |
318 | - if(empty($param)) |
|
318 | + if (empty($param)) |
|
319 | 319 | { |
320 | 320 | throw new InstapagoException('Parámetros faltantes para procesar el pago. Verifique la documentación.'); |
321 | 321 | } |