2017 © Pedro Peláez
 

library aggregate-payment

image

lisao/aggregate-payment

  • Monday, April 9, 2018
  • by yuanxin32323
  • Repository
  • 1 Watchers
  • 4 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 7 % Grown

The README.md

aggregate-payment

聚合支付, (*1)

该项目集成支付宝、微信支付接口 提供更便利的调用方式, (*2)

安装方式

composer require lisao/aggregate-payment

创建微信支付

$pay_config = [
  'app_id'=>'',       //微信公众号开发者app_id
  'mch_id'=>'',       //商户号
  'key'=>'',          //商户秘钥
  'sign_type=>'MD5',  //签名方式
  'sand_box'=false,   //是否沙箱环境
];

//创建微信支付配置
$wx_config = new \LisaoPayment\WxPay\WxPayConfig($pay_config['app_id'], $pay_config['mch_id'], $pay_config['key'], $pay_config['sign_type'], $pay_config['sand_box']);

//实例化微信支付api
$wx_api = new \LisaoPayment\WxPay\WxPayApi($wx_config);

//创建订单配置
$order_config = new \LisaoPayment\WxConfig\CreateOrderConfig();
$order_config->set_out_trade_no('');//商户订单
$order_config->set_notify_url('');//回调地址
$order_config->set_body('');//订单详情
$order_config->set_nonce_str('');//随机字符串
$order_config->set_trade_type('JSAPI');//支付类型
$order_config->set_total_fee(1);//支付金额,单位分

//提交订单
try {
    $wx_order = $wx_api->create_order($order_config);
    $prepay_id = $wx_order['prepay_id'];
    print_r($wx_order);exit;
} catch (\LisaoPayment\WxPay\WxPayException $ex) {
    echo '订单创建失败';
}

The Versions

09/04 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Lisao

alipay wechat aggregate-payment

09/04 2018

1.0.6

1.0.6.0

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Lisao

alipay wechat aggregate-payment

20/03 2018

1.0.5

1.0.5.0

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Lisao

alipay wechat aggregate-payment

25/02 2018

1.0.4

1.0.4.0

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Lisao

alipay wechat aggregate-payment

25/02 2018

1.0.3

1.0.3.0

  Sources   Download

MIT

The Requires

 

by Lisao

alipay wechat aggregate-payment

25/02 2018

1.0.2

1.0.2.0

  Sources   Download

MIT

The Requires

 

by Lisao

alipay wechat aggregate-payment

12/02 2018

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

 

by Lisao

alipay wechat aggregate-payment

12/02 2018

1.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

by Lisao

alipay wechat aggregate-payment