|
@@ -6,7 +6,7 @@ require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
|
|
|
|
|
|
use rbridge\IBridge;
|
|
|
use rbridge\wsd\config;
|
|
|
-use refill\RefillFactory;
|
|
|
+use refill;
|
|
|
use refill_proxy;
|
|
|
use Log;
|
|
|
use member_info;
|
|
@@ -39,13 +39,21 @@ class Bridge implements IBridge
|
|
|
$mchinfo = Model('merchant')->getMerchantInfo(['mchid' => $mchid]);
|
|
|
$userid = intval($mchinfo['admin_id']);
|
|
|
|
|
|
- $idcard = '';
|
|
|
- $card_name = '';
|
|
|
+ $input = [ 'mchid' => $mchid,
|
|
|
+ 'buyer_id' => $userid,
|
|
|
+ 'amount' => $params['chargeCash'],
|
|
|
+ 'card_no' => $params['chargeAcct'],
|
|
|
+ 'mch_order' => $params['chargeId'],
|
|
|
+ 'notify_url' => config::MCH_NOTIFY_URL];
|
|
|
|
|
|
- [$code, $msg] = RefillFactory::instance()->add($mchid, $userid, $params['chargeCash'], $params['chargeAcct'], $params['chargeId'],
|
|
|
- $idcard, $card_name,config::MCH_NOTIFY_URL,1,time(),0);
|
|
|
+ $code = refill\util::push_add($input);
|
|
|
+ if($code) {
|
|
|
+ $ret = $this->retbody($code, '提交成功', $params);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $ret = $this->retbody($code, '提交失败', $params);
|
|
|
+ }
|
|
|
|
|
|
- $ret = $this->retbody($code, $msg, $params);
|
|
|
return json_encode($ret,JSON_UNESCAPED_UNICODE);
|
|
|
}
|
|
|
|