如何增加新的支付方式

技术问题 · johocn · 于 3年前 发布 · 1885 次阅读

在fecshop/common/config/fecshop_local_services/Payment.php增加了两个支付方式,但是在 checkout/onepage/payment?order_increment_id=1 页面没有新的支付方式可供选择,请问需要哪些配置

return [
    'payment' => [
        /**
         * 不需要释放库存的支付方式。譬如货到付款,在系统中
         * pending订单,如果一段时间未付款,会释放产品库存,但是货到付款类型的订单不会释放,
         * 如果需要释放产品库存,客服在后台取消订单即可释放产品库存。
         */
        'noRelasePaymentMethod' => ['check_money'],    
        'paymentConfig' => [        // 支付方式配置
            'standard' => [            // 标准支付类型:在购物车页面进入下单页面,填写支付信息,然后跳转到第三方支付网站的支付类型。
                'check_money' => [    // 货到付款类型。
                    'label'                => '现金(Check/Money Order)',
                    //'image' => ['images/mastercard.png','common'] ,# 支付页面显示的图片。
                    'supplement'               => 'Off-line Money Payments', // 补充信息
                    'style'                    => '<style>请联系客户付款</style>',  // 补充css,您可以在这里填写一些css
                    'start_url'                => '@homeUrl/payment/checkmoney/start',    // 点击按钮后,跳转的url,在这个url里面写支付跳转前的提交信息。
                    'success_redirect_url'     => '@homeUrl/payment/success',            // 在支付平台支付成功后,返回的页面
                ],
                'collect' => [    // 到付。
                    'label'                => '到店自提付款',
                    //'image' => ['images/mastercard.png','common'] ,# 支付页面显示的图片。
                    'supplement'               => 'Off-line Money Payments', // 补充信息
                    'style'                    => '<style>请联系客户付款</style>',  // 补充css,您可以在这里填写一些css
                    'start_url'                => '@homeUrl/payment/checkmoney/start',    // 点击按钮后,跳转的url,在这个url里面写支付跳转前的提交信息。
                    'success_redirect_url'     => '@homeUrl/payment/success',            // 在支付平台支付成功后,返回的页面
                ],
				'cash_on_delivery' => [    // 货到付款类型。
                    'label'                => '货到付款',
                    //'image' => ['images/mastercard.png','common'] ,# 支付页面显示的图片。
                    'supplement'               => 'Ocash_on_delivery', // 补充信息
                    'style'                    => '<style>请联系客户付款</style>',  // 补充css,您可以在这里填写一些css
                    'start_url'                => '@homeUrl/payment/checkmoney/start',    // 点击按钮后,跳转的url,在这个url里面写支付跳转前的提交信息。
                    'success_redirect_url'     => '@homeUrl/payment/success',          
                ],
共收到 2 条回复
Fecmall#13年前 0 个赞

1.您可以读一下源码看一下,这个页面的支付方式是怎么出来的,读一下源码就明白了,这里都不给你指出来详细文件路径了

2.你用的是fecyo?

johocn#23年前 0 个赞

解决办法: 1、需要重写一下后台model,block '\fecshop\app\appadmin\modules\Config\block\apphtml5payment\Manager'=>'\你的命名空间\app\appadmin\modules\Config\block\apphtml5payment\Manager',

2、编辑上述Manager文件

//改第一处
protected $_attrArr = [
        'check_money',
        'collect',
        'cash_on_delivery',
        'paypal_standard',
        'paypal_express',
        'alipay_standard',
        'wxpay_standard',
        'wxpay_jsapi',
        'wxpay_h5',
    ];
//改第二处
    public function getEditArr()
    {
        $deleteStatus = Yii::$service->customer->getStatusDeleted();
        $activeStatus = Yii::$service->customer->getStatusActive();
        
        return [
            // 需要配置
            [
                'label' => Yii::$service->page->translate->__('Check Money'),
                'name'  => 'check_money',
                'display' => [
                    'type' => 'select',
                    'data' => [
                        Yii::$app->store->enable => 'Enable',
                        Yii::$app->store->disable => 'Disable',
                    ],
                ],
                'remark' => '线下支付'
            ],
            [
                'label' => '到店提货付款支付方式',
                'name'  => 'collect',
                'display' => [
                    'type' => 'select',
                    'data' => [
                        Yii::$app->store->enable => 'Enable',
                        Yii::$app->store->disable => 'Disable',
                    ],
                ],
                'remark' => '到店提货付款'
            ],
            [
                'label' => '货到付款支付方式',
                'name'  => 'cash_on_delivery',
                'display' => [
                    'type' => 'select',
                    'data' => [
                        Yii::$app->store->enable => 'Enable',
                        Yii::$app->store->disable => 'Disable',
                    ],
                ],
                'remark' => '货到付款'
            ],  

3.进入后台,html5支付配置-》启用新的支付方式

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics