fond-of-oryx/gift-card-proportional-value
Composer 安装命令:
composer require fond-of-oryx/gift-card-proportional-value
包简介
GiftCardProportionalValue module.
README 文档
README
This package will install a new table foo_proportional_gift_card_value. By default this module only provides table and functionality to execute plugins and do nothing without plugins.
Possible plugins will be provided in
- "fond-of-oryx/gift-card-proportional-value-no-payment-connector"
- "fond-of-oryx/gift-card-proportional-value-payone-connector"
and could be used like this
<?php
namespace Pyz\Zed\GiftCardProportionalValue;
use FondOfOryx\Zed\GiftCardProportionalValue\GiftCardProportionalValueDependencyProvider as FooGiftCardProportionalValueDependencyProvider;
use FondOfOryx\Zed\GiftCardProportionalValueNoPaymentConnector\Communication\Plugin\GiftCardProportionalValue\NoPaymentProportionalValueCalculationPlugin;
use FondOfOryx\Zed\GiftCardProportionalValuePayoneConnector\Communication\Plugin\GiftCardProportionalValue\PayoneProportionalValueCalculationPlugin;
class GiftCardProportionalValueDependencyProvider extends FooGiftCardProportionalValueDependencyProvider
{
/**
* @return array|\FondOfOryx\Zed\GiftCardProportionalValueExtension\Dependency\Plugin\ProportionalValueCalculationPluginInterface[]
*/
protected function getProportionalValueCalulationPlugins(): array
{
$plugins = [
new PayoneProportionalValueCalculationPlugin(),
new NoPaymentProportionalValueCalculationPlugin(),
];
return array_merge(parent::getProportionalValueCalulationPlugins(), $plugins);
}
}
Installation
composer require fond-of-oryx/gift-card-proportional-value
Configuration
Inject GiftCardProportionalValue command and condition into OMS. Add in config_default.php
$config[KernelConstants::DEPENDENCY_INJECTOR_ZED] = [
'Payment' => [
...
],
'Oms' => [
...
'GiftCardProportionalValue',
],
];
Another way is to add them manually in pyz OmsDependencyProvider
/**
* @param \Spryker\Zed\Kernel\Container $container
*
* @return \Spryker\Zed\Kernel\Container
*/
public function provideBusinessLayerDependencies(Container $container)
{
$container = parent::provideBusinessLayerDependencies($container);
$container->extend(static::CONDITION_PLUGINS, static function (ConditionCollectionInterface $conditionCollection) {
...
$conditionCollection->add(new HasRedeemedGiftCardsConditionPlugin(), 'GiftCardProportionalValue/HasRedeemedGiftCards');
return $conditionCollection;
});
$container->extend(self::COMMAND_PLUGINS, static function (CommandCollectionInterface $commandCollection) {
...
$commandCollection->add(new GiftCardProportionalValueCalculatorCommandPlugin(), 'GiftCardProportionalValue/CalculateProportionalValues');
return $commandCollection;
});
return $container;
}
Update the oms workflow
with something like this.
GiftCardProportionalValue01.xml in config\zed\oms
<?xml version="1.0"?>
<statemachine
xmlns="spryker:oms-01"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="spryker:oms-01 http://static.spryker.com/oms-01.xsd"
>
<process name="GiftCardProportionalValue01">
<states>
<state name="calculate proportional gift card values" display="oms.state.calculate-gift-card-proportional-values"/>
<state name="gift card proportional values calculated" display="oms.state.gift-card-proportional-values-calculated"/>
</states>
<transitions>
<transition condition="GiftCardProportionalValue/HasRedeemedGiftCards">
<source>order confirmation sent</source>
<target>calculate proportional gift card values</target>
<event>wait for export</event>
</transition>
<transition>
<source>calculate proportional gift card values</source>
<target>gift card proportional values calculated</target>
<event>calculate gift card proportional values</event>
</transition>
<transition>
<source>gift card proportional values calculated</source>
<target>export pending</target>
<event>wait for export</event>
</transition>
</transitions>
<events>
<event name="calculate gift card proportional values" onEnter="true" command="GiftCardProportionalValue/CalculateProportionalValues"/>
<event name="wait for export" onEnter="true"/>
</events>
</process>
</statemachine>
but keep in mind that this should be edited with you states and events!
fond-of-oryx/gift-card-proportional-value 适用场景与选型建议
fond-of-oryx/gift-card-proportional-value 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.4k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 05 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 fond-of-oryx/gift-card-proportional-value 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fond-of-oryx/gift-card-proportional-value 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 13.4k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 9
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-31