定制 infinite-software/sylius-ecommpay-plugin 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

infinite-software/sylius-ecommpay-plugin

Composer 安装命令:

composer require infinite-software/sylius-ecommpay-plugin

包简介

Ecommpay payum plugin for Sylius.

README 文档

README

Installation

$ composer require infinite-software/sylius-ecommpay-plugin

Add plugin dependencies to your app/AppKernel.php file:

public function registerBundles()
{
    return array_merge(parent::registerBundles(), [
        ...
        
        new IS\SyliusEcommpayPlugin\ISSyliusEcommpayPlugin(),
    ]);
}

Add new Payment Method in your project Admin section with Ecommpay gateway, where you should add provided secretkey and project_id.

Ask Ecommpay Support to set Callback URL to http://example.com/payment/notify/unsafe/ecommpay (or reassign route from this action to another place if needed)

Adding Payment Page extra parameters

If you need prepend parameters before sending request to Ecommpay (for example from https://developers.ecommpay.com/ru/ru_PP_Parameters.html), copy contents of Payum\Ecommpay\Action\ConvertPaymentAction class into a new file located in src/Payment/Ecommpay/ConvertPaymentAction:

namespace App\Payment\Ecommpay;

//use ...;

final class ConvertPaymentAction implements ActionInterface, ApiAwareInterface
{
    ...

    /**
     * {@inheritDoc}
     *
     * @param Convert $request
     */
    public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        /** @var PaymentInterface $payment */
        $payment = $request->getSource();

        /** @var OrderInterface $order */
        $params = [
            'payment_id' => $payment->getNumber(),
            'payment_amount' => $payment->getTotalAmount(),
            'payment_currency' => $payment->getCurrencyCode(),
            'project_id' => $this->api['projectId'],
            'customer_id' => $payment->getClientId(),
            // my extra parameter
            'force_payment_method' => 'card'
        ];
        $request->setResult($params);
    }
    ...
}

And lastly declare it as service in services.yaml. Do not forget to make service public like this:

App\Payment\Ecommpay\ConvertPaymentAction:
    public: true
    tags:
        - { name: payum.action, factory: ecommpay, alias: payum.action.convert_payment }

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固