承接 mex3890/pim 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mex3890/pim

最新稳定版本:1.0.2

Composer 安装命令:

composer require mex3890/pim

包简介

README 文档

README

Payment Integration Manager

First Steps

Publish Config

php artisan vendor:p --tag=pim

Disable Payment Action

You can need disable an action key globally like card.create or a specific payment service action, PIM enable you to work with two scenarios, first disable globally a Payment Action, to that just add action key in config pim.php like bellow:

> //pim.php

return [
    'disabled_actions' => [
        'pix' => [
            'create',
            'delete',
        ],   
    ],
];

Now to disable specific actions from a Payment Service, you need extend and create our new ServiceMap who list our actions and to read this ServiceMap you need extend and create new PaymentProvider to use our custom ServiceMap with or needed actions.

<?php

use App\CustomPayment\PaymentServices\PixService\Actions\CreateAction;
use App\CustomPayment\PaymentServices\PixService\Actions\DestroyAction;
use Pim\ServiceMap;

class PixServiceMap extends ServiceMap
{
    public static function actionPrefix(): string
    {
        return 'pix';
    }

    public static function actions(): array
    {
        return [
            CreateAction::ACTION_KEY,
            DestroyAction::ACTION_KEY,
        ];
    }
}
<?php

use App\CustomPayment\PaymentServices\PixService;
use App\CustomPayment\PaymentServices\PixService\PixServiceMap;
use Pim\DataTransferObjects\ConfigFile;
use Pim\PaymentProvider;

class CustomPaymentProvider extends PaymentProvider
{
    public static function actionMaps(): array
    {
        return [
            PixServiceMap::class,
        ];
    }
}

In the PaymentProvider you can override and add our customs PaymentServices like bellow:

<?php

use App\CustomPayment\PaymentServices\PixService;
use App\CustomPayment\PaymentServices\PixService\PixServiceMap;
use Pim\DataTransferObjects\ConfigFile;
use Pim\PaymentProvider;

class CustomPaymentProvider extends PaymentProvider
{
    public static function paymentServices(): array
    {
        return [
            PixService::class,
        ];
    }
}

To disable a PaymentService you can add to config pim.php the service key that need be disabled like bellow:

> //pim.php

return [
    'disabled_services' => [
        'pix',
    ],
];

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: Dockerfile

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-19