|
|
@@ -12,6 +12,7 @@ import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
|
|
|
import com.cyksj.common.util.Jsons;
|
|
|
import com.cyksj.mapper.*;
|
|
|
+import com.cyksj.model.dto.GptCardTokenDto;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.response.recharge.CdkValidateResponse;
|
|
|
import com.cyksj.model.response.recharge.RechargeResponse;
|
|
|
@@ -141,6 +142,16 @@ public class GuofenzaixianRechargeServiceImpl implements GuofenzaixianRechargeSe
|
|
|
|
|
|
RechargeResponse rechargeResponse = Jsons.parseObject(body, RechargeResponse.class);
|
|
|
Boolean success = rechargeResponse.getData().getSuccess();
|
|
|
+ //这渠道会有几率成功 返回失败
|
|
|
+ //查询卡密状态兜底
|
|
|
+ if (!success) {
|
|
|
+ CdkValidateResponse cdkValidateResponse = validateCardKey(cardKey, accessToken);
|
|
|
+ GptCardTokenDto gptCardTokenDto = Jsons.parseObject(accessToken, GptCardTokenDto.class);
|
|
|
+ //卡密已使用 并且是当前账号
|
|
|
+ if ("used".equals(cdkValidateResponse.getData().getStatus()) && gptCardTokenDto.getUser().getEmail().equals(cdkValidateResponse.getEmail())) {
|
|
|
+ return Boolean.TRUE;
|
|
|
+ }
|
|
|
+ }
|
|
|
return success;
|
|
|
|
|
|
} catch (Exception e) {
|