|
|
|
@@ -71,11 +71,16 @@ public class AliPayApi { |
|
|
|
* @throws UnsupportedEncodingException |
|
|
|
*/ |
|
|
|
public static String getAppAuthUrl(Config config,String callback,String param) throws UnsupportedEncodingException { |
|
|
|
String paramstr = ""; |
|
|
|
//String paramstr = ""; |
|
|
|
//if (!StringUtils.isBlank(param)) { |
|
|
|
// paramstr = "&state="+param; |
|
|
|
//} |
|
|
|
//return "https://openauth.alipay.com/oauth2/appToAppBatchAuth.htm?app_id="+config.appId+"&application_type=TINYAPP,WEBAPP,MOBILEAPP,PUBLICAPP&redirect_uri="+URLEncoder.encode(callback, "utf-8")+paramstr; |
|
|
|
String state = ""; |
|
|
|
if (!StringUtils.isBlank(param)) { |
|
|
|
paramstr = "&state="+param; |
|
|
|
state = param; |
|
|
|
} |
|
|
|
return "https://openauth.alipay.com/oauth2/appToAppBatchAuth.htm?app_id="+config.appId+"&application_type=TINYAPP,WEBAPP,MOBILEAPP,PUBLICAPP&redirect_uri="+URLEncoder.encode(callback, "utf-8")+paramstr; |
|
|
|
return "https://b.alipay.com/page/message/tasksDetail?bizData="+URLEncoder.encode("{\"platformCode\":\"O\",\"taskType\":\"INTERFACE_AUTH\",\"agentOpParam\":{\"redirectUri\":"+callback+",\"appTypes\":\"[\"WEBAPP\"]\",\"isvAppId\":"+config.appId+",\"state\":"+state+"}}"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|