@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | private function generateAuthenticationEnvelope($pubKey, $terminalID, $password, $amount) |
| 44 | 44 | { |
| 45 | - $data = $terminalID . $password . str_pad($amount, 12, '0', STR_PAD_LEFT) . '00'; |
|
| 45 | + $data = $terminalID.$password.str_pad($amount, 12, '0', STR_PAD_LEFT).'00'; |
|
| 46 | 46 | $data = hex2bin($data); |
| 47 | 47 | $AESSecretKey = openssl_random_pseudo_bytes(16); |
| 48 | 48 | $ivlen = openssl_cipher_iv_length($cipher = "AES-128-CBC"); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $hmac = hash('sha256', $ciphertext_raw, true); |
| 52 | 52 | $crypttext = ''; |
| 53 | 53 | |
| 54 | - openssl_public_encrypt($AESSecretKey . $hmac, $crypttext, $pubKey); |
|
| 54 | + openssl_public_encrypt($AESSecretKey.$hmac, $crypttext, $pubKey); |
|
| 55 | 55 | |
| 56 | 56 | return array( |
| 57 | 57 | "data" => bin2hex($crypttext), |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 104 | 104 | curl_setopt($ch, CURLOPT_HTTPHEADER, array( |
| 105 | 105 | 'Content-Type: application/json', |
| 106 | - 'Content-Length: ' . strlen($dataString) |
|
| 106 | + 'Content-Length: '.strlen($dataString) |
|
| 107 | 107 | )); |
| 108 | 108 | curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'DEFAULT@SECLEVEL=1'); |
| 109 | 109 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 172 | 172 | curl_setopt($ch, CURLOPT_HTTPHEADER, array( |
| 173 | 173 | 'Content-Type: application/json', |
| 174 | - 'Content-Length: ' . strlen($dataString) |
|
| 174 | + 'Content-Length: '.strlen($dataString) |
|
| 175 | 175 | )); |
| 176 | 176 | curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'DEFAULT@SECLEVEL=1'); |
| 177 | 177 | |
@@ -266,9 +266,9 @@ discard block |
||
| 266 | 266 | 930 => 'کد ملی ارائه شده نا معتبر می باشد)Tokenization(' |
| 267 | 267 | ]; |
| 268 | 268 | if (array_key_exists($status, $translations)) { |
| 269 | - throw new InvalidPaymentException($translations[$status], (int)$status); |
|
| 269 | + throw new InvalidPaymentException($translations[$status], (int) $status); |
|
| 270 | 270 | } else { |
| 271 | - throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', (int)$status); |
|
| 271 | + throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', (int) $status); |
|
| 272 | 272 | } |
| 273 | 273 | } |
| 274 | 274 | } |