|
@@ -545,6 +545,7 @@ class OrdersController extends BaseController
|
|
public function aliIndex(Request $request)
|
|
public function aliIndex(Request $request)
|
|
{
|
|
{
|
|
if ($params = $this->getPayParams($request)) {
|
|
if ($params = $this->getPayParams($request)) {
|
|
|
|
+ $params['pay_merchant_id'] = $this->ali_pay_merchat_id;
|
|
$params['type'] = 'App';
|
|
$params['type'] = 'App';
|
|
} else {
|
|
} else {
|
|
return response()->error('QAPP_PARAM_ERROR');
|
|
return response()->error('QAPP_PARAM_ERROR');
|
|
@@ -593,7 +594,6 @@ class OrdersController extends BaseController
|
|
$xml = XML::parse(strval($request->getContent()));
|
|
$xml = XML::parse(strval($request->getContent()));
|
|
myLog('wxpay')->info($xml);
|
|
myLog('wxpay')->info($xml);
|
|
if (isset($xml['attach'])) {
|
|
if (isset($xml['attach'])) {
|
|
-
|
|
|
|
$pay_merchant_id = (int) $xml['attach'];
|
|
$pay_merchant_id = (int) $xml['attach'];
|
|
$config = PayMerchantService::findPayConfig($pay_merchant_id);
|
|
$config = PayMerchantService::findPayConfig($pay_merchant_id);
|
|
$app = PayFactory::official($config);
|
|
$app = PayFactory::official($config);
|
|
@@ -619,18 +619,24 @@ class OrdersController extends BaseController
|
|
function aliback(Request $request)
|
|
function aliback(Request $request)
|
|
{
|
|
{
|
|
$param = $request->except('_url');
|
|
$param = $request->except('_url');
|
|
- $app = PayFactory::aliPay();
|
|
|
|
myLog('alipay')->info($param);
|
|
myLog('alipay')->info($param);
|
|
- if ($app->notify($param)) {
|
|
|
|
- if (OrderPaySuccess::handle($param['out_trade_no'], $param['trade_no'])) {
|
|
|
|
- return response('success');
|
|
|
|
- } else {
|
|
|
|
- return response('fail');
|
|
|
|
|
|
+ $trade_no = isset($param['out_trade_no']) ? $param['out_trade_no'] : '';
|
|
|
|
+ if ($trade_no) {
|
|
|
|
+ $order = Order::where('trade_no', $trade_no)->first();
|
|
|
|
+ $pay_merchant_id = $order ? $order->pay_merchant_id : 0;
|
|
|
|
+ $pay_merchant_id = $pay_merchant_id ? $pay_merchant_id : 132;
|
|
|
|
+ $config = PayMerchantService::findAliPayConfig($pay_merchant_id);
|
|
|
|
+ $app = PayFactory::aliPay($config);
|
|
|
|
+ if ($app->notify($param)) {
|
|
|
|
+ if (OrderPaySuccess::handle($param['out_trade_no'], $param['trade_no'])) {
|
|
|
|
+ return response('success');
|
|
|
|
+ } else {
|
|
|
|
+ return response('fail');
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- myLog('alipay')->info('sign fail');
|
|
|
|
- return response('fail');
|
|
|
|
}
|
|
}
|
|
|
|
+ myLog('alipay')->info('sign fail');
|
|
|
|
+ return response('fail');
|
|
}
|
|
}
|
|
|
|
|
|
function wait(Request $request)
|
|
function wait(Request $request)
|