From 6073bf801ed2581074098b956c5e94f81040cf8e Mon Sep 17 00:00:00 2001 From: Aji Kamaludin Date: Tue, 27 Jun 2023 09:57:37 +0700 Subject: [PATCH] bitfix midtrans notification --- app/Http/Controllers/Customer/DepositController.php | 4 +++- .../2023_05_24_130646_create_deposit_histories_table.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Customer/DepositController.php b/app/Http/Controllers/Customer/DepositController.php index ae6d610..b161764 100644 --- a/app/Http/Controllers/Customer/DepositController.php +++ b/app/Http/Controllers/Customer/DepositController.php @@ -163,13 +163,15 @@ class DepositController extends Controller public function mindtrans_notification(Request $request) { + info('mindtrans_notification', ['request boyd' => $request->input()]); + DB::beginTransaction(); $deposit = DepositHistory::where('id', $request->order_id)->first(); if ($deposit != null && $deposit->is_valid != DepositHistory::STATUS_VALID) { $deposit->fill([ 'payment_response' => json_encode($request->all()), - 'payment_type' => $request->result['payment_type'], + 'payment_type' => $request->payment_type, ]); if ($request->transaction_status == 'settlement' || $request->transaction_status == 'capture') { diff --git a/database/migrations/2023_05_24_130646_create_deposit_histories_table.php b/database/migrations/2023_05_24_130646_create_deposit_histories_table.php index b6f6f9a..7df8b75 100644 --- a/database/migrations/2023_05_24_130646_create_deposit_histories_table.php +++ b/database/migrations/2023_05_24_130646_create_deposit_histories_table.php @@ -29,7 +29,7 @@ return new class extends Migration $table->string('payment_channel')->nullable(); $table->string('payment_token')->nullable(); $table->string('payment_status')->nullable(); - $table->string('payment_response')->nullable(); + $table->text('payment_response')->nullable(); $table->string('payment_type')->nullable(); $table->timestamps();