Commit 462836df by wangyu

feat: 调整富友支付

1 parent cc486e5f
Payment只有在大家的使用反馈中才能得到不断的完善。
我希望通过真实的项目来驱动它不断发展,在为工作带来方便的同时尽力保持它的简洁。
# issue报Bug
由于Payment高度依赖第三方接口,因此第三方一个小的变动也会导致项目产生一个大版本号。当前主要有:
- 2.x 应该没多少人使用了,已经放弃维护
- 3.x 继续维护,只修bug,不做接口更新
- 4.x 当前开发版本,均保持当前第三方的最新接口
由于版本比较多。因此报bug建议采用以下格式:
[3/4.x]版本,在什么环境下(沙盒还是正式),调用了什么接口,出现了什么错误(最好有截图)。自己尝试过哪些办法去解决未达到预期效果
推荐所有的bug在提交时,先使用demo代码运行一下,看看能否通过。
**只提供标题,或者没有重现步骤的,将不处理**
# 贡献代码
请代码书写遵循以下规则:
- [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
- 使用4个空格作为缩紧(不是tab)
- 命名使用驼峰命名(不准使用拼音)
- 请给类、方法、变量添加注释,注释需要包含:日期、修改人、含义
## 开发流程
1. Fork [helei112g/payment](https://github.com/helei112g/payment) 到本地
2. 创建新的分支:
```shell
$ git checkout -b new_feature
```
3. 编写代码
4. Push 到你的分支:
```shell
$ git push origin new_feature
```
5. 创建 Pull Request 并描述你完成的功能或者做出的修改
所提交的部分一定自己真实测试完毕,如果是新的支付功能,需要添加对应的demo以及
相关功能的文档(暂无开源文档地址,请根据功能名称,提供 `.md`的说明文档)。
## 代码说明
为了让大家快速理解代码结构,将项目相关结构图进行说明
---------
**`遇到bug,90%都是秘钥相关导致的,微信可能与后台配置有关。请仔细检查。`**
\ No newline at end of file
# payment # payment
> 支付工具包 v1.0 from riverslei/payment 支付工具包 from riverslei/payment
> v 2.0 > v2.0
* 新增通联支付 * 新增通联支付
> v3.0 > v3.0
......
**打赏名单**
名字 | 金额 | 说明 | 时间
---|---|---|---
北国之雪 | 30.00 | Payment好用 | 2017-05-04
里暮色中 | 50.00 | Payment越来越好(感谢发现一个bug issue#39) | 2017-05-01
lobtao | 8.88 | 你的内裤非常好用 | 2017-04-26
182xxxx | 10.00 | 支持 | 2017-04-19
来自简单 | 200.00 | 支付宝服务商模式咨询 | 2017-04-16
刘华 | 50.00 | 微信支付咨询 | 2017-04-14
靖 | 88.00 | 感谢开源 | 2017-03-19
李 | 150.00 | 打赏支持 | 2017-03-14
Alex.Ma | 6.66 | 支持 | 2017-03-13
阿笨 | 10.00 | 打算使用,先感谢一下 | 2017-03-10
彦 | 88.00 | 感觉还不错,特打赏88元,略表感谢。 | 2017-02-28
汤明洋 | 66.66 | 支持一下 | 2017-02-19
李仕建同学 | 18.88 | 新春快乐 | 2017-02-09
凡额 | 50.00 | 帮助调试,谢谢了 | 2017-01-18
Thans秦 | 66.66 | 商业使用 | 2017-01-08
John | 10.00 | 设计很棒 | 2017-01-06
Davidw | 699.00 | 支持开发2.0 | 2016-12-15
宁静致远 | 10.00 | 鼓励你,加油额 | 2016-12-13
k7 | 8.00 | 批量付款,一次成功 | 2016-11-24
洋 | 50.00 | 资助开源 | 2016-11-23
张仲东 | 50.00 | 接口封装的不错 | 2016-11-17
放下...快乐 | 1000.00 | 支付宝即时到帐处理 | 2016-11-15
Robin Core Animation | 50.00 | 解决微信支付问题 | 2016-11-04
5Z4 | 20.00 | 解决回调问题 | 2016-10-31
哈罗Joe | 1.00 | 加油~~ | 2016-8-23
小兵~招UI前端 | 50.00 | 继续努力,喝杯水吧:-) | 2016-8-14
尊称韦爵爷 | 1.00 | 赶紧出个yii的扩展 | 2016-7-22
一米市集 | 1000.00 | 希望提供技术长期合作 | 2016-7-20
张松 | 15.00 | 不错,已用到项目中 | 2016-6-17
\ No newline at end of file
...@@ -11,7 +11,7 @@ use Payment\Config; ...@@ -11,7 +11,7 @@ use Payment\Config;
$payData = [ $payData = [
'order_type' => 'WECHAT', //ALIPAY、UNIONPAY、BESTPAY 'order_type' => 'WECHAT', //ALIPAY、UNIONPAY、BESTPAY
'order_no' => trade_no(null, true), //商户订单号 'order_no' => '2019062017530653068450564957', //商户订单号
]; ];
try { try {
$ret = Query::run(Config::FU_CHARGE, $config, $payData); $ret = Query::run(Config::FU_CHARGE, $config, $payData);
......
...@@ -8,6 +8,7 @@ namespace Payment\Common\Fu\Data; ...@@ -8,6 +8,7 @@ namespace Payment\Common\Fu\Data;
*/ */
class BackBarChargeData extends FuBaseData class BackBarChargeData extends FuBaseData
{ {
public function getData() public function getData()
{ {
$this->retData = [ $this->retData = [
...@@ -15,8 +16,8 @@ class BackBarChargeData extends FuBaseData ...@@ -15,8 +16,8 @@ class BackBarChargeData extends FuBaseData
'out_order_no' => $this->reserved_fy_order_no, //富友订单号 'out_order_no' => $this->reserved_fy_order_no, //富友订单号
'order_type' => $this->order_type, //订单类型 'order_type' => $this->order_type, //订单类型
'amount' => $this->total_amount, //订单金额 'amount' => $this->total_amount, //订单金额
'user_id' => $this->buyer_id ?? '', //用户在商户的id
'buyer_id' => $this->reserved_buyer_logon_id ?? '', //买家在渠道登录账号 'buyer_id' => $this->reserved_buyer_logon_id ?? '', //买家在渠道登录账号
'business_buyer_id' => $this->buyer_id ?? '', //用户在商户的id
'transaction_id' => $this->transaction_id, 'transaction_id' => $this->transaction_id,
'channel_order_id' => $this->reserved_channel_order_id, //条码流水号,用户账单二维码对应的流水 'channel_order_id' => $this->reserved_channel_order_id, //条码流水号,用户账单二维码对应的流水
'time_end' => empty($this->reserved_txn_fin_ts) ? '' : date('Y-m-d H:i:s', strtotime($this->reserved_txn_fin_ts)), //用户支付时间 'time_end' => empty($this->reserved_txn_fin_ts) ? '' : date('Y-m-d H:i:s', strtotime($this->reserved_txn_fin_ts)), //用户支付时间
...@@ -24,17 +25,15 @@ class BackBarChargeData extends FuBaseData ...@@ -24,17 +25,15 @@ class BackBarChargeData extends FuBaseData
'return_param' => $this->addn_inf ?? '', //附加数据 'return_param' => $this->addn_inf ?? '', //附加数据
]; ];
return parent::getData(); // TODO: Change the autogenerated stub return parent::getData();
} }
protected function buildData() protected function buildData()
{ {
} }
protected function checkDataParam() protected function checkDataParam()
{ {
// 对于返回数据不做检查检查
} }
} }
...@@ -8,6 +8,7 @@ namespace Payment\Common\Fu\Data; ...@@ -8,6 +8,7 @@ namespace Payment\Common\Fu\Data;
*/ */
class BackPubChargeData extends FuBaseData class BackPubChargeData extends FuBaseData
{ {
public function getData() public function getData()
{ {
$data = []; $data = [];
...@@ -35,17 +36,16 @@ class BackPubChargeData extends FuBaseData ...@@ -35,17 +36,16 @@ class BackPubChargeData extends FuBaseData
'attach' => $this->reserved_addn_inf ?: '' 'attach' => $this->reserved_addn_inf ?: ''
]; ];
return parent::getData(); // TODO: Change the autogenerated stub return parent::getData();
} }
protected function buildData() protected function buildData()
{ {
} }
protected function checkDataParam() protected function checkDataParam()
{ {
// 不进行检查
} }
} }
...@@ -8,6 +8,7 @@ namespace Payment\Common\Fu\Data; ...@@ -8,6 +8,7 @@ namespace Payment\Common\Fu\Data;
*/ */
class BackScanChargeData extends FuBaseData class BackScanChargeData extends FuBaseData
{ {
public function getData() public function getData()
{ {
$data = [ $data = [
...@@ -21,17 +22,15 @@ class BackScanChargeData extends FuBaseData ...@@ -21,17 +22,15 @@ class BackScanChargeData extends FuBaseData
'attach' => $this->reserved_addn_inf ?: '' 'attach' => $this->reserved_addn_inf ?: ''
]; ];
return parent::getData(); // TODO: Change the autogenerated stub return parent::getData();
} }
protected function buildData() protected function buildData()
{ {
} }
protected function checkDataParam() protected function checkDataParam()
{ {
// 对于返回数据不做检查检查
} }
} }
...@@ -7,7 +7,6 @@ use Payment\Common\Fu\FuBaseStrategy; ...@@ -7,7 +7,6 @@ use Payment\Common\Fu\FuBaseStrategy;
use Payment\Common\FuConfig; use Payment\Common\FuConfig;
use Payment\Config; use Payment\Config;
class FuChargeQuery extends FuBaseStrategy class FuChargeQuery extends FuBaseStrategy
{ {
...@@ -42,8 +41,8 @@ class FuChargeQuery extends FuBaseStrategy ...@@ -42,8 +41,8 @@ class FuChargeQuery extends FuBaseStrategy
'channel' => Config::FU_CHARGE, 'channel' => Config::FU_CHARGE,
'order_type' => $data['order_type'] ?? '', 'order_type' => $data['order_type'] ?? '',
'order_no' => $data['mchnt_order_no'], //商户订单号, 商户系统内部的订单号 'order_no' => $data['mchnt_order_no'], //商户订单号, 商户系统内部的订单号
'user_id' => $data['buyer_id'] ?? '', //用户在商户的id
'buyer_id' => $data['reserved_buyer_logon_id'] ?? '', //买家在渠道登录账号 'buyer_id' => $data['reserved_buyer_logon_id'] ?? '', //买家在渠道登录账号
'business_buyer_id' => $data['buyer_id'] ?? '', //用户在商户的id
'trade_state' => $data['trans_stat'], //查询状态 'trade_state' => $data['trans_stat'], //查询状态
'transaction_id' => $data['transaction_id'], //渠道订单号 'transaction_id' => $data['transaction_id'], //渠道订单号
'time_end' => empty($data['reserved_txn_fin_ts']) ? '' : date('Y-m-d H:i:s', strtotime($data['reserved_txn_fin_ts'])), //用户支付时间 'time_end' => empty($data['reserved_txn_fin_ts']) ? '' : date('Y-m-d H:i:s', strtotime($data['reserved_txn_fin_ts'])), //用户支付时间
...@@ -52,4 +51,5 @@ class FuChargeQuery extends FuBaseStrategy ...@@ -52,4 +51,5 @@ class FuChargeQuery extends FuBaseStrategy
]; ];
return $backData; return $backData;
} }
} }
...@@ -6,7 +6,6 @@ use Payment\Common\Fu\Data\Query\RefundQueryData; ...@@ -6,7 +6,6 @@ use Payment\Common\Fu\Data\Query\RefundQueryData;
use Payment\Common\Fu\FuBaseStrategy; use Payment\Common\Fu\FuBaseStrategy;
use Payment\Common\FuConfig; use Payment\Common\FuConfig;
class FuRefundQuery extends FuBaseStrategy class FuRefundQuery extends FuBaseStrategy
{ {
...@@ -46,4 +45,5 @@ class FuRefundQuery extends FuBaseStrategy ...@@ -46,4 +45,5 @@ class FuRefundQuery extends FuBaseStrategy
]; ];
return $backData; return $backData;
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!