Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kitlabs-cn/kitpaybundle

weixin pay & alipay symfony3
https://github.com/kitlabs-cn/kitpaybundle

bundle pay payment symfony

Last synced: about 1 month ago
JSON representation

weixin pay & alipay symfony3

Awesome Lists containing this project

README

        

# KitPayBundle
Symfony wrapper for [payment](https://github.com/helei112g/payment).
The KitPayBundle provides a simple integration for your Symfony project.

## Installation

### Step 1: Download the Bundle
---------------------------

Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:


$ composer require kitlabs/kit-pay-bundle


This command requires you to have Composer installed globally, as explained
in the [installation chapter](https://getcomposer.org/doc/00-intro.md)
of the Composer documentation.

### Step 2: Enable the Bundle
---------------------------

Then, enable the bundle by adding it to the list of registered bundles
in the `app/AppKernel.php` file of your project:

[
'ali_app', // 支付宝app支付
'ali_wap', // 支付宝H5支付
'ali_web', // 支付宝电脑网站支付
'ali_qr', // 支付宝当面付:扫码支付
'ali_bar' // 支付宝当面付:条码支付
],
'weipay' => [
'wx_app', // 微信app支付
'wx_pub', // 微信公众号支付
'wx_qr', // 微信扫码支付
'wx_bar', // 微信刷卡支付
'wx_lite', // 微信小程序支付
'wx_wap' // 微信H5支付
],
'cmbpay' => [
'cmb_app', // 招商一网通app支付
'cmb_wap' // 招商H5支付
]
];

/**
* @var \Kit\Bundle\PayBundle\Service\PaymentService $paymentService
*/
$paymentService = $this->get('kit_pay.payment_service');
$paymentService->run($channel, $paytype, $metadata); // $channel one of "alipay","weipay"

// 不使用默认配置的商户号支付,添加额外商户号支付
$paymentService->run($channel, $paytype, $metadata,$config); // $config为配置的数组