refactor(app): 金佳奇通道支持卡密直充
- 增加了 unLockCardStatus 变量来判断是否需要解锁卡密 - 在获取随机卡密后,根据通道配置选择是否进行解锁 - 优化了卡密解锁失败后的处理逻辑- 新增了卡密解锁成功后的响应数据结构
This commit is contained in:
parent
fbaa8f0208
commit
b8b289c58c
@ -320,9 +320,19 @@ class Jinjiaqi extends Core
|
||||
$randomKami = $KamiService->getData($param['cash'],1, 1, true, false, $this->channel['id'].'00'.$this->product['id']);
|
||||
}
|
||||
}
|
||||
$unLockCardStatus = true;
|
||||
|
||||
if(!$randomKami &&isset($suoka_data['kami_direct_buyback'])){
|
||||
$KamiService = KamiService::instance();
|
||||
$randomKami = $KamiService->getData($param['cash'],1, 1, true, false, $this->channel['id'].'00'.$this->product['id']);
|
||||
$unLockCardStatus = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($randomKami) {
|
||||
if($unLockCardStatus){
|
||||
$LockCardService = LockCardService::instance();
|
||||
|
||||
$unlockcard = $LockCardService->call('UnlockCard', $this->channel['id'],$randomKami['cnum'],$randomKami['cpwd'],$this->product['id'],$randomKami['value']);
|
||||
@ -349,6 +359,27 @@ class Jinjiaqi extends Core
|
||||
'array' => $randomKami_data
|
||||
];
|
||||
}
|
||||
}else{
|
||||
$randomKami_data = [
|
||||
'is_kami' =>1,
|
||||
];
|
||||
|
||||
$msg = 'yescard';
|
||||
$randomKami_data['kami'] = array
|
||||
(
|
||||
'cardno'=>$randomKami['cnum'],
|
||||
'cardpwd'=>$randomKami['cpwd'],
|
||||
'expired'=>$randomKami['expire_time'],
|
||||
'value'=>$randomKami['value'],
|
||||
);
|
||||
$response = [
|
||||
'msg' => $msg,
|
||||
'data' => $randomKami_data,
|
||||
'array' => $randomKami_data
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user