update 海之农作为兜底子商户
This commit is contained in:
parent
93a43d24a6
commit
02af08f7d8
|
@ -7,6 +7,7 @@ use app\common\logic\PaymentLogic;
|
||||||
use app\common\logic\WechatPayServiceMerchantPaymentLogic;
|
use app\common\logic\WechatPayServiceMerchantPaymentLogic;
|
||||||
use app\common\service\pay\WeChatPayMerchantService;
|
use app\common\service\pay\WeChatPayMerchantService;
|
||||||
use app\common\service\pay\WeChatPayService;
|
use app\common\service\pay\WeChatPayService;
|
||||||
|
use think\Log;
|
||||||
|
|
||||||
class WechatPayServiceMerchantPayController extends BaseApiController
|
class WechatPayServiceMerchantPayController extends BaseApiController
|
||||||
{
|
{
|
||||||
|
@ -18,6 +19,7 @@ class WechatPayServiceMerchantPayController extends BaseApiController
|
||||||
public function appPrePay()
|
public function appPrePay()
|
||||||
{
|
{
|
||||||
$params = $this->request->param();
|
$params = $this->request->param();
|
||||||
|
\think\facade\Log::info(['微信服务商APP支付接收参数', $params]);
|
||||||
//订单信息
|
//订单信息
|
||||||
$order = WechatPayServiceMerchantPaymentLogic::createPayOrder($params);
|
$order = WechatPayServiceMerchantPaymentLogic::createPayOrder($params);
|
||||||
if (false === $order) {
|
if (false === $order) {
|
||||||
|
@ -25,6 +27,7 @@ class WechatPayServiceMerchantPayController extends BaseApiController
|
||||||
}
|
}
|
||||||
//支付流程
|
//支付流程
|
||||||
$result = (new WeChatPayMerchantService())->wechatPayServiceMerchantAppPay($order);
|
$result = (new WeChatPayMerchantService())->wechatPayServiceMerchantAppPay($order);
|
||||||
|
|
||||||
if (false === $result) {
|
if (false === $result) {
|
||||||
return $this->fail((new WeChatPayMerchantService())->getError(), $params);
|
return $this->fail((new WeChatPayMerchantService())->getError(), $params);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,9 @@ class WechatPayServiceMerchantPaymentLogic extends BaseLogic
|
||||||
{
|
{
|
||||||
// 收款账户
|
// 收款账户
|
||||||
$subMerchant = SubMerchant::where(['street' => $params['street']])->find();
|
$subMerchant = SubMerchant::where(['street' => $params['street']])->find();
|
||||||
|
if (empty($subMerchant)){
|
||||||
|
$subMerchant = SubMerchant::where(['sub_merchant_name' => '泸州市海之农科技有限公司'])->find();
|
||||||
|
}
|
||||||
$data = [
|
$data = [
|
||||||
'order_from' => $params['order_from'],
|
'order_from' => $params['order_from'],
|
||||||
'order_type' => $params['order_type'],
|
'order_type' => $params['order_type'],
|
||||||
|
|
|
@ -87,13 +87,14 @@ class WeChatPayMerchantService extends BasePayService
|
||||||
'out_trade_no' => $order['order_no'],
|
'out_trade_no' => $order['order_no'],
|
||||||
'notify_url' => $this->config['notify_url'],
|
'notify_url' => $this->config['notify_url'],
|
||||||
'amount' => [
|
'amount' => [
|
||||||
'total' => intval($order['total_fee']),
|
'total' => intval(bcmul($order['total_fee'], 100,2 )),
|
||||||
'currency' => 'CNY'
|
'currency' => 'CNY'
|
||||||
],
|
],
|
||||||
'attach' => $order['order_no'],
|
'attach' => $order['order_no'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$result = $response->toArray(false);
|
$result = $response->toArray(false);
|
||||||
|
\think\facade\Log::info(['微信服务商APP支付api-微信支付返回值', $result]);
|
||||||
$this->checkResultFail($result);
|
$this->checkResultFail($result);
|
||||||
$re = $this->app->getUtils()->buildAppConfig($result['prepay_id'], $pay['config']['app_id']);
|
$re = $this->app->getUtils()->buildAppConfig($result['prepay_id'], $pay['config']['app_id']);
|
||||||
$re['partnerid'] = $order['collection_account'];
|
$re['partnerid'] = $order['collection_account'];
|
||||||
|
|
Loading…
Reference in New Issue