From a016f9232b75822b5a6e18b5606021f4a8b0346c Mon Sep 17 00:00:00 2001 From: raccoon254 Date: Sat, 15 Jun 2024 18:24:08 +0300 Subject: [PATCH] Fix cash app payments error --- app/Livewire/OrderPayment.php | 5 +++++ app/Models/Payment.php | 5 ++++- app/Models/User.php | 1 - resources/views/orders/payment.blade.php | 5 ++++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/Livewire/OrderPayment.php b/app/Livewire/OrderPayment.php index 2dfdaa7..4718604 100644 --- a/app/Livewire/OrderPayment.php +++ b/app/Livewire/OrderPayment.php @@ -59,6 +59,11 @@ public function getPaymentDetails($method): array public function pay() { + // If the payment method is 'Cash app' + if ($this->payment_method === 'cash_app') { + $this->payment_method = 'cash app'; + } + // Implement the payment logic here $payment = Payment::create([ 'order_id' => $this->order->id, diff --git a/app/Models/Payment.php b/app/Models/Payment.php index 205c3ae..cb760ad 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -11,7 +11,10 @@ class Payment extends Model use HasFactory; protected $fillable = [ - 'order_id', 'amount', 'payment_method', 'status', + 'order_id', + 'amount', + 'payment_method', //[paypal, cash_app, zelle] + 'status', ]; public function order(): BelongsTo diff --git a/app/Models/User.php b/app/Models/User.php index c5559ad..b6f9bca 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -12,7 +12,6 @@ class User extends Authenticatable implements MustVerifyEmail { use HasFactory, Notifiable; - /** * The attributes that are mass assignable. * diff --git a/resources/views/orders/payment.blade.php b/resources/views/orders/payment.blade.php index 3e35733..f56d23a 100644 --- a/resources/views/orders/payment.blade.php +++ b/resources/views/orders/payment.blade.php @@ -36,7 +36,10 @@ class="absolute top-0 right-0 bg-blue-500 text-white p-2 rounded-bl-lg rounded-t -

Payment Instructions

+

+ Payment Instructions +

+
  1. Select your preferred payment method from the dropdown menu below.
  2. Follow the instructions provided for the selected payment method.