<?php
namespace App\Notifications\User;
use Carbon\Carbon;
use App\Models\Transaction;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;
class CardPaymentEmailNotification extends Notification
{
use Queueable;
public $transaction_id;
public $user;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct($transaction_id,$user)
{
$this->transaction_id = $transaction_id;
$this->user = $user;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
$transaction_data = Transaction::where('id',$this->transaction_id)->first();
$user = $this->user;
$date = Carbon::now();
$dateTime = $date->format('Y-m-d h:i:s A');
return (new MailMessage)
->greeting("Hello ".$user->fullname." !")
->subject("Order placed using ".'****'. substr($transaction_data->details->card_payment->card_number,-4))
->line("Request Amount: " . $transaction_data->request_amount.' '. $transaction_data->request_currency)
->line("Transaction ID: " .$transaction_data->trx_id)
->line("Status: " . $transaction_data->stringStatus->value)
->line("Date And Time: " .$dateTime)
->line('Thank you for using our application!');
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}
How To Payment
Making a payment on our website is quick and secure. Start by logging in or creating an account. Select your preferred payment method, input the required details, and review the information. Once you confirm everything is correct, click on the "Submit Payment" button. You’ll receive instant confirmation and can track your payment status through your account dashboard. It’s an easy and secure process.