|
@@ -595,28 +595,34 @@ class WechatService
|
|
|
* @param string $detail
|
|
* @param string $detail
|
|
|
* @param string $trade_type
|
|
* @param string $trade_type
|
|
|
* @param array $options
|
|
* @param array $options
|
|
|
- * @return Order
|
|
|
|
|
*/
|
|
*/
|
|
|
public static function signedOrder($openid, $out_trade_no, $total_fee, $attach, $body,$contract_code, $plan_id,$spbill_create_ip,$detail = '', $trade_type = 'JSAPI', $options = [], $cid = 0,$contract_display_account='')
|
|
public static function signedOrder($openid, $out_trade_no, $total_fee, $attach, $body,$contract_code, $plan_id,$spbill_create_ip,$detail = '', $trade_type = 'JSAPI', $options = [], $cid = 0,$contract_display_account='')
|
|
|
{
|
|
{
|
|
|
$total_fee = bcmul($total_fee, 100, 0);
|
|
$total_fee = bcmul($total_fee, 100, 0);
|
|
|
$timestamp=time();
|
|
$timestamp=time();
|
|
|
$version = '1.0';
|
|
$version = '1.0';
|
|
|
|
|
+ $company = Company::where('id',$cid)->find();
|
|
|
|
|
+ if (empty($company)){
|
|
|
|
|
+ return'企业不存在';
|
|
|
|
|
+ }
|
|
|
// 微信支付配置参数
|
|
// 微信支付配置参数
|
|
|
- $mch_id = "1623907696";
|
|
|
|
|
- $key = "1wm55KpF5tgZFW1TYs6TBX9MWBpI5FmT";
|
|
|
|
|
-
|
|
|
|
|
|
|
+// $mch_id = "1623907696";
|
|
|
|
|
+ $mch_id = $company['pay_weixin_mchid'];
|
|
|
|
|
+// $key = "1wm55KpF5tgZFW1TYs6TBX9MWBpI5FmT";
|
|
|
|
|
+ $key = $company['wechat_encodingaeskey'];
|
|
|
|
|
+ $app_id = $company['wechat_appid'];
|
|
|
// 使用动态时间戳
|
|
// 使用动态时间戳
|
|
|
$current_timestamp = time();
|
|
$current_timestamp = time();
|
|
|
// $contract_code = preg_replace("/[^0-9]/", "", $contract_code);
|
|
// $contract_code = preg_replace("/[^0-9]/", "", $contract_code);
|
|
|
$params = [
|
|
$params = [
|
|
|
- 'appid' => 'wx5681205d1ef4d9d3',
|
|
|
|
|
|
|
+// 'appid' => 'wx5681205d1ef4d9d3',
|
|
|
|
|
+ 'appid' => $app_id,
|
|
|
'mch_id' => $mch_id,
|
|
'mch_id' => $mch_id,
|
|
|
- 'plan_id' => '189172',
|
|
|
|
|
|
|
+ 'plan_id' => $plan_id,
|
|
|
'contract_code' => $contract_code,
|
|
'contract_code' => $contract_code,
|
|
|
'request_serial' => $current_timestamp, // 使用时间戳作为序列号
|
|
'request_serial' => $current_timestamp, // 使用时间戳作为序列号
|
|
|
- 'contract_display_account' => 'sera',
|
|
|
|
|
- 'notify_url' => 'http://red.igxys.com/api/wechat/notify/12',
|
|
|
|
|
|
|
+ 'contract_display_account' => $contract_display_account,
|
|
|
|
|
+ 'notify_url' => 'http://red.igxys.com/api/wechat/notify/'.$cid,
|
|
|
'timestamp' => $current_timestamp, // 动态时间戳
|
|
'timestamp' => $current_timestamp, // 动态时间戳
|
|
|
'version' => '1.0',
|
|
'version' => '1.0',
|
|
|
];
|
|
];
|