Feature: Moving Payment Methods to DB, adding fees, Transaction Updates, Refund Updates, General Updates to Payments
This commit is contained in:
+9
-29
@@ -1,37 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Modules\Core\Payment\Drivers\OfflinePaymentDriver;
|
||||
use Modules\Core\Payment\Pipelines\Cart\ApplyCashOnDeliveryFee;
|
||||
|
||||
return [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Lunar payment types merged in by Boboko Core
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These are merged into config('lunar.payments.types') so every app using
|
||||
| boboko-core gets cash-on-delivery out of the box, without publishing
|
||||
| Lunar's own config.
|
||||
|
|
||||
| 'payment_driver' is boboko-owned, alongside Lunar's own 'driver' key —
|
||||
| the driver instance Modules\Core\Payment\Services\PaymentDriverResolver
|
||||
| resolves via the container. 'capture_mode' ('pay' or 'authorize') is
|
||||
| also boboko-owned — which contract method
|
||||
| CheckoutService::initiatePayment() calls for this type. Kept on the
|
||||
| same row as 'driver' rather than a second, separately-keyed map, so a
|
||||
| type's full definition lives in one place.
|
||||
|
|
||||
*/
|
||||
'types' => [
|
||||
'cash-on-delivery' => [
|
||||
'driver' => 'offline',
|
||||
'payment_driver' => OfflinePaymentDriver::class,
|
||||
'capture_mode' => 'pay',
|
||||
'captured_status' => 'payment-offline',
|
||||
'fee' => 0,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Lunar cart pipeline additions
|
||||
@@ -41,6 +12,15 @@ return [
|
||||
| the cash-on-delivery fee is added to the shipping total before the
|
||||
| final Calculate step sums everything up.
|
||||
|
|
||||
| This is the one thing left in this file — everything about WHICH
|
||||
| payment methods exist (driver mapping, capture_mode, statuses) moved
|
||||
| onto Modules\Core\Payment\Models\PaymentMethod's own row (see
|
||||
| docs/payments.md): that's a per-instance, merchant decision, not a
|
||||
| store-wide-singular setting, so it never belonged in config at all.
|
||||
| This pipeline registration IS genuinely cross-cutting — every store
|
||||
| using this driver gets the same cart-pipeline wiring, regardless of
|
||||
| how many payment methods it configures.
|
||||
|
|
||||
*/
|
||||
'cart_pipeline' => [
|
||||
ApplyCashOnDeliveryFee::class,
|
||||
|
||||
Reference in New Issue
Block a user