generated from root/miduo_server
多游支付,sign签名补充
parent
4e7189491e
commit
aeddb7e0a1
|
@ -12,6 +12,8 @@ import javax.annotation.Resource;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* 多游游戏支付
|
||||
|
@ -35,7 +37,7 @@ public class DuoYouRechargeController {
|
|||
return "FAIL";
|
||||
}
|
||||
|
||||
String sid = request.getParameter("app_id"); //多游分配的 appId
|
||||
String app_id = request.getParameter("app_id"); //多游分配的 appId
|
||||
String transaction_id = request.getParameter("transaction_id"); //多游订单号
|
||||
String out_trade_no = request.getParameter("out_trade_no"); //游戏厂商订单号
|
||||
String total_fee = request.getParameter("total_fee"); //订单金额(分)
|
||||
|
@ -43,7 +45,13 @@ public class DuoYouRechargeController {
|
|||
String extra = request.getParameter("extra"); //额外参数
|
||||
String sign = request.getParameter("sign"); //签名
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
SortedMap<String, String> map = new TreeMap<>();
|
||||
map.put("app_id",app_id);
|
||||
map.put("transaction_id",transaction_id);
|
||||
map.put("out_trade_no",out_trade_no);
|
||||
map.put("total_fee",total_fee);
|
||||
map.put("payType",payType);
|
||||
map.put("extra",extra);
|
||||
map.put(DuoyouUtils.FIELD_SIGN,sign);
|
||||
|
||||
boolean valid = DuoyouUtils.isSignatureValid(map, APP_ID, APP_KEY);
|
||||
|
@ -52,6 +60,6 @@ public class DuoYouRechargeController {
|
|||
return "FAIL";
|
||||
}
|
||||
|
||||
return payLogic.initOrder(extra,out_trade_no,total_fee,new Date(),sid, PaySdkEnum.DUOYOU);
|
||||
return payLogic.initOrder(extra,out_trade_no,total_fee,new Date(),app_id, PaySdkEnum.DUOYOU);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue