Skip to content

Commit e866a1a

Browse files
committed
Merge branch 'master' into risk_tee
# Conflicts: # pom.xml # src/main/java/com/alipay/global/api/example/RiskDecideTeeDemoCode.java # src/main/java/com/alipay/global/api/request/ams/risk/tee/encryptstrategy/EncryptStrategy.java # src/main/java/com/alipay/global/api/request/ams/risk/tee/encryptutil/RiskDecideEncryptUtil.java # src/main/java/com/alipay/global/api/request/ams/risk/tee/enums/ErrorCodeEnum.java
2 parents ab67947 + 57fe2a1 commit e866a1a

File tree

189 files changed

+1862
-549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+1862
-549
lines changed

CHANGE.log

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,13 @@ add lombok support
102102
add Checkout Payment Page support
103103

104104
30、Version:2.0.29
105-
adding path to request, using lombok for ams api, update sample code
105+
adding path to request, using lombok for ams api, update sample code
106+
107+
31、Version:2.0.32
108+
align antom doc and library
109+
110+
32、Version:2.0.33
111+
add PspCustomerInfo add extendInfo
112+
113+
33、Version:2.0.38
114+
add:ScopeType add TAOBAO_REBIND

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ https://mvnrepository.com/artifact/com.alipay.global.sdk/global-open-sdk-java
1212
<dependency>
1313
<groupId>com.alipay.global.sdk</groupId>
1414
<artifactId>global-open-sdk-java</artifactId>
15-
<version>2.0.30</version>
15+
<version>2.0.38</version>
1616
</dependency>
1717
```
1818

src/main/java/com/alipay/global/api/example/CashierPayDemoCode.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package com.alipay.global.api.example;
22

3-
import java.util.HashMap;
4-
import java.util.Map;
5-
import java.util.UUID;
6-
73
import com.alibaba.fastjson.JSONObject;
84
import com.alipay.global.api.AlipayClient;
95
import com.alipay.global.api.DefaultAlipayClient;
@@ -19,32 +15,36 @@
1915
import com.alipay.global.api.response.ams.pay.AlipayPayResponse;
2016
import com.alipay.global.api.response.ams.pay.AlipayPaymentSessionResponse;
2117

18+
import java.util.HashMap;
19+
import java.util.Map;
20+
import java.util.UUID;
21+
2222
public class CashierPayDemoCode {
2323

2424
/**
2525
* replace with your client id.
2626
* find your client id here: <a href="https://dashboard.alipay.com/global-payments/developers/quickStart">quickStart</a>
2727
*/
28-
public static final String CLIENT_ID = "";
28+
public static final String CLIENT_ID = "";
2929

3030
/**
3131
* replace with your antom public key (used to verify signature).
3232
* find your antom public key here: <a href="https://dashboard.alipay.com/global-payments/developers/quickStart">quickStart</a>
3333
*/
34-
public static final String ANTOM_PUBLIC_KEY = "";
34+
public static final String ANTOM_PUBLIC_KEY = "";
3535

3636
/**
3737
* replace with your private key (used to sign).
3838
* please ensure the secure storage of your private key to prevent leakage
3939
*/
40-
public static final String MERCHANT_PRIVATE_KEY = "";
40+
public static final String MERCHANT_PRIVATE_KEY = "";
4141

4242
/**
4343
* please replace with your endpoint.
4444
* find your endpoint here: <a href="https://dashboard.alipay.com/global-payments/developers/quickStart">quickStart</a>
4545
*/
46-
private final static AlipayClient CLIENT = new DefaultAlipayClient(
47-
EndPointConstants.SG, MERCHANT_PRIVATE_KEY, ANTOM_PUBLIC_KEY, CLIENT_ID);
46+
private final static AlipayClient CLIENT = new DefaultAlipayClient(
47+
EndPointConstants.SG, MERCHANT_PRIVATE_KEY, ANTOM_PUBLIC_KEY, CLIENT_ID);
4848

4949
public static void main(String[] args) {
5050
executeConsult();
@@ -77,7 +77,7 @@ public static void executeConsult() {
7777
}
7878

7979
/**
80-
* show how to finish a payment by Card paymentMethod
80+
* show how to finish a payment by Card paymentMethod
8181
*/
8282
public static void executePayWithCard() {
8383
AlipayPayRequest alipayPayRequest = new AlipayPayRequest();
@@ -106,7 +106,7 @@ public static void executePayWithCard() {
106106

107107
// set paymentMethod
108108
PaymentMethod paymentMethod = PaymentMethod.builder().paymentMethodType("CARD")
109-
.paymentMethodMetaData(paymentMethodMetaData).build();
109+
.paymentMethodMetaData(paymentMethodMetaData).build();
110110
alipayPayRequest.setPaymentMethod(paymentMethod);
111111

112112
// replace with your orderId
@@ -117,12 +117,12 @@ public static void executePayWithCard() {
117117

118118
// set order info
119119
Order order = Order.builder().referenceOrderId(orderId)
120-
.orderDescription("antom testing order").orderAmount(amount).buyer(buyer).build();
120+
.orderDescription("antom testing order").orderAmount(amount).buyer(buyer).build();
121121
alipayPayRequest.setOrder(order);
122122

123123
// set env info
124124
Env env = Env.builder().terminalType(TerminalType.WEB)
125-
.clientIp("1.2.3.4").build();
125+
.clientIp("1.2.3.4").build();
126126
alipayPayRequest.setEnv(env);
127127

128128
// set auth capture payment mode
@@ -146,7 +146,7 @@ public static void executePayWithCard() {
146146
}
147147

148148
/**
149-
* show how to finish a payment by Blik
149+
* show how to finish a payment by Blik
150150
*/
151151
public static void executePayWithBlik() {
152152
AlipayPayRequest alipayPayRequest = new AlipayPayRequest();
@@ -172,12 +172,12 @@ public static void executePayWithBlik() {
172172

173173
// set order info
174174
Order order = Order.builder().referenceOrderId(orderId)
175-
.orderDescription("antom testing order").orderAmount(amount).buyer(buyer).build();
175+
.orderDescription("antom testing order").orderAmount(amount).buyer(buyer).build();
176176
alipayPayRequest.setOrder(order);
177177

178178
// set env info
179179
Env env = Env.builder().terminalType(TerminalType.WEB)
180-
.clientIp("1.2.3.4").build();
180+
.clientIp("1.2.3.4").build();
181181
alipayPayRequest.setEnv(env);
182182

183183
// replace with your notify url
@@ -227,7 +227,7 @@ public static void executePaymentSessionCreateWithCard() {
227227

228228
// set order info
229229
Order order = Order.builder().referenceOrderId(orderId)
230-
.orderDescription("antom testing order").orderAmount(amount).buyer(buyer).build();
230+
.orderDescription("antom testing order").orderAmount(amount).buyer(buyer).build();
231231
alipayPaymentSessionRequest.setOrder(order);
232232

233233
// replace with your notify url
@@ -247,7 +247,7 @@ public static void executePaymentSessionCreateWithCard() {
247247
}
248248

249249
/**
250-
* show how to inquiry PaymentResult
250+
* show how to inquiry PaymentResult
251251
*/
252252
public static void executeInquiry() {
253253
AlipayPayQueryRequest alipayPayQueryRequest = new AlipayPayQueryRequest();

src/main/java/com/alipay/global/api/example/EasyPayDemoCode.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.alipay.global.api.example;
22

3-
import java.util.UUID;
4-
53
import com.alipay.global.api.AlipayClient;
64
import com.alipay.global.api.DefaultAlipayClient;
75
import com.alipay.global.api.exception.AlipayApiException;
@@ -14,32 +12,34 @@
1412
import com.alipay.global.api.request.ams.pay.AlipayPaymentSessionRequest;
1513
import com.alipay.global.api.response.ams.pay.AlipayPaymentSessionResponse;
1614

15+
import java.util.UUID;
16+
1717
public class EasyPayDemoCode {
1818

1919
/**
2020
* replace with your client id.
2121
* find your client id here: <a href="https://dashboard.alipay.com/global-payments/developers/quickStart">quickStart</a>
2222
*/
23-
public static final String CLIENT_ID = "";
23+
public static final String CLIENT_ID = "";
2424

2525
/**
2626
* replace with your antom public key (used to verify signature).
2727
* find your antom public key here: <a href="https://dashboard.alipay.com/global-payments/developers/quickStart">quickStart</a>
2828
*/
29-
public static final String ANTOM_PUBLIC_KEY = "";
29+
public static final String ANTOM_PUBLIC_KEY = "";
3030

3131
/**
3232
* replace with your private key (used to sign).
3333
* please ensure the secure storage of your private key to prevent leakage
3434
*/
35-
public static final String MERCHANT_PRIVATE_KEY = "";
35+
public static final String MERCHANT_PRIVATE_KEY = "";
3636

3737
/**
3838
* please replace with your endpoint.
3939
* find your endpoint here: <a href="https://dashboard.alipay.com/global-payments/developers/quickStart">quickStart</a>
4040
*/
41-
private final static AlipayClient CLIENT = new DefaultAlipayClient(
42-
EndPointConstants.SG, MERCHANT_PRIVATE_KEY, ANTOM_PUBLIC_KEY, CLIENT_ID);
41+
private final static AlipayClient CLIENT = new DefaultAlipayClient(
42+
EndPointConstants.SG, MERCHANT_PRIVATE_KEY, ANTOM_PUBLIC_KEY, CLIENT_ID);
4343

4444
public static void main(String[] args) {
4545
easyPaySession();
@@ -67,7 +67,7 @@ public static void easyPaySession() {
6767

6868
// set order info
6969
Order order = Order.builder().referenceOrderId(orderId)
70-
.orderDescription("antom testing order").orderAmount(amount).build();
70+
.orderDescription("antom testing order").orderAmount(amount).build();
7171
alipayPaymentSessionRequest.setOrder(order);
7272

7373
AlipayPaymentSessionResponse alipayPaymentSessionResponse = null;

src/main/java/com/alipay/global/api/example/RiskDecideDemoCode.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@
44
*/
55
package com.alipay.global.api.example;
66

7-
import java.util.Collections;
8-
import java.util.Date;
9-
107
import com.alipay.global.api.AlipayClient;
118
import com.alipay.global.api.DefaultAlipayClient;
129
import com.alipay.global.api.exception.AlipayApiException;
1310
import com.alipay.global.api.model.ams.*;
1411
import com.alipay.global.api.model.constants.EndPointConstants;
15-
import com.alipay.global.api.model.risk.*;
1612
import com.alipay.global.api.model.risk.Merchant;
1713
import com.alipay.global.api.model.risk.Order;
1814
import com.alipay.global.api.model.risk.PaymentMethod;
15+
import com.alipay.global.api.model.risk.*;
1916
import com.alipay.global.api.request.ams.risk.RiskDecideRequest;
2017
import com.alipay.global.api.request.ams.risk.RiskReportRequest;
2118
import com.alipay.global.api.request.ams.risk.SendPaymentResultRequest;
@@ -25,31 +22,34 @@
2522
import com.alipay.global.api.response.ams.risk.SendPaymentResultResponse;
2623
import com.alipay.global.api.response.ams.risk.SendRefundResultResponse;
2724

25+
import java.util.Collections;
26+
import java.util.Date;
27+
2828
public class RiskDecideDemoCode {
2929
/**
3030
* replace with your client id.
3131
* find your client id here: <a href="https://dashboard.alipay.com/global-payments/developers/quickStart">quickStart</a>
3232
*/
33-
public static final String CLIENT_ID = "";
33+
public static final String CLIENT_ID = "";
3434

3535
/**
3636
* replace with your antom public key (used to verify signature).
3737
* find your antom public key here: <a href="https://dashboard.alipay.com/global-payments/developers/quickStart">quickStart</a>
3838
*/
39-
public static final String ANTOM_PUBLIC_KEY = "";
39+
public static final String ANTOM_PUBLIC_KEY = "";
4040

4141
/**
4242
* replace with your private key (used to sign).
4343
* please ensure the secure storage of your private key to prevent leakage
4444
*/
45-
public static final String MERCHANT_PRIVATE_KEY = "";
45+
public static final String MERCHANT_PRIVATE_KEY = "";
4646

4747
/**
4848
* please replace with your endpoint.
4949
* find your endpoint here: <a href="https://dashboard.alipay.com/global-payments/developers/quickStart">quickStart</a>
5050
*/
51-
private final static AlipayClient CLIENT = new DefaultAlipayClient(
52-
EndPointConstants.SG, MERCHANT_PRIVATE_KEY, ANTOM_PUBLIC_KEY, CLIENT_ID);
51+
private final static AlipayClient CLIENT = new DefaultAlipayClient(
52+
EndPointConstants.SG, MERCHANT_PRIVATE_KEY, ANTOM_PUBLIC_KEY, CLIENT_ID);
5353

5454
public static void main(String[] args) {
5555
preAuthDecide();
@@ -77,15 +77,15 @@ public static RiskDecideResponse postAuthDecide() {
7777
buildRiskDecideRequest(request);
7878
PaymentDetail paymentDetail = request.getPaymentDetails().get(0);
7979
PaymentMethodMetaData paymentMethodMetaData = paymentDetail.getPaymentMethod()
80-
.getPaymentMethodMetaData();
80+
.getPaymentMethodMetaData();
8181
CardVerificationResult cardVerificationResult = new CardVerificationResult();
8282
cardVerificationResult.setAuthenticationType("3D");
8383
cardVerificationResult.setAuthorizationCode("10000");
8484
RiskThreeDSResult riskThreeDSResult = new RiskThreeDSResult();
8585
riskThreeDSResult.setEci("00");
8686
riskThreeDSResult.setThreeDSVersion("2.0");
8787
riskThreeDSResult.setCavv("0");
88-
riskThreeDSResult.setThreeDSInteractionMode("CHALLENGED");
88+
riskThreeDSResult.setThreeDSInteractionMode("CHALLENGE");
8989
cardVerificationResult.setThreeDSResult(riskThreeDSResult);
9090
paymentMethodMetaData.setCardVerificationResult(cardVerificationResult);
9191

@@ -111,7 +111,7 @@ public static SendPaymentResultResponse sendPaymentResult() {
111111
threeDSResult.setEci("05");
112112
threeDSResult.setThreeDSVersion("2.0");
113113
threeDSResult.setCavv("0");
114-
threeDSResult.setThreeDSInteractionMode("CHALLENGED");
114+
threeDSResult.setThreeDSInteractionMode("CHALLENGE");
115115
cardVerificationResult.setThreeDSResult(threeDSResult);
116116
request.setCardVerificationResult(cardVerificationResult);
117117
SendPaymentResultResponse response = null;
@@ -166,7 +166,7 @@ public static void buildRiskDecideRequest(RiskDecideRequest request) {
166166
Goods goods = new Goods();
167167
goods.setReferenceGoodsId("383382011_SGAMZ-904520356");
168168
goods.setGoodsName(
169-
"[3 Boxes] Starbucks Cappuccino Milk Coffee Pods / Coffee Capsules by Nescafe Dolce Gusto");
169+
"[3 Boxes] Starbucks Cappuccino Milk Coffee Pods / Coffee Capsules by Nescafe Dolce Gusto");
170170
goods.setGoodsCategory("Digital Goods/Digital Vouchers/Food and Beverages");
171171
goods.setDeliveryMethodType("DIGITAL");
172172
goods.setGoodsQuantity("1");

src/main/java/com/alipay/global/api/example/RiskDecideTeeDemoCode.java

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,11 @@
77
import com.alipay.global.api.AlipayClient;
88
import com.alipay.global.api.DefaultAlipayClient;
99
import com.alipay.global.api.exception.AlipayApiException;
10-
import com.alipay.global.api.model.ams.Address;
11-
import com.alipay.global.api.model.ams.Amount;
12-
import com.alipay.global.api.model.ams.Buyer;
13-
import com.alipay.global.api.model.ams.CardVerificationResult;
14-
import com.alipay.global.api.model.ams.Env;
15-
import com.alipay.global.api.model.ams.Goods;
16-
import com.alipay.global.api.model.ams.OsType;
17-
import com.alipay.global.api.model.ams.RiskThreeDSResult;
18-
import com.alipay.global.api.model.ams.Shipping;
19-
import com.alipay.global.api.model.ams.TerminalType;
20-
import com.alipay.global.api.model.ams.UserName;
21-
import com.alipay.global.api.model.risk.AuthorizationPhase;
22-
import com.alipay.global.api.model.risk.Order;
23-
import com.alipay.global.api.model.risk.PaymentMethodMetaData;
10+
import com.alipay.global.api.model.ams.*;
2411
import com.alipay.global.api.model.risk.Merchant;
25-
import com.alipay.global.api.model.risk.PaymentDetail;
12+
import com.alipay.global.api.model.risk.Order;
2613
import com.alipay.global.api.model.risk.PaymentMethod;
14+
import com.alipay.global.api.model.risk.*;
2715
import com.alipay.global.api.request.ams.risk.RiskDecideRequest;
2816
import com.alipay.global.api.request.ams.risk.RiskReportRequest;
2917
import com.alipay.global.api.request.ams.risk.SendPaymentResultRequest;
@@ -43,13 +31,14 @@
4331

4432

4533
public class RiskDecideTeeDemoCode {
46-
private static final String CLIENT_ID = "";
47-
private static final String GATE_WAY_URL = "";
48-
private static final String merchantPrivateKey = "";
49-
private static final String alipayPublicKey = "";
34+
private static final String CLIENT_ID = "";
35+
private static final String GATE_WAY_URL = "";
36+
private static final String merchantPrivateKey = "";
37+
private static final String alipayPublicKey = "";
5038
private static final AlipayClient defaultAlipayClient = new DefaultAlipayClient(GATE_WAY_URL, merchantPrivateKey, alipayPublicKey, CLIENT_ID);
5139

52-
private static final String DATA_KEY = "";
40+
private static final String DATA_KEY = "";
41+
5342
public static void main(String[] args) {
5443
preAuthDecide();
5544
}
@@ -89,7 +78,7 @@ public static RiskDecideResponse postAuthDecide() {
8978
riskThreeDSResult.setEci("00");
9079
riskThreeDSResult.setThreeDSVersion("2.0");
9180
riskThreeDSResult.setCavv("0");
92-
riskThreeDSResult.setThreeDSInteractionMode("CHALLENGED");
81+
riskThreeDSResult.setThreeDSInteractionMode("CHALLENGE");
9382
cardVerificationResult.setThreeDSResult(riskThreeDSResult);
9483
paymentMethodMetaData.setCardVerificationResult(cardVerificationResult);
9584
RiskDecideResponse response = null;
@@ -136,7 +125,7 @@ public static SendPaymentResultResponse sendPaymentResult() {
136125
threeDSResult.setEci("05");
137126
threeDSResult.setThreeDSVersion("2.0");
138127
threeDSResult.setCavv("0");
139-
threeDSResult.setThreeDSInteractionMode("CHALLENGED");
128+
threeDSResult.setThreeDSInteractionMode("CHALLENGE");
140129
cardVerificationResult.setThreeDSResult(threeDSResult);
141130
request.setCardVerificationResult(cardVerificationResult);
142131
SendPaymentResultResponse response = null;

0 commit comments

Comments
 (0)