Redirect User to Page Out Side Filament Panel After A Record is Created

Am working on a solution that involves making payments so after a transaction is created or a payment the gateway returns a unique url where am supposed to redirect the user to complete the payment
protected function mutateFormDataBeforeCreate(array $data): array
{

$reference = Str::uuid();
$customer_names = Auth::user()->name;
$customer_email = Auth::user()->email;
$customer_id = Auth::user()->id;
$callback_url = "http://localhost:8000/callback";
$cancel_url = "http://localhost:8000/cancel";

$data['user_id'] = Auth::user()->id;
$data['type'] = config("transaction_type.types.credit");
$data['payment_mode'] = "Web";
$data['reference'] = $reference;
$data['status'] = config("stattus.payment_status.pending");

$res = Pesapal::orderProcess($reference, $data['amount'], $data['phone_number'], $data['description'], $callback_url, $customer_names, $customer_email, $customer_id, $cancel_url);


return $data;
}
protected function mutateFormDataBeforeCreate(array $data): array
{

$reference = Str::uuid();
$customer_names = Auth::user()->name;
$customer_email = Auth::user()->email;
$customer_id = Auth::user()->id;
$callback_url = "http://localhost:8000/callback";
$cancel_url = "http://localhost:8000/cancel";

$data['user_id'] = Auth::user()->id;
$data['type'] = config("transaction_type.types.credit");
$data['payment_mode'] = "Web";
$data['reference'] = $reference;
$data['status'] = config("stattus.payment_status.pending");

$res = Pesapal::orderProcess($reference, $data['amount'], $data['phone_number'], $data['description'], $callback_url, $customer_names, $customer_email, $customer_id, $cancel_url);


return $data;
}
2 Replies
codeartisan
codeartisanOP12mo ago
Pesapal returns a redirect url where I should redirect the user to complete the payment but am failing to redirect the user to that url anyone with a solution please recommend
Want results from more Discord servers?
Add your server