Return Payment::purchase from livewire component methods
avadis opened this issue · comments
Hi,
Sir, I'm using Zarinpal's Sandbox mode as the default Payment(Config).
It doesn't redirect to Zarinpal's Sandbox by Payment::purchase method.
$invoice = new Invoice();
$invoice = $invoice->amount(3000);
$invoice = $invoice->transactionId(23232);
$invoice = $invoice->via('zarinpal');
$invoice = $invoice->detail('detailName','Testname');
return Payment::purchase($invoice, function($driver, $transactionId) { // Store transactionId in database as we need it to verify payment in the future. })->pay()->render();
"laravel/framework": "^8.54",
"livewire/livewire": "^2.6.7",
Thank you.
This issue is related to the render() method of the RedirectForm.php file.
It does not work correctly in livewire components.
Do you have any suggestions?
call toJson
instead of render
and then retrieve data and render it yourself as a form using livewire.