Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bdf46a01ec | |||
| a34d344110 | |||
| a60851f892 |
@@ -5,7 +5,7 @@
|
|||||||
"homepage": "http://git.yuzhankeji.cn/xuanchen/WoUnicom.git",
|
"homepage": "http://git.yuzhankeji.cn/xuanchen/WoUnicom.git",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "玄尘",
|
"name": "xuanchen",
|
||||||
"email": "122383162@qq.com"
|
"email": "122383162@qq.com"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ return [
|
|||||||
'uri' => [
|
'uri' => [
|
||||||
'unicom' => [
|
'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' => [
|
'ysd' => [
|
||||||
'order' => env('APP_URL', 'https://card.ysd-bs.com'),
|
'order' => env('APP_URL', 'https://card.ysd-bs.com'),
|
||||||
|
|||||||
@@ -315,11 +315,15 @@ class Init
|
|||||||
|
|
||||||
parse_str($content, $data);
|
parse_str($content, $data);
|
||||||
|
|
||||||
|
$this->data = $data;
|
||||||
|
|
||||||
if ($data['transRet'] != 'SUCCESS') {
|
if ($data['transRet'] != 'SUCCESS') {
|
||||||
$this->code = false;
|
$this->code = false;
|
||||||
$this->message = $data['resultDis'];
|
$this->message = $data['resultDis'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->code = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$this->code = false;
|
$this->code = false;
|
||||||
$this->message = '接口错误 Post';
|
$this->message = '接口错误 Post';
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
namespace XuanChen\WoUnicom;
|
namespace XuanChen\WoUnicom;
|
||||||
|
|
||||||
use App\Models\Payment;
|
use App\Models\Payment;
|
||||||
|
use App\Models\Welfare;
|
||||||
|
use App\Models\WelfareOrder;
|
||||||
|
use App\Models\WelfarePayment;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use XuanChen\WoUnicom\Action\Init;
|
use XuanChen\WoUnicom\Action\Init;
|
||||||
use XuanChen\WoUnicom\Action\Order;
|
use XuanChen\WoUnicom\Action\Order;
|
||||||
@@ -78,8 +81,9 @@ class WoUnicom
|
|||||||
*/
|
*/
|
||||||
public function callback($inputs)
|
public function callback($inputs)
|
||||||
{
|
{
|
||||||
info('weounicom inputs');
|
if (empty($inputs)) {
|
||||||
info($inputs);
|
return '缺少必要参数';
|
||||||
|
}
|
||||||
|
|
||||||
$params = str_replace('$', '&', $inputs);
|
$params = str_replace('$', '&', $inputs);
|
||||||
parse_str($params, $data);
|
parse_str($params, $data);
|
||||||
@@ -93,6 +97,20 @@ class WoUnicom
|
|||||||
//验签成功
|
//验签成功
|
||||||
if ($res === true) {
|
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();
|
$order = \App\Models\Order::where('orderid', $data['orderid'])->first();
|
||||||
if ($order && $order->state == 'UNPAY') {
|
if ($order && $order->state == 'UNPAY') {
|
||||||
$payment = \App\Models\Payment::where('orderable_type', get_class($order))
|
$payment = \App\Models\Payment::where('orderable_type', get_class($order))
|
||||||
@@ -108,6 +126,8 @@ class WoUnicom
|
|||||||
$order->paid();
|
$order->paid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return 'SUCCESS';
|
return 'SUCCESS';
|
||||||
} else {
|
} else {
|
||||||
return '验签失败';
|
return '验签失败';
|
||||||
|
|||||||
Reference in New Issue
Block a user