generated from root/miduo_server
增加DNA01支付
parent
1011f99f18
commit
1b63a90b7f
|
@ -0,0 +1,203 @@
|
||||||
|
package com.jmfy.controller;
|
||||||
|
|
||||||
|
import com.jmfy.paramBean.PaySdkEnum;
|
||||||
|
import com.jmfy.util.HttpUtils;
|
||||||
|
import com.jmfy.util.JsonUtil;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 太初行DNA01安卓支付,该渠道安卓和ios要分开参数,比较诡异
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
public class Dna01AdRechargeController {
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(Dna01AdRechargeController.class);
|
||||||
|
private static final String appId = "3";
|
||||||
|
private static final String appKey = "915c3274597aa3edc802a52315ffc48f";
|
||||||
|
|
||||||
|
@RequestMapping(value = "/Dna01AdCallback")
|
||||||
|
public String Dna01Callback(HttpServletRequest request) throws Exception {
|
||||||
|
return process(request,appId,appKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String process(HttpServletRequest request,String appId,String appKey) throws Exception{
|
||||||
|
String result = "FAILURE";
|
||||||
|
|
||||||
|
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap2(request);
|
||||||
|
if (parameterMap.isEmpty()) {
|
||||||
|
LOGGER.error("Dna01Callback request data is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("app_id")){
|
||||||
|
LOGGER.error("Dna01Callback request app_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String appIdFrom = parameterMap.get("app_id");
|
||||||
|
if(appIdFrom == null){
|
||||||
|
LOGGER.error("Dna01Callback request app_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!appIdFrom.equals(appId)){
|
||||||
|
LOGGER.error("Dna01Callback request app_id is not exist channel app_id : " + appIdFrom + "---local app_id : " + appId);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("cp_order_id")){
|
||||||
|
LOGGER.error("Dna01Callback request cp_order_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String cpOrderId = parameterMap.get("cp_order_id");
|
||||||
|
if(cpOrderId == null){
|
||||||
|
LOGGER.error("Dna01Callback request cp_order_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("mem_id")){
|
||||||
|
LOGGER.error("Dna01Callback request mem_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String userId = parameterMap.get("mem_id");
|
||||||
|
if(userId == null){
|
||||||
|
LOGGER.error("Dna01Callback request mem_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("order_id")){
|
||||||
|
LOGGER.error("Dna01Callback request order_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String orderId = parameterMap.get("order_id");
|
||||||
|
if(orderId == null){
|
||||||
|
LOGGER.error("Dna01Callback request orderId is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("orderStatus")){
|
||||||
|
LOGGER.error("Dna01Callback request orderStatus is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String orderStatusStr = parameterMap.get("orderStatus");
|
||||||
|
if(orderStatusStr == null){
|
||||||
|
LOGGER.error("Dna01Callback request orderStatus is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int orderStatus = Integer.parseInt(orderStatusStr);
|
||||||
|
if(!parameterMap.containsKey("pay_time")){
|
||||||
|
LOGGER.error("Dna01Callback request pay_time is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String payTimeStr = parameterMap.get("pay_time");
|
||||||
|
if(payTimeStr == null){
|
||||||
|
LOGGER.error("Dna01Callback request pay_time is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int payTime = Integer.parseInt(payTimeStr);
|
||||||
|
if(!parameterMap.containsKey("product_id")){
|
||||||
|
LOGGER.error("Dna01Callback request product_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String productId = parameterMap.get("product_id");
|
||||||
|
if(productId == null){
|
||||||
|
LOGGER.error("Dna01Callback request orderId is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("product_name")){
|
||||||
|
LOGGER.error("Dna01Callback request product_name is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String productName = parameterMap.get("product_name");
|
||||||
|
if(productName == null){
|
||||||
|
LOGGER.error("Dna01Callback request productName is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("product_price")){
|
||||||
|
LOGGER.error("Dna01Callback request product_price is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String moneyStr = parameterMap.get("product_price");
|
||||||
|
if(moneyStr == null){
|
||||||
|
LOGGER.error("Dna01Callback request product_price is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
float money = Float.parseFloat(moneyStr);
|
||||||
|
if(!parameterMap.containsKey("ext")){
|
||||||
|
LOGGER.error("Dna01Callback request ext is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
//ext参数传用户的uid即可
|
||||||
|
String extInfo = parameterMap.get("ext");
|
||||||
|
if(extInfo == null){
|
||||||
|
LOGGER.error("Dna01Callback request ext is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("sign")){
|
||||||
|
LOGGER.error("Dna01Callback request sign is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String sign = parameterMap.get("sign");
|
||||||
|
if(sign == null){
|
||||||
|
LOGGER.error("Dna01Callback request sign is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
//充值成功
|
||||||
|
if(orderStatus == 1){
|
||||||
|
String inserted = insertOrder(extInfo, productId,"ANDROID",cpOrderId,money);
|
||||||
|
if("SUCCESS".equals(inserted)){
|
||||||
|
result = "SUCCESS";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param roleId
|
||||||
|
* @param itemId
|
||||||
|
* @param type
|
||||||
|
* @param orderNo
|
||||||
|
* @param money
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String insertOrder(String roleId, String itemId,String type,String orderNo,float money) {
|
||||||
|
String ccId = "0";
|
||||||
|
String callbackInfo = roleId + "_" + itemId + "_" +ccId + "_" + type;
|
||||||
|
String amount = String.valueOf( money* 100);
|
||||||
|
Date time = new Date(System.currentTimeMillis());
|
||||||
|
String s = PayLogic.initOrder(callbackInfo, orderNo, amount, time, callbackInfo, PaySdkEnum.DNA01);
|
||||||
|
if ("ORDER_IS_EXIST".equals(s)) {
|
||||||
|
return "SUCCESS";
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) throws IOException {
|
||||||
|
String url = "http://8.154.16.171:9991/delivery/Hb027Callback";
|
||||||
|
Map<String,String> parms = new HashMap<>();
|
||||||
|
String appId = "ae526ad09217c7de12b3130d8ef9c176";
|
||||||
|
String userId = "500360680&";
|
||||||
|
String orderNum = "BR66e267eb47827910994106412";
|
||||||
|
String money = "6.00";
|
||||||
|
String serverId = "10001";
|
||||||
|
String roleId = "10000012";
|
||||||
|
String roleName = "蔚明亮";
|
||||||
|
String extInfo = "11101";
|
||||||
|
String status = "1";
|
||||||
|
String sign = "f1d5c6b9699fa2e8a149a2c2615653d2&sign2=0a71e9b1d5b3f06069a26134e7465888&sign3=b33ebfec1a690a88153b7406420704a0";
|
||||||
|
parms.put("appId",appId);
|
||||||
|
parms.put("userId",userId);
|
||||||
|
parms.put("orderNum",orderNum);
|
||||||
|
parms.put("money",money);
|
||||||
|
parms.put("serverId",serverId);
|
||||||
|
parms.put("roleId",roleId);
|
||||||
|
parms.put("roleName",roleName);
|
||||||
|
parms.put("extInfo",extInfo);
|
||||||
|
parms.put("status",status);
|
||||||
|
parms.put("sign",sign);
|
||||||
|
String r = HttpUtils.doPost(url, parms);
|
||||||
|
System.out.print("------------------" + r);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,250 @@
|
||||||
|
package com.jmfy.controller;
|
||||||
|
|
||||||
|
import com.jmfy.paramBean.PaySdkEnum;
|
||||||
|
import com.jmfy.util.HttpUtils;
|
||||||
|
import com.jmfy.util.JsonUtil;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 太初行DNA01ios支付,该渠道安卓和ios要分开参数,比较诡异
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
public class Dna01IosRechargeController {
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(Dna01AdRechargeController.class);
|
||||||
|
private static final String appId = "4";
|
||||||
|
private static final String appKey = "94b817ed89ffe487fcdd280c35feb7fa";
|
||||||
|
|
||||||
|
@RequestMapping(value = "/Dna01IosCallback")
|
||||||
|
public String Dna01Callback(HttpServletRequest request) throws Exception {
|
||||||
|
return process(request,appId,appKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String process(HttpServletRequest request,String appId,String appKey) throws Exception{
|
||||||
|
String result = "FAILURE";
|
||||||
|
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap2(request);
|
||||||
|
if (parameterMap.isEmpty()) {
|
||||||
|
LOGGER.error("Dna01Callback request data is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("app_id")){
|
||||||
|
LOGGER.error("Dna01Callback request app_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String appIdFrom = parameterMap.get("app_id");
|
||||||
|
if(appIdFrom == null){
|
||||||
|
LOGGER.error("Dna01Callback request app_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!appIdFrom.equals(appId)){
|
||||||
|
LOGGER.error("Dna01Callback request app_id is not exist channel app_id : " + appIdFrom + "---local app_id : " + appId);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("ch_id")){
|
||||||
|
LOGGER.error("Dna01Callback request ch_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String chId = parameterMap.get("ch_id");
|
||||||
|
if(chId == null){
|
||||||
|
LOGGER.error("Dna01Callback request ch_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("ch_order_id")){
|
||||||
|
LOGGER.error("Dna01Callback request ch_order_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String chOrderId = parameterMap.get("ch_order_id");
|
||||||
|
if(chOrderId == null){
|
||||||
|
LOGGER.error("Dna01Callback request ch_order_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("order_id")){
|
||||||
|
LOGGER.error("Dna01Callback request order_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String orderId = parameterMap.get("order_id");
|
||||||
|
if(orderId == null){
|
||||||
|
LOGGER.error("Dna01Callback request orderId is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("cp_order_id")){
|
||||||
|
LOGGER.error("Dna01Callback request cp_order_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String cpOrderId = parameterMap.get("cp_order_id");
|
||||||
|
if(cpOrderId == null){
|
||||||
|
LOGGER.error("Dna01Callback request cp_order_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("mem_id")){
|
||||||
|
LOGGER.error("Dna01Callback request mem_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String userId = parameterMap.get("mem_id");
|
||||||
|
if(userId == null){
|
||||||
|
LOGGER.error("Dna01Callback request mem_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("orderStatus")){
|
||||||
|
LOGGER.error("Dna01Callback request orderStatus is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String orderStatusStr = parameterMap.get("orderStatus");
|
||||||
|
if(orderStatusStr == null){
|
||||||
|
LOGGER.error("Dna01Callback request orderStatus is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int orderStatus = Integer.parseInt(orderStatusStr);
|
||||||
|
if(!parameterMap.containsKey("pay_time")){
|
||||||
|
LOGGER.error("Dna01Callback request pay_time is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String payTimeStr = parameterMap.get("pay_time");
|
||||||
|
if(payTimeStr == null){
|
||||||
|
LOGGER.error("Dna01Callback request pay_time is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int payTime = Integer.parseInt(payTimeStr);
|
||||||
|
if(!parameterMap.containsKey("finish_time")){
|
||||||
|
LOGGER.error("Dna01Callback request finish_time is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String finishTimeStr = parameterMap.get("finish_time");
|
||||||
|
if(finishTimeStr == null){
|
||||||
|
LOGGER.error("Dna01Callback request finish_time is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int finishTime = Integer.parseInt(finishTimeStr);
|
||||||
|
if(!parameterMap.containsKey("product_id")){
|
||||||
|
LOGGER.error("Dna01Callback request product_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String productId = parameterMap.get("product_id");
|
||||||
|
if(productId == null){
|
||||||
|
LOGGER.error("Dna01Callback request orderId is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("product_name")){
|
||||||
|
LOGGER.error("Dna01Callback request product_name is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String productName = parameterMap.get("product_name");
|
||||||
|
if(productName == null){
|
||||||
|
LOGGER.error("Dna01Callback request productName is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("product_price")){
|
||||||
|
LOGGER.error("Dna01Callback request product_price is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String moneyStr = parameterMap.get("product_price");
|
||||||
|
if(moneyStr == null){
|
||||||
|
LOGGER.error("Dna01Callback request product_price is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
float money = Float.parseFloat(moneyStr);
|
||||||
|
if(!parameterMap.containsKey("server_id")){
|
||||||
|
LOGGER.error("Dna01Callback request server_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
//ext参数传用户的uid即可
|
||||||
|
String serverId = parameterMap.get("server_id");
|
||||||
|
if(serverId == null){
|
||||||
|
LOGGER.error("Dna01Callback request server_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("role_id")){
|
||||||
|
LOGGER.error("Dna01Callback request role_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
//ext参数传用户的uid即可
|
||||||
|
String roleId = parameterMap.get("role_id");
|
||||||
|
if(roleId == null){
|
||||||
|
LOGGER.error("Dna01Callback request role_id is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("ext")){
|
||||||
|
LOGGER.error("Dna01Callback request ext is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
//ext参数传用户的uid即可
|
||||||
|
String extInfo = parameterMap.get("ext");
|
||||||
|
if(extInfo == null){
|
||||||
|
LOGGER.error("Dna01Callback request ext is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
if(!parameterMap.containsKey("sign")){
|
||||||
|
LOGGER.error("Dna01Callback request sign is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String sign = parameterMap.get("sign");
|
||||||
|
if(sign == null){
|
||||||
|
LOGGER.error("Dna01Callback request sign is null");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
//充值成功
|
||||||
|
if(orderStatus == 1){
|
||||||
|
String inserted = insertOrder(extInfo, productId,"IOS",cpOrderId,money);
|
||||||
|
if("SUCCESS".equals(inserted)){
|
||||||
|
result = "SUCCESS";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param roleId
|
||||||
|
* @param itemId
|
||||||
|
* @param type
|
||||||
|
* @param orderNo
|
||||||
|
* @param money
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String insertOrder(String roleId, String itemId,String type,String orderNo,float money) {
|
||||||
|
String ccId = "0";
|
||||||
|
String callbackInfo = roleId + "_" + itemId + "_" +ccId + "_" + type;
|
||||||
|
String amount = String.valueOf( money* 100);
|
||||||
|
Date time = new Date(System.currentTimeMillis());
|
||||||
|
String s = PayLogic.initOrder(callbackInfo, orderNo, amount, time, callbackInfo, PaySdkEnum.DNA01);
|
||||||
|
if ("ORDER_IS_EXIST".equals(s)) {
|
||||||
|
return "SUCCESS";
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) throws IOException {
|
||||||
|
String url = "http://8.154.16.171:9991/delivery/Hb027Callback";
|
||||||
|
Map<String,String> parms = new HashMap<>();
|
||||||
|
String appId = "ae526ad09217c7de12b3130d8ef9c176";
|
||||||
|
String userId = "500360680&";
|
||||||
|
String orderNum = "BR66e267eb47827910994106412";
|
||||||
|
String money = "6.00";
|
||||||
|
String serverId = "10001";
|
||||||
|
String roleId = "10000012";
|
||||||
|
String roleName = "蔚明亮";
|
||||||
|
String extInfo = "11101";
|
||||||
|
String status = "1";
|
||||||
|
String sign = "f1d5c6b9699fa2e8a149a2c2615653d2&sign2=0a71e9b1d5b3f06069a26134e7465888&sign3=b33ebfec1a690a88153b7406420704a0";
|
||||||
|
parms.put("appId",appId);
|
||||||
|
parms.put("userId",userId);
|
||||||
|
parms.put("orderNum",orderNum);
|
||||||
|
parms.put("money",money);
|
||||||
|
parms.put("serverId",serverId);
|
||||||
|
parms.put("roleId",roleId);
|
||||||
|
parms.put("roleName",roleName);
|
||||||
|
parms.put("extInfo",extInfo);
|
||||||
|
parms.put("status",status);
|
||||||
|
parms.put("sign",sign);
|
||||||
|
String r = HttpUtils.doPost(url, parms);
|
||||||
|
System.out.print("------------------" + r);
|
||||||
|
}
|
||||||
|
}
|
|
@ -102,26 +102,56 @@ public class VietnamGamotaRechargeController {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
String url = "https://paygate.gamota.com/v1/services/check_transaction?api_key=" +"GMA202401-4B0C8B6C-C3B7290DEC0B";
|
//testF5();
|
||||||
|
testServerList();
|
||||||
|
// String url = "https://paygate.gamota.com/v1/services/check_transaction?api_key=" +"GMA202401-4B0C8B6C-C3B7290DEC0B";
|
||||||
|
// Map<String,String> parms = new HashMap<>();
|
||||||
|
// parms.put("transaction_id","GM250120253748A");
|
||||||
|
// try {
|
||||||
|
// String r = HttpUtils.doPost(url, parms);
|
||||||
|
// System.out.println("越南gamota支付验证" + r);
|
||||||
|
// Gson gson = new Gson();
|
||||||
|
// GamotaObj obj = gson.fromJson(r, GamotaObj.class);
|
||||||
|
// String amount = String.valueOf(Double.parseDouble(obj.getData().get("amount")) * 100);
|
||||||
|
// System.out.println(obj.getError_code() + "----" + Double.parseDouble(obj.getData().get("amount")));
|
||||||
|
// System.out.println("float----" + amount);
|
||||||
|
//// String errorCode = map.get("error_code").toString();
|
||||||
|
//// String data = map.get("data").toString();
|
||||||
|
//// System.out.println(data);
|
||||||
|
//// if (!"0.0".equals(errorCode)){
|
||||||
|
//// System.out.println(errorCode + "----" + errorCode);
|
||||||
|
//// }
|
||||||
|
//// Map<String, Object> map = gson.fromJson(r,Map.class);
|
||||||
|
// }catch (Exception e){
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void testF5(){
|
||||||
|
String url = "https://ms-test.r2games.com/idip/sfzb/pay/f5GetRole";
|
||||||
Map<String,String> parms = new HashMap<>();
|
Map<String,String> parms = new HashMap<>();
|
||||||
parms.put("transaction_id","GM250120253748A");
|
parms.put("appId","GM250120253748A");
|
||||||
|
parms.put("userId","123456");
|
||||||
|
parms.put("osign","uuuuuuu");
|
||||||
try {
|
try {
|
||||||
String r = HttpUtils.doPost(url, parms);
|
String r = HttpUtils.doPost(url, parms);
|
||||||
System.out.println("越南gamota支付验证" + r);
|
System.out.println("-----" + r);
|
||||||
Gson gson = new Gson();
|
|
||||||
GamotaObj obj = gson.fromJson(r, GamotaObj.class);
|
|
||||||
String amount = String.valueOf(Double.parseDouble(obj.getData().get("amount")) * 100);
|
|
||||||
System.out.println(obj.getError_code() + "----" + Double.parseDouble(obj.getData().get("amount")));
|
|
||||||
System.out.println("float----" + amount);
|
|
||||||
// String errorCode = map.get("error_code").toString();
|
|
||||||
// String data = map.get("data").toString();
|
|
||||||
// System.out.println(data);
|
|
||||||
// if (!"0.0".equals(errorCode)){
|
|
||||||
// System.out.println(errorCode + "----" + errorCode);
|
|
||||||
// }
|
|
||||||
// Map<String, Object> map = gson.fromJson(r,Map.class);
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void testServerList(){
|
||||||
|
String url = "http://156.232.100.175:8080/sk_loginserver/getServerList?openId=111&channel=F5&plat=android&sub_channel=2000&server_version=1.2.2";
|
||||||
|
Map<String,String> parms = new HashMap<>();
|
||||||
|
parms.put("openId","GM250120253748A");
|
||||||
|
parms.put("channel","F5");
|
||||||
|
parms.put("sub_channel","2000");
|
||||||
|
try {
|
||||||
|
String r = HttpUtils.httpGetRequest(url);
|
||||||
|
System.out.println(r);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,8 @@ public enum PaySdkEnum {
|
||||||
U1GAME(14, "U1GAME"),
|
U1GAME(14, "U1GAME"),
|
||||||
REBATES(15, "REBATES"),
|
REBATES(15, "REBATES"),
|
||||||
GAMOTA(16, "GAMOTA"),
|
GAMOTA(16, "GAMOTA"),
|
||||||
HB027(17, "HB027")
|
HB027(17, "HB027"),
|
||||||
|
DNA01(18, "DNA01")
|
||||||
;
|
;
|
||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
|
|
Loading…
Reference in New Issue