2017 © Pedro Peláez
 

project tenpay

经过改装后的一个腾讯财付通支付

image

kevin365/tenpay

经过改装后的一个腾讯财付通支付

  • Wednesday, July 26, 2017
  • by lamp365
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

tenpay

个人封装的一个composer组件,财付通支付组件 以及对应的QQ扫码支付组件, (*1)

使用如下

include './vendor/autoload.php'; //财付通 $tenpay_config = array(
'partner' => '1486474181',
'key' => '4ff7a938fc9489b17f7b9b4f5127c59a',
'return_url' => 'http://baidu.com',
'notify_url' => 'http://baidu.com',
);
$pay = new kevin365\tenpay\Tenpay($tenpay_config);
$data['ordersn'] = date('YmdHis').uniqid();
$data['title'] = '测试商品';
$data['price'] = '1';
$pay->pay($data);, (*2)

//QQ扫码
//入参
$params = array();
$params["out_trade_no"] = "20160512161914".uniqid();
$params["sub_mch_id"] = "";
$params["body"] = "body_test_中文";
$params["device_info"] = "WP00000001";
$params["fee_type"] = "CNY";
$params["notify_url"] = "https://10.222.146.71:80/success.xml";
$params["spbill_create_ip"] = "127.0.0.1";
$params["total_fee"] = "1";
$params["trade_type"] = "NATIVE";, (*3)

//参数检测
//实际业务中请校验参数,本demo略
//
$pay_config = array(
'MCH_ID' => '1486419881', //QQ钱包商户号
'SUB_MCH_ID' => '', //子账户号
'MCH_KEY' => '21212', //api密钥
'CERT_FILE_PATH' => '', //证书私钥
'KEY_FILE_PATH' => '', //证书公钥
'NOTIFY_URL' => '', //成功回调地址
);, (*4)

//api调用
$qpayApi = new \kevin365\tenpay\qpay\QpayMchAPI('https://qpay.qq.com/cgi-bin/pay/qpay_unified_order.cgi', null, 10,$pay_config);
$ret = $qpayApi->reqQpay($params);
$Qpay = new \kevin365\tenpay\qpay\QpayMchUtil();
print_r($Qpay->xmlToArray($ret));
//最后得到code_url生成二维码,用手机扫码可完成支付, (*5)

composer地址

https://packagist.org/packages/kevin365/tenpay
"require":{
"kevin365/tenpay":"1.3"
},, (*6)

The Versions

26/07 2017

dev-master

9999999-dev http://dayblog.cn/

经过改装后的一个腾讯财付通支付

  Sources   Download

xx-2.0

The Requires

  • php >=5.3.0

 

by 刘建凡

26/07 2017

1.3.1

1.3.1.0 http://dayblog.cn/

经过改装后的一个腾讯财付通支付

  Sources   Download

xx-2.0

The Requires

  • php >=5.3.0

 

by 刘建凡

26/07 2017

1.3

1.3.0.0 http://dayblog.cn/

经过改装后的一个腾讯财付通支付

  Sources   Download

xx-2.0

The Requires

  • php >=5.3.0

 

by 刘建凡

25/07 2017

1.2

1.2.0.0 http://dayblog.cn/

经过改装后的一个腾讯财付通支付

  Sources   Download

xx-2.0

The Requires

  • php >=5.3.0

 

by 刘建凡

25/07 2017

1.0.2

1.0.2.0 http://dayblog.cn/

经过改装后的一个腾讯财付通支付

  Sources   Download

xx-2.0

The Requires

  • php >=5.3.0

 

by 刘建凡

25/07 2017

1.0.1

1.0.1.0 http://dayblog.cn/

经过改装后的一个腾讯财付通支付

  Sources   Download

xx-2.0

The Requires

  • php >=5.3.0

 

by 刘建凡