Replace Ladill Pay POS checkouts with merchant gateways.
Deploy Ladill POS / deploy (push) Successful in 30s
Deploy Ladill POS / deploy (push) Successful in 30s
Register Card/MoMo payments through merchant Paystack, Flutterwave, or Hubtel settings so takings settle 100% to the business. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,13 +6,16 @@ use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Pos\Concerns\ScopesToAccount;
|
||||
use App\Models\PosLocation;
|
||||
use App\Models\PosMember;
|
||||
use App\Models\PaymentGatewaySetting;
|
||||
use App\Models\PosTable;
|
||||
use App\Services\Import\CrmProductImportService;
|
||||
use App\Services\Import\MerchantCatalogImportService;
|
||||
use App\Services\Payments\MerchantGatewayService;
|
||||
use App\Services\Pos\PosLocationService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\View\View;
|
||||
use RuntimeException;
|
||||
|
||||
@@ -23,6 +26,7 @@ class SettingsController extends Controller
|
||||
public function __construct(
|
||||
private PosLocationService $locations,
|
||||
private \App\Services\Pos\SubscriptionService $subscriptions,
|
||||
private MerchantGatewayService $gateway,
|
||||
) {}
|
||||
|
||||
public function index(Request $request): View
|
||||
@@ -47,6 +51,7 @@ class SettingsController extends Controller
|
||||
'merchantImportEnabled' => (bool) config('pos.merchant_import_enabled', true),
|
||||
'tables' => $this->scopeToLocation($request, PosTable::owned($owner))
|
||||
->orderBy('area')->orderBy('position')->orderBy('label')->get(),
|
||||
'gateway' => $this->gateway->settingFor($account),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -62,6 +67,16 @@ class SettingsController extends Controller
|
||||
'remove_receipt_logo' => ['sometimes', 'boolean'],
|
||||
'printer_paper_mm' => ['required', 'in:58,80'],
|
||||
'printer_auto_print' => ['sometimes', 'boolean'],
|
||||
'gateway_provider' => ['nullable', Rule::in([
|
||||
PaymentGatewaySetting::PROVIDER_PAYSTACK,
|
||||
PaymentGatewaySetting::PROVIDER_FLUTTERWAVE,
|
||||
PaymentGatewaySetting::PROVIDER_HUBTEL,
|
||||
'',
|
||||
])],
|
||||
'gateway_public_key' => ['nullable', 'string', 'max:2000'],
|
||||
'gateway_secret_key' => ['nullable', 'string', 'max:2000'],
|
||||
'gateway_webhook_secret' => ['nullable', 'string', 'max:2000'],
|
||||
'gateway_is_active' => ['nullable', 'boolean'],
|
||||
]);
|
||||
|
||||
$user = ladill_account() ?? $request->user();
|
||||
@@ -98,6 +113,8 @@ class SettingsController extends Controller
|
||||
'receipt_logo_path' => $location->receipt_logo_path,
|
||||
]);
|
||||
|
||||
$this->persistGateway($request, $user);
|
||||
|
||||
return back()->with('success', 'Settings saved.');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user