@@ -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,7 +92,7 @@ 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 | 98 | |
@@ -105,10 +105,10 @@ discard block |
||
| 105 | 105 | $this->cardHolder = $cardHolder; |
| 106 | 106 | $this->cardHolderId = $cardHolderId; |
| 107 | 107 | $this->cardNumber = $cardNumber; |
| 108 | - $this->cvc = $cvc; |
|
| 108 | + $this->cvc = $cvc; |
|
| 109 | 109 | $this->expirationDate = $expirationDate; |
| 110 | - $this->statusId = $statusId; |
|
| 111 | - $this->ipAddres = $ipAddres; |
|
| 110 | + $this->statusId = $statusId; |
|
| 111 | + $this->ipAddres = $ipAddres; |
|
| 112 | 112 | |
| 113 | 113 | $url = $this->root . 'payment'; // endpoint |
| 114 | 114 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * https://github.com/abr4xas/php-instapago/blob/master/help/DOCUMENTACION.md#completar-pago |
| 150 | 150 | */ |
| 151 | 151 | |
| 152 | - public function continuePayment($amount,$idPago) |
|
| 152 | + public function continuePayment($amount, $idPago) |
|
| 153 | 153 | { |
| 154 | 154 | try { |
| 155 | 155 | |
@@ -241,10 +241,10 @@ discard block |
||
| 241 | 241 | $url = $this->root . 'payment'; // endpoint |
| 242 | 242 | |
| 243 | 243 | $myCurl = curl_init(); |
| 244 | - curl_setopt($myCurl, CURLOPT_URL, $url.'?'.'KeyID='. $this->keyId .'&PublicKeyId='. $this->publicKeyId .'&id=' . $this->idPago); |
|
| 244 | + curl_setopt($myCurl, CURLOPT_URL, $url . '?' . 'KeyID=' . $this->keyId . '&PublicKeyId=' . $this->publicKeyId . '&id=' . $this->idPago); |
|
| 245 | 245 | curl_setopt($myCurl, CURLOPT_RETURNTRANSFER, 1); |
| 246 | 246 | $server_output = curl_exec($myCurl); |
| 247 | - curl_close ($myCurl); |
|
| 247 | + curl_close($myCurl); |
|
| 248 | 248 | $obj = json_decode($server_output); |
| 249 | 249 | $result = $this->checkResponseCode($obj); |
| 250 | 250 | |
@@ -270,12 +270,12 @@ discard block |
||
| 270 | 270 | public function curlTransaccion($url, $fields) |
| 271 | 271 | { |
| 272 | 272 | $myCurl = curl_init(); |
| 273 | - curl_setopt($myCurl, CURLOPT_URL,$url ); |
|
| 273 | + curl_setopt($myCurl, CURLOPT_URL, $url); |
|
| 274 | 274 | curl_setopt($myCurl, CURLOPT_POST, 1); |
| 275 | - curl_setopt($myCurl, CURLOPT_POSTFIELDS,http_build_query($fields)); |
|
| 275 | + curl_setopt($myCurl, CURLOPT_POSTFIELDS, http_build_query($fields)); |
|
| 276 | 276 | curl_setopt($myCurl, CURLOPT_RETURNTRANSFER, true); |
| 277 | - $server_output = curl_exec ($myCurl); |
|
| 278 | - curl_close ($myCurl); |
|
| 277 | + $server_output = curl_exec($myCurl); |
|
| 278 | + curl_close($myCurl); |
|
| 279 | 279 | $obj = json_decode($server_output); |
| 280 | 280 | return $obj; |
| 281 | 281 | } |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | throw new InstapagoException('Ha Ocurrido un error al procesar los parámetros de entrada. Revise los datos enviados y vuelva a intentarlo.'); |
| 304 | 304 | }elseif ($code == 201) { |
| 305 | 305 | return [ |
| 306 | - 'code' => $code , |
|
| 306 | + 'code' => $code, |
|
| 307 | 307 | 'msg_banco' => $obj->message, |
| 308 | 308 | 'voucher' => html_entity_decode($obj->voucher), |
| 309 | 309 | 'id_pago' => $obj->id, |