fond-of-oryx / gift-card-proportional-value-no-payment-connector
GiftCardProportionalValueNoPaymentConnector module.
2.0.0
2023-01-24 12:59 UTC
Requires
- php: >=8.0
- fond-of-oryx/gift-card-proportional-value: ^1.1.0 || ^2.0.0
- fond-of-oryx/gift-card-proportional-value-extension: ^1.0.0 || ^2.0.0
- spryker/nopayment: ^4.0
Requires (Dev)
README
In our case, we need the proportional gift card values for every item in order, if a gift card was redeemed. Completely paid orders with gift cards will be handled in our case as paid orders and uses the no payment workflow.
This package provides a calculation plugin for the fond-of-oryx/gift-card-proportional-value
package and sets the item amount as proportional value for orders with payment method paid.
Installation
composer require fond-of-oryx/gift-card-proportional-value-no-payment-connector
Configuration
<?php
namespace Pyz\Zed\GiftCardProportionalValue;
use FondOfOryx\Zed\GiftCardProportionalValue\GiftCardProportionalValueDependencyProvider as FooGiftCardProportionalValueDependencyProvider;
use FondOfOryx\Zed\GiftCardProportionalValueNoPaymentConnector\Communication\Plugin\GiftCardProportionalValue\NoPaymentProportionalValueCalculationPlugin;
class GiftCardProportionalValueDependencyProvider extends FooGiftCardProportionalValueDependencyProvider
{
/**
* @return array|\FondOfOryx\Zed\GiftCardProportionalValueExtension\Dependency\Plugin\ProportionalValueCalculationPluginInterface[]
*/
protected function getProportionalValueCalulationPlugins(): array
{
$plugins = [
...
new NoPaymentProportionalValueCalculationPlugin(),
];
return array_merge(parent::getProportionalValueCalulationPlugins(), $plugins);
}
}