initial commit

This commit is contained in:
2026-04-13 08:16:56 +08:00
parent 610676a668
commit 273c8e8153
1270 changed files with 331207 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace App\Http\Controllers;
use App\Models\Plan;
use App\Models\User;
use App\Models\Setting;
use App\Models\PlanOrder;
use App\Models\PaymentSetting;
use Illuminate\Http\Request;
class BankPaymentController extends Controller
{
public function processPayment(Request $request)
{
$validated = validatePaymentRequest($request, [
'amount' => 'required|numeric|min:0',
]);
try {
$plan = Plan::findOrFail($validated['plan_id']);
createPlanOrder([
'user_id' => auth()->id(),
'plan_id' => $plan->id,
'billing_cycle' => $validated['billing_cycle'],
'payment_method' => 'bank',
'coupon_code' => $validated['coupon_code'] ?? null,
'payment_id' => 'BANK_' . strtoupper(uniqid()),
'status' => 'pending',
]);
return back()->with('success', __('Payment request submitted. Your plan will be activated after payment verification.'));
} catch (\Exception $e) {
return handlePaymentError($e, 'bank');
}
}
}