v1.1 谷歌支付-vip贵族的chargeRecord加上paymenType和country
This commit is contained in:
@@ -216,8 +216,8 @@ public class IOSPayPlaService extends BaseService {
|
||||
* @return
|
||||
*/
|
||||
public RecordIdVo openVip(VipOpenParams params, UserVipRecord userVipRecord) {
|
||||
ChargeRecord chargeRecord = payCenterService.buildOpenVipChargeRecord(params.getUid(), params.getChargeProd(), params.getPayChannel(),
|
||||
params.getIp(), params.getDeviceInfo(), params.getOpenId());
|
||||
ChargeRecord chargeRecord = payCenterService.buildChargeRecord(Constant.PayBussType.OPEN_VIP, params.getUid(), params.getChargeProd(), params.getPayChannel(),
|
||||
params.getIp(), params.getDeviceInfo(), params.getOpenId(), params.getPaymentType(), params.getCountryCode());
|
||||
try {
|
||||
//写入数据库
|
||||
chargeRecordService.insertChargeRecord(chargeRecord);
|
||||
|
@@ -103,7 +103,7 @@ public class PayCenterService {
|
||||
Long erbanNo, String nick, String openId, String realName, String idCardNum, DeviceInfo deviceInfo, String paymentType, String countryCode) throws Exception {
|
||||
String recordChannel = getChannelUseInRecord(channel);
|
||||
ChargeRecord chargeRecord =
|
||||
buildChargeRecord(uid, chargeProdId, recordChannel, clientIp, chargeProd, openId, deviceInfo, paymentType, countryCode);
|
||||
buildChargeRecord(Constant.PayBussType.charge, uid, chargeProd, recordChannel, clientIp, deviceInfo, openId, paymentType, countryCode);
|
||||
if (isTarotLowChargeAmountOpen()) {
|
||||
chargeRecord.setAmount(chargeRecord.getAmount()/100);
|
||||
}
|
||||
@@ -236,28 +236,15 @@ public class PayCenterService {
|
||||
return weChatResultParam;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建充值记录
|
||||
*
|
||||
* @param uid
|
||||
* @param chargeProdId
|
||||
* @param channel
|
||||
* @param clientIp
|
||||
* @param chargeProd
|
||||
* @param deviceInfo
|
||||
* @param paymentType
|
||||
* @param countryCode
|
||||
* @return
|
||||
*/
|
||||
public ChargeRecord buildChargeRecord(Long uid, String chargeProdId, String channel, String clientIp, ChargeProd chargeProd,
|
||||
String openId, DeviceInfo deviceInfo, String paymentType, String countryCode) {
|
||||
public ChargeRecord buildChargeRecord(Byte type, Long uid, ChargeProd chargeProd, String channel, String clientIp, DeviceInfo deviceInfo,
|
||||
String openId, String paymentType, String countryCode){
|
||||
String chargeRecordId = UUIDUitl.get();
|
||||
ChargeRecord chargeRecord = new ChargeRecord();
|
||||
chargeRecord.setChargeRecordId(chargeRecordId);
|
||||
chargeRecord.setChargeProdId(chargeProdId);
|
||||
chargeRecord.setChargeProdId(chargeProd.getChargeProdId());
|
||||
chargeRecord.setUid(uid);
|
||||
chargeRecord.setChannel(channel);
|
||||
chargeRecord.setBussType(Constant.PayBussType.charge);
|
||||
chargeRecord.setBussType(type);
|
||||
chargeRecord.setChargeStatus(Constant.ChargeRecordStatus.create);
|
||||
|
||||
if (StringUtils.isBlank(chargeProd.getLocalCurrencyCode()) || CurrencyTypeEnum.USD.getValue().equalsIgnoreCase(chargeProd.getLocalCurrencyCode())) {
|
||||
@@ -395,8 +382,8 @@ public class PayCenterService {
|
||||
* @throws Exception
|
||||
*/
|
||||
public Object createOpenVipOrder(Long uid, ChargeProd chargeProd, String channel, String clientIp, UserVipRecord userVipRecord,
|
||||
String realName, String idCardNum, DeviceInfo deviceInfo, String openId) {
|
||||
ChargeRecord chargeRecord = buildOpenVipChargeRecord(uid, chargeProd, channel, clientIp, deviceInfo, openId);
|
||||
String realName, String idCardNum, DeviceInfo deviceInfo, String openId, String paymentType,String countryCode) {
|
||||
ChargeRecord chargeRecord = buildChargeRecord(Constant.PayBussType.OPEN_VIP, uid, chargeProd, channel, clientIp, deviceInfo, openId, paymentType, countryCode);
|
||||
if (isTarotLowChargeAmountOpen()) {
|
||||
chargeRecord.setAmount(chargeRecord.getAmount() / 100);
|
||||
}
|
||||
@@ -420,34 +407,6 @@ public class PayCenterService {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成开通贵族充值订单
|
||||
* @return
|
||||
*/
|
||||
public ChargeRecord buildOpenVipChargeRecord(Long uid, ChargeProd chargeProd, String channel, String clientIp, DeviceInfo deviceInfo, String openId) {
|
||||
String chargeRecordId = UUIDUitl.get();
|
||||
ChargeRecord chargeRecord = new ChargeRecord();
|
||||
chargeRecord.setChargeRecordId(chargeRecordId);
|
||||
chargeRecord.setChargeProdId(chargeProd.getChargeProdId());
|
||||
chargeRecord.setUid(uid);
|
||||
chargeRecord.setChannel(channel);
|
||||
chargeRecord.setBussType(Constant.PayBussType.OPEN_VIP);
|
||||
chargeRecord.setChargeStatus(Constant.ChargeRecordStatus.create);
|
||||
chargeRecord.setWxPubOpenid(openId);
|
||||
chargeRecord.setAmount(chargeProd.getMoney());
|
||||
String body = chargeProd.getProdName();
|
||||
String subject = chargeProd.getProdName();
|
||||
chargeRecord.setSubject(subject);
|
||||
chargeRecord.setBody(body);
|
||||
chargeRecord.setClientIp(clientIp);
|
||||
chargeRecord.setCreateTime(Calendar.getInstance().getTime());
|
||||
if (deviceInfo != null) {
|
||||
chargeRecord.setClientDeviceId(deviceInfo.getDeviceId());
|
||||
chargeRecord.setChargeApp(deviceInfo.getApp());
|
||||
}
|
||||
return chargeRecord;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断是否开启了低价充值开关
|
||||
|
@@ -45,4 +45,6 @@ public class VipOpenParams {
|
||||
@ApiModelProperty("开通贵族产品信息")
|
||||
private ChargeProd chargeProd;
|
||||
private String openId;
|
||||
private String paymentType;
|
||||
private String countryCode;
|
||||
}
|
||||
|
Reference in New Issue
Block a user