2017 © Pedro Peláez
 

symfony-bundle kit-pay-bundle

Easily use alipay & weixinpay in Symfony

image

kitlabs/kit-pay-bundle

Easily use alipay & weixinpay in Symfony

  • Friday, November 17, 2017
  • by kitlabs
  • Repository
  • 2 Watchers
  • 5 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

KitPayBundle

Symfony wrapper for payment.
The KitPayBundle provides a simple integration for your Symfony project., (*1)

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:, (*2)

$ composer require kitlabs/kit-pay-bundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*3)

### 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:, (*4)

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new Kit\Bundle\PayBundle\KitPayBundle(),
        );

        // ...
    }

    // ...
}

Step 3: Configuration

# config.yml
kit_pay:
    config:
        alipay:
            use_sandbox: true
            partner: 20888xxxxxx  #收款支付宝用户ID
            app_id: 2014072xxxxxxx # 支付宝分配给开发者的应用ID
            sign_type: RSA2 # RSA or RSA2
            ali_public_key: '%kernel.root_dir%/alipay/alipay_public_key_sha256.txt' # path or content(app/alipay/alipay_public_key_sha256.txt)
            rsa_private_key: '%kernel.root_dir%/alipay/rsa_private_key_2048.txt' # path or content(app/alipay/rsa_private_key_2048.txt)
            limit_pay: ['creditCard']
            notify_url: http://kitlabs.cn/notify
            return_url: http://kitlabs.cn/return
            return_raw: true # 异步回调是否显示原始数据
        weipay:
            use_sandbox: true
            app_id: wx47xxxxxxx # appid是微信公众账号或开放平台APP的唯一标识
            mch_id: 148xxxxxx # 商户收款账号
            md5_key: de95341c9xxxxxx # API密钥
            app_cert_pem: '%kernel.root_dir%/cert/apiclient_cert.pem' # app/cert/apiclient_cert.pem
            app_key_pem: '%kernel.root_dir%/cert/apiclient_key.pem'  # app/cert/apiclient_key.pem
            sign_type: MD5  # MD5 or HMAC-SHA256
            limit_pay: ['no_credit']
            fee_type: CNY
            notify_url: http://kitlabs.cn/notify
            redirect_url: http://kitlabs.cn/return
            return_raw: true # 异步回调是否显示原始数据

Read the payment configure documentation, (*5)

Usage

//paytype and channel
$types = [
        'alipay' => [
            '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为配置的数组

The Versions

17/11 2017

dev-master

9999999-dev https://github.com/kitlabs-cn/KitPayBundle

Easily use alipay & weixinpay in Symfony

  Sources   Download

MIT

The Requires

 

payment alipay pay bundle weixin pay

17/11 2017

v0.2.2

0.2.2.0 https://github.com/kitlabs-cn/KitPayBundle

Easily use alipay & weixinpay in Symfony

  Sources   Download

MIT

The Requires

 

payment alipay pay bundle weixin pay

17/11 2017

v0.2.1

0.2.1.0 https://github.com/kitlabs-cn/KitPayBundle

Easily use alipay & weixinpay in Symfony

  Sources   Download

MIT

The Requires

 

payment alipay pay bundle weixin pay

16/11 2017

v0.2.0

0.2.0.0 https://github.com/kitlabs-cn/KitPayBundle

Easily use alipay & weixinpay in Symfony

  Sources   Download

MIT

The Requires

 

payment alipay pay bundle weixin pay

10/09 2017

v0.1.9

0.1.9.0 https://github.com/kitlabs-cn/KitPayBundle

Easily use alipay & weixinpay in Symfony

  Sources   Download

MIT

The Requires

 

payment alipay pay bundle weixin pay

07/09 2017

v0.1.8

0.1.8.0 https://github.com/kitlabs-cn/KitPayBundle

Easily use alipay & weixinpay in Symfony

  Sources   Download

MIT

The Requires

 

payment alipay pay bundle weixin pay

06/09 2017

v0.1.7

0.1.7.0 https://github.com/kitlabs-cn/KitPayBundle

Easily use alipay & weixinpay in Symfony

  Sources   Download

MIT

The Requires

 

payment alipay pay bundle weixin pay

31/08 2017

v0.1.6

0.1.6.0 https://github.com/kitlabs-cn/KitPayBundle

Easily use alipay & weixinpay in Symfony

  Sources   Download

MIT

The Requires

 

payment alipay pay bundle weixin pay

25/08 2017

v0.1.5

0.1.5.0 https://github.com/kitlabs-cn/KitPayBundle

Easily use alipay & weixinpay in Symfony

  Sources   Download

MIT

The Requires

 

payment alipay pay bundle weixin pay

23/08 2017

v0.1.4

0.1.4.0 https://github.com/kitlabs-cn/KitPayBundle

Easily use alipay & weixinpay in Symfony

  Sources   Download

MIT

The Requires

 

payment alipay pay bundle weixin pay

21/08 2017

v0.1.3

0.1.3.0 https://github.com/kitlabs-cn/KitPayBundle

Easily use alipay & weixinpay in Symfony

  Sources   Download

MIT

The Requires

 

payment alipay pay bundle weixin pay

21/08 2017

v0.1.2

0.1.2.0 https://github.com/kitlabs-cn/KitPayBundle

Easily use alipay & weixinpay in Symfony

  Sources   Download

MIT

The Requires

 

payment alipay pay bundle weixin pay

21/08 2017

v0.1.1

0.1.1.0 https://github.com/kitlabs-cn/KitPayBundle

Easily use alipay & weixinpay in Symfony

  Sources   Download

MIT

The Requires

 

aliyun oss