d3yii2 / d3paymentsystems

此包最新版本(dev-master)没有可用的许可证信息。

D3支付系统

dev-master 2024-09-11 09:35 UTC

This package is auto-updated.

Last update: 2024-09-11 09:36:15 UTC


README

#D3支付系统"

功能

d3pPersonContacts 的模型和组件

  • Skrill
  • Luxon
  • Cripto

安装

在 app/composer.json 中添加 require

"d3yii2/d3paymentsystems": "dev-master"

翻译

    'd3paymentsystems => [
        'class' => \'yii\i18n\PhpMessageSource\',
        'basePath' => '@vendor/d3yii2/d3paymentsystems/messages',
        'sourceLanguage' => 'en-US',
    ],

配置

Skrill 组件

配置

        'PersonSettingSkrill' => [
            'class' => 'd3yii2\d3paymentsystems\components\PersonSettingSkrill',
            'contactTypeId' => 4,
            'currencyList' => ['EUR','USD','MULTI']
        ],

迁移

        $model = new D3pContactType();
        $model->id = D3pContactType::TYPE_SKRILL;
        $model->class_name = 'component:PersonSettingSkrill';
        $model->setGroupSettings();
        if (!$model->save()) {
            throw new d3system\exceptions\D3ActiveRecordException($model);
        }
        $model->language = 'ru';
        $model->name = 'Skrill';
        if (!$model->saveTranslation()) {
            throw new d3system\exceptions\D3ActiveRecordException($model);
        }

Cripto 组件

        'PersonSettingCrypto' => [
            'class' => 'd3yii2\d3paymentsystems\components\PersonSettingCrypto',
            'contactTypeId' => 17,
            'typeDef' => [
                'BNB' => [
                    'bep20'
                ]
            ]
        ],

迁移

        $model = new D3pContactType();
        $model->id = D3pContactType::TYPE_CRYPTO;
        $model->class_name = 'component:PersonSettingCrypto';
        $model->setGroupSettings();
        if (!$model->save()) {
            throw new d3system\exceptions\D3ActiveRecordException($model);
        }
        $model->language = 'ru';
        $model->name = 'Crypto';
        if (!$model->saveTranslation()) {
            throw new d3system\exceptions\D3ActiveRecordException($model);
        }

Luxor 组件

        'PersonSettingLuxon' => [
            'class' => 'd3yii2\d3paymentsystems\components\PersonSettingLuxon',
            'contactTypeId' => 16,
        ],

迁移

        $model = new D3pContactType();
        $model->id = D3pContactType::TYPE_LUXON;
        $model->class_name = 'component:PersonSettingLuxon';
        $model->setGroupSettings();
        if (!$model->save()) {
            throw new d3system\exceptions\D3ActiveRecordException($model);
        }
        $model->language = 'ru';
        $model->name = 'Luxon';
        if (!$model->saveTranslation()) {
            throw new d3system\exceptions\D3ActiveRecordException($model);
        }

显示值

    $component = Yii::$app->$componentName;
    $component->findModel($model->id);
    $options = []; // for each component can be own options
    echo $component->showValue($options);

示例