47 lines
1.7 KiB
PHP
47 lines
1.7 KiB
PHP
<?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 —
|
|
| it's the Modules\Core\Checkout\Contracts\PaymentDriver class
|
|
| CheckoutService::confirmPayment() resolves via the container and calls
|
|
| confirm() on. Kept on the same row as 'driver' rather than a second,
|
|
| separately-keyed map, so a type's full definition — Lunar's driver,
|
|
| its config, and its PaymentDriver — lives in one place.
|
|
|
|
|
*/
|
|
'types' => [
|
|
'cash-on-delivery' => [
|
|
'driver' => 'offline',
|
|
'payment_driver' => OfflinePaymentDriver::class,
|
|
'authorized' => 'awaiting-payment',
|
|
'fee' => 0,
|
|
],
|
|
],
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Lunar cart pipeline additions
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Appended to config('lunar.cart.pipelines.cart') after ApplyShipping so
|
|
| the cash-on-delivery fee is added to the shipping total before the
|
|
| final Calculate step sums everything up.
|
|
|
|
|
*/
|
|
'cart_pipeline' => [
|
|
ApplyCashOnDeliveryFee::class,
|
|
],
|
|
];
|