fond-of-oryx/gift-card-proportional-value-no-payment-connector

GiftCardProportionalValueNoPaymentConnector module.

1.0.0 2022-06-14 12:09 UTC

This package is auto-updated.

Last update: 2022-07-14 14:34:58 UTC


README

CI license

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);
    }

}