Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
4bc543cf
Commit
4bc543cf
authored
Oct 15, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增转账接口
parent
80bf3a92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
OrderPayBiz.java
...ain/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
+43
-0
UserInfoController.java
...xfc/platform/universal/controller/UserInfoController.java
+11
-0
No files found.
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
View file @
4bc543cf
...
...
@@ -16,6 +16,7 @@ import com.github.wxiaoqi.security.common.exception.BaseException;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.HTTPSUtils
;
import
com.github.wxiaoqi.security.common.util.OrderUtil
;
import
com.github.wxiaoqi.security.common.util.UUIDUtils
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.SystemConfig
;
import
com.github.wxiaoqi.security.common.util.result.JsonResultUtil
;
...
...
@@ -478,6 +479,48 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> implements In
}
public
String
generateAliPayInfo
(
String
apiName
,
String
appName
)
{
//apiname=com.alipay.account.auth&app_id=xxxxx&app_name=mc&auth_type=AUTHACCOUNT&biz_type=openservice&method=alipay.open.auth.sdk.code.get&pid=xxxxx&product_id=APP_FAST_LOGIN&scope=kuaijie&sign_type=RSA2&target_id=20141225xxxx&sign=fMcp4GtiM6rxSIeFnJCVePJKV43eXrUP86CQgiLhDHH2u%2FdN75eEvmywc2ulkm7qKRetkU9fbVZtJIqFdMJcJ9Yp%2BJI%2FF%2FpESafFR6rB2fRjiQQLGXvxmDGVMjPSxHxVtIqpZy5FDoKUSjQ2%2FILDKpu3%2F%2BtAtm2jRw1rUoMhgt0%3D
StringBuilder
stringBuilder
=
new
StringBuilder
();
stringBuilder
.
append
(
"apiname="
);
stringBuilder
.
append
(
apiName
);
stringBuilder
.
append
(
"&app_id="
);
stringBuilder
.
append
(
SystemConfig
.
ALIPAY_APPID
);
stringBuilder
.
append
(
"&app_name="
);
stringBuilder
.
append
(
appName
);
stringBuilder
.
append
(
"&auth_type=AUTHACCOUNT"
);
stringBuilder
.
append
(
"&biz_type=openservice"
);
stringBuilder
.
append
(
"&method=alipay.open.auth.sdk.code.get"
);
stringBuilder
.
append
(
"&pid="
);
stringBuilder
.
append
(
SystemConfig
.
ALIPAY_PID
);
stringBuilder
.
append
(
"&product_id=APP_FAST_LOGIN"
);
stringBuilder
.
append
(
"&scope=kuaijie"
);
stringBuilder
.
append
(
"&sign_type=RSA2"
);
stringBuilder
.
append
(
"&target_id="
);
stringBuilder
.
append
(
UUIDUtils
.
generateShortUuid
());
stringBuilder
.
append
(
"&sign="
);
return
stringBuilder
.
toString
();
}
public
String
alipayUserAuth
()
throws
AlipayApiException
{
AlipayClient
alipayClient
=
getAlipayClient
();
AlipayUserInfoAuthRequest
request
=
new
AlipayUserInfoAuthRequest
();
request
.
setBizContent
(
"{"
+
" \"scopes\":["
+
" \"auth_base\""
+
" ],"
+
"\"state\":\"init\","
+
"\"is_mobile\":\"true\""
+
" }"
);
AlipayUserInfoAuthResponse
response
=
alipayClient
.
execute
(
request
);
if
(
response
.
isSuccess
()){
System
.
out
.
println
(
"调用成功"
);
}
else
{
System
.
out
.
println
(
"调用失败"
);
}
return
response
.
getBody
();
}
//解冻预授权
public
void
fundAuthOrderUnFreeze
(
AlipayClient
alipayClient
)
throws
AlipayApiException
{
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/UserInfoController.java
View file @
4bc543cf
...
...
@@ -66,5 +66,16 @@ public class UserInfoController {
return
ObjectRestResponse
.
createDefaultFail
();
}
@GetMapping
(
"/app/unauth/alipayUserAuth"
)
public
ObjectRestResponse
<
String
>
alipayUserAuth
()
{
try
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
orderPayBiz
.
alipayUserAuth
());
return
ObjectRestResponse
.
succ
(
jsonObject
);
}
catch
(
AlipayApiException
e
)
{
e
.
printStackTrace
();
}
return
ObjectRestResponse
.
createDefaultFail
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment