3 Commits
1.0 ... 1.0.2

Author SHA1 Message Date
bdf46a01ec 调整config 2021-07-22 11:06:20 +08:00
a34d344110 修改http 2021-05-26 17:14:36 +08:00
a60851f892 删除调试代码 2021-05-12 16:32:58 +08:00
4 changed files with 42 additions and 18 deletions

View File

@@ -5,7 +5,7 @@
"homepage": "http://git.yuzhankeji.cn/xuanchen/WoUnicom.git",
"authors": [
{
"name": "玄尘",
"name": "xuanchen",
"email": "122383162@qq.com"
}
],

View File

@@ -11,11 +11,11 @@ return [
'uri' => [
'unicom' => [
//下单
'order' => 'https://www.unicompayment.com/wappay3.0/httpservice/wapPayPageAction.do?reqcharset=UTF-8',
'order' => 'https://epay.10010.com/wappay3.0/httpservice/wapPayPageAction.do?reqcharset=UTF-8',
//查询
'query' => 'https://www.unicompayment.com/CashierWeb/query/order.htm?reqCharSet=UTF-8',
'query' => 'https://epay.10010.com/CashierWeb/query/order.htm?reqCharSet=UTF-8',
//单笔退款
'refund' => 'https://www.unicompayment.com/CashierWeb/trade/singleRefund.htm?reqCharSet=UTF-8',
'refund' => 'https://epay.10010.com/CashierWeb/trade/singleRefund.htm?reqCharSet=UTF-8',
],
'ysd' => [
'order' => env('APP_URL', 'https://card.ysd-bs.com'),

View File

@@ -315,11 +315,15 @@ class Init
parse_str($content, $data);
$this->data = $data;
if ($data['transRet'] != 'SUCCESS') {
$this->code = false;
$this->message = $data['resultDis'];
}
$this->code = true;
} else {
$this->code = false;
$this->message = '接口错误 Post';

View File

@@ -3,6 +3,9 @@
namespace XuanChen\WoUnicom;
use App\Models\Payment;
use App\Models\Welfare;
use App\Models\WelfareOrder;
use App\Models\WelfarePayment;
use Carbon\Carbon;
use XuanChen\WoUnicom\Action\Init;
use XuanChen\WoUnicom\Action\Order;
@@ -78,8 +81,9 @@ class WoUnicom
*/
public function callback($inputs)
{
info('weounicom inputs');
info($inputs);
if (empty($inputs)) {
return '缺少必要参数';
}
$params = str_replace('$', '&', $inputs);
parse_str($params, $data);
@@ -93,6 +97,20 @@ class WoUnicom
//验签成功
if ($res === true) {
//福利订单
if (str_contains($data['orderid'], 'WEAL')) {
$order = WelfareOrder::where('orderid', $data['orderid'])->first();
if ($order && $order->status == 'UNPAY') {
$payment = $order->payment;
$payment->paid([
'type' => 'UNICOM',
'payfloodid' => $data['payfloodid'],
]);
$order->paid();
}
} else {
$order = \App\Models\Order::where('orderid', $data['orderid'])->first();
if ($order && $order->state == 'UNPAY') {
$payment = \App\Models\Payment::where('orderable_type', get_class($order))
@@ -108,6 +126,8 @@ class WoUnicom
$order->paid();
}
}
return 'SUCCESS';
} else {
return '验签失败';