mex3890/pim 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱: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
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固