@@ -16,7 +16,7 @@ |
||
| 16 | 16 | $this->driver = $driver; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - abstract public function init($amount, $orderId, $callbackUrl, $detail = []); |
|
| 19 | + abstract public function init($amount, $orderId, $callbackUrl, $detail = []); |
|
| 20 | 20 | |
| 21 | 21 | abstract public function verify($request); |
| 22 | 22 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | $this->loadMigrationsFrom(__DIR__ . '/database/migrations'); |
| 29 | 29 | |
| 30 | 30 | $this->publishes([ |
| 31 | - __DIR__.'/config/dizatech_transaction.php' =>config_path('dizatech_transaction.php') |
|
| 31 | + __DIR__ . '/config/dizatech_transaction.php' =>config_path('dizatech_transaction.php') |
|
| 32 | 32 | ], 'dizatech_transaction'); |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -16,16 +16,16 @@ discard block |
||
| 16 | 16 | $class = new PasargadIpg($this->getInformation()); |
| 17 | 17 | $class->verifySSL(config('dizatech_transaction.information')['pasargad']['options']['verifySSL']); |
| 18 | 18 | |
| 19 | - $result = $class->getToken( $amount, $transaction->id, $transaction->created_at->format('Y/m/d H:i:s'), $callbackUrl ); |
|
| 19 | + $result = $class->getToken($amount, $transaction->id, $transaction->created_at->format('Y/m/d H:i:s'), $callbackUrl); |
|
| 20 | 20 | |
| 21 | - if(isset($detail['auto_redirect']) && $detail['auto_redirect'] == false && $result->status == 'success') { |
|
| 21 | + if (isset($detail['auto_redirect']) && $detail['auto_redirect'] == false && $result->status == 'success') { |
|
| 22 | 22 | $result->token = $result->token; |
| 23 | 23 | $result->url = 'https://pep.shaparak.ir/payment.aspx?n=' . $result->token; |
| 24 | 24 | return $result; |
| 25 | 25 | |
| 26 | - } elseif($result->status == 'success') { |
|
| 26 | + } elseif ($result->status == 'success') { |
|
| 27 | 27 | $this->updateTransactionData($transaction->id, ['token' => $result->token]); |
| 28 | - header( 'Location: https://pep.shaparak.ir/payment.aspx?n=' . $result->token ); |
|
| 28 | + header('Location: https://pep.shaparak.ir/payment.aspx?n=' . $result->token); |
|
| 29 | 29 | die(); |
| 30 | 30 | |
| 31 | 31 | } |
@@ -38,11 +38,11 @@ discard block |
||
| 38 | 38 | $class = new PasargadIpg($this->getInformation()); |
| 39 | 39 | $class->verifySSL(config('dizatech_transaction.information')['pasargad']['options']['verifySSL']); |
| 40 | 40 | |
| 41 | - $check = $class->checkTransaction( $request['iN'], $request['iD'] ); |
|
| 41 | + $check = $class->checkTransaction($request['iN'], $request['iD']); |
|
| 42 | 42 | |
| 43 | 43 | if ($check->status == 'success') { |
| 44 | 44 | $transaction = $this->getTransaction($request['iN']); |
| 45 | - $result = $class->verifyTransaction( (int) $transaction->amount, $request['iN'], $request['iD'] ); |
|
| 45 | + $result = $class->verifyTransaction((int) $transaction->amount, $request['iN'], $request['iD']); |
|
| 46 | 46 | |
| 47 | 47 | if ($result->status == 'success') { |
| 48 | 48 | $this->updateTransactionData($request['iN'], ['status' => 'successful', 'ref_no' => $request['tref']]); |
@@ -16,14 +16,14 @@ discard block |
||
| 16 | 16 | $class = new ParsianIpg($this->getInformation()); |
| 17 | 17 | $result = $class->paymentRequest($amount, $transaction->id, $callbackUrl); |
| 18 | 18 | |
| 19 | - if(isset($detail['auto_redirect']) && $detail['auto_redirect'] == false && $result->status == 'success') { |
|
| 19 | + if (isset($detail['auto_redirect']) && $detail['auto_redirect'] == false && $result->status == 'success') { |
|
| 20 | 20 | $result->token = $result->token; |
| 21 | 21 | $result->url = 'https://pec.shaparak.ir/NewIPG/?Token=' . $result->token; |
| 22 | 22 | return $result; |
| 23 | 23 | |
| 24 | - } elseif($result->status == 'success') { |
|
| 24 | + } elseif ($result->status == 'success') { |
|
| 25 | 25 | $this->updateTransactionData($transaction->id, ['token' => $result->token]); |
| 26 | - header( 'Location: https://pec.shaparak.ir/NewIPG/?Token=' . $result->token ); |
|
| 26 | + header('Location: https://pec.shaparak.ir/NewIPG/?Token=' . $result->token); |
|
| 27 | 27 | die(); |
| 28 | 28 | |
| 29 | 29 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | $class = new ParsianIpg($this->getInformation()); |
| 37 | 37 | |
| 38 | - $result = $class->confirmPayment( $request['Token'] ); |
|
| 38 | + $result = $class->confirmPayment($request['Token']); |
|
| 39 | 39 | |
| 40 | 40 | if ($result->status == 'success') { |
| 41 | 41 | $this->updateTransactionData($request['OrderId'], ['status' => 'successful', 'ref_no' => $request['RRN']]); |
@@ -13,10 +13,10 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('transactions', function (Blueprint $table) { |
|
| 16 | + Schema::create('transactions', function(Blueprint $table) { |
|
| 17 | 17 | $table->id(); |
| 18 | 18 | $table->unsignedBigInteger('order_id'); |
| 19 | - $table->decimal('amount', 15,2); |
|
| 19 | + $table->decimal('amount', 15, 2); |
|
| 20 | 20 | $table->string('driver', 128); |
| 21 | 21 | $table->enum('status', ['pending', 'successful', 'failed', 'refunded']); |
| 22 | 22 | $table->string('ref_no')->nullable(); |
@@ -10,11 +10,11 @@ |
||
| 10 | 10 | use HasFactory; |
| 11 | 11 | |
| 12 | 12 | protected $fillable = ['order_id', 'status', 'amount', 'driver', 'ref_no', 'token']; |
| 13 | - protected $appends = ['gateway','toman','status_label']; |
|
| 13 | + protected $appends = ['gateway', 'toman', 'status_label']; |
|
| 14 | 14 | |
| 15 | 15 | public function parent() |
| 16 | 16 | { |
| 17 | - return $this->belongsTo( config('dizatech_transaction.model'), 'order_id' ); |
|
| 17 | + return $this->belongsTo(config('dizatech_transaction.model'), 'order_id'); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function getGatewayAttribute() |