first commit

This commit is contained in:
meghamalore
2024-07-04 16:57:26 +05:30
parent 99f78bf4cb
commit eed0ce11d2
13538 changed files with 1484890 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace App\Http\Controllers\Frontend;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Mollie\Laravel\Facades\Mollie;
class PaymentController extends Controller
{
public function createPayment()
{
$payment = Mollie::api()->payments()->create([
'amount' => [
'currency' => 'EUR',
'value' => '10.00', // The payment amount
],
'description' => 'Test payment',
'redirectUrl' => route('payment.status'),
]);
// Redirect the user to the Mollie payment page
return redirect($payment->getCheckoutUrl());
}
public function paymentStatus()
{
$paymentId = request()->input('id');
$payment = Mollie::api()->payments()->get($paymentId);
// Check the payment status
if ($payment->status === 'paid') {
// Payment is successful
return 'Payment successful';
} else {
// Payment failed
return 'Payment failed';
}
}
}