作者 Cool
1 个管道 的构建 通过 耗费 0 秒

支付调试

@@ -1058,26 +1058,26 @@ class Store extends Api @@ -1058,26 +1058,26 @@ class Store extends Api
1058 $deposit = $this->deposit_model->findOrFail(['id'=>$param['deposit_id']]); 1058 $deposit = $this->deposit_model->findOrFail(['id'=>$param['deposit_id']]);
1059 $order_sn = $param['order_sn'] = get_order_sn(); 1059 $order_sn = $param['order_sn'] = get_order_sn();
1060 $pay_data = []; 1060 $pay_data = [];
1061 - // 获取小程序配置 1061 + // 获取配置
1062 $app = new Application(ConfigService::load()); 1062 $app = new Application(ConfigService::load());
1063 $payment = $app->payment; 1063 $payment = $app->payment;
1064 // 获取支付参数 1064 // 获取支付参数
1065 $attributes = [ 1065 $attributes = [
1066 'trade_type' => 'JSAPI', // 请对应换成你的支付方式对应的值类型 1066 'trade_type' => 'JSAPI', // 请对应换成你的支付方式对应的值类型
1067 - 'body' => '板币充值', 1067 + 'body' => '发布招募合伙人',
1068 'out_trade_no' => $order_sn, 1068 'out_trade_no' => $order_sn,
1069 'total_fee' => 1, // $param['money'] * 100 1069 'total_fee' => 1, // $param['money'] * 100
1070 'spbill_create_ip' => request()->ip(), // 可选,如不传该参数,SDK 将会自动获取相应 IP 地址 1070 'spbill_create_ip' => request()->ip(), // 可选,如不传该参数,SDK 将会自动获取相应 IP 地址
1071 - 'notify_url' => url('index/ajax/notify',[],true,true), // 支付结果通知网址,如果不设置则会使用配置里的默认地址 1071 + 'notify_url' => url('index/ajax/store_order_notify',[],true,true), // 支付结果通知网址,如果不设置则会使用配置里的默认地址
1072 'openid' => Db::name('third')->where('user_id',$this->auth->id)->value('openid'), 1072 'openid' => Db::name('third')->where('user_id',$this->auth->id)->value('openid'),
1073 ]; 1073 ];
1074 $order = new Order($attributes); 1074 $order = new Order($attributes);
1075 - $order_result = $payment->pay($order); 1075 + $order_result = $payment->prepare($order);
1076 if($order_result['return_code'] == 'SUCCESS' && $order_result['result_code'] == 'SUCCESS') { 1076 if($order_result['return_code'] == 'SUCCESS' && $order_result['result_code'] == 'SUCCESS') {
1077 $prepayId = $order_result->prepay_id; 1077 $prepayId = $order_result->prepay_id;
1078 - $pay_data = $payment->configForJSSDKPayment($prepayId); // 返回数组 1078 + $pay_data = $payment->configForJSSDKPayment($prepayId);
1079 } else { 1079 } else {
1080 - $this->error($order_result['return_msg'],[$attributes,$order,$order_result]); 1080 + $this->error($order_result['return_msg']);
1081 } 1081 }
1082 $model = $this->deposit_order_model; 1082 $model = $this->deposit_order_model;
1083 Db::startTrans(); 1083 Db::startTrans();