|
|
@@ -4,6 +4,7 @@ namespace liuniu;
|
|
|
|
|
|
use app\admin\model\Company;
|
|
|
use app\admin\model\WechatPlanRecord;
|
|
|
+use app\common\model\LaveMonth;
|
|
|
use app\common\model\WechatContext;
|
|
|
use EasyWeChat\Factory;
|
|
|
use EasyWeChat\Kernel\Messages\Article;
|
|
|
@@ -378,6 +379,18 @@ class WechatService
|
|
|
$wechatContext = WechatContext::create($data, true);
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ if (isset($notify['nonce_str'])) {
|
|
|
+ $cz = LaveMonth::Where(['contract_code' => $notify['nonce_str']])->find();
|
|
|
+ @file_put_contents("quanju.txt", json_encode($cz)."-随机字符搜索\r\n", 8);
|
|
|
+ if (!empty($cz)){
|
|
|
+ $params = [$cid, $notify['nonce_str']];
|
|
|
+ Hook::exec("\\liuniu\\repositories\\PaymentRepositories", "wechat" . ucfirst('MonthLavePay'), $params);
|
|
|
+ }
|
|
|
+ $data = ['eventkey' => 'notify', 'command' => '', 'refreshtime' => time(), 'openid' => $notify['openid'], 'message' => json_encode($notify)];
|
|
|
+ $wechatContext = WechatContext::create($data, true);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
});
|
|
|
$response->send();
|
|
|
}
|
|
|
@@ -569,12 +582,12 @@ class WechatService
|
|
|
* @param array $options
|
|
|
* @return Order
|
|
|
*/
|
|
|
- public static function papPayApply($mch_id,$out_trade_no, $total_fee, $attach, $detail = '', $trade_type = 'PAP', $options = [], $cid = 0,$contract_id='',$body='月捐款')
|
|
|
+ public static function papPayApply($mch_id,$out_trade_no, $total_fee, $attach, $detail = '', $trade_type = 'PAP', $options = [], $cid = 0,$contract_id='',$body='月捐款',$nonce_str='')
|
|
|
{
|
|
|
$total_fee = bcmul($total_fee, 100, 0);
|
|
|
- $order = array_merge(compact('mch_id','out_trade_no', 'total_fee', 'attach', 'detail', 'trade_type','contract_id','body'), $options);
|
|
|
+ $order = array_merge(compact('mch_id','out_trade_no', 'total_fee', 'attach', 'detail', 'trade_type','contract_id','body','nonce_str'), $options);
|
|
|
if ($order['detail'] == '') unset($order['detail']);
|
|
|
-// $order['notify_url']=Request::instance()->domain() . "/api/wechat/notify/" . $cid;
|
|
|
+ $order['notify_url']=Request::instance()->domain() . "/api/wechat/notify/" . $cid;
|
|
|
$result = self::payment(false, $cid)->contract->apply(
|
|
|
$order
|
|
|
);
|