Skip to content

Commit edd70a8

Browse files
authored
Merge pull request #33 from alipay/feature_align_doc_fields
Feature align doc fields
2 parents bdd75a4 + c04b270 commit edd70a8

File tree

188 files changed

+1818
-564
lines changed

Some content is hidden

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

188 files changed

+1818
-564
lines changed

CHANGE.log

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,7 @@ 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

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.32</version>
1616
</dependency>
1717
```
1818

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.alipay.global.sdk</groupId>
55
<artifactId>global-open-sdk-java</artifactId>
66
<packaging>jar</packaging>
7-
<version>2.0.31</version>
7+
<version>2.0.32</version>
88
<name>global-open-sdk-java</name>
99
<url>https://github.com/alipay/global-open-sdk-java</url>
1010
<description>

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: 14 additions & 14 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,10 +166,10 @@ 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");
172-
goods.setGoodsQuantity("1");
172+
goods.setGoodsQuantity(1);
173173
Amount goodsAmount = new Amount();
174174
goodsAmount.setValue("30000");
175175
goodsAmount.setCurrency("BRL");

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

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,22 @@
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;
3018
import com.alipay.global.api.request.ams.risk.SendRefundResultRequest;
19+
import com.alipay.global.api.request.ams.risk.tee.encryptstrategy.RiskDecideEncryptStrategy;
20+
import com.alipay.global.api.request.ams.risk.tee.enums.EncryptKeyEnum;
3121
import com.alipay.global.api.request.ams.risk.tee.exception.CryptoException;
3222
import com.alipay.global.api.response.ams.risk.RiskDecideResponse;
3323
import com.alipay.global.api.response.ams.risk.RiskReportResponse;
3424
import com.alipay.global.api.response.ams.risk.SendPaymentResultResponse;
3525
import com.alipay.global.api.response.ams.risk.SendRefundResultResponse;
36-
import com.alipay.global.api.request.ams.risk.tee.encryptstrategy.RiskDecideEncryptStrategy;
37-
import com.alipay.global.api.request.ams.risk.tee.enums.EncryptKeyEnum;
3826

3927
import java.util.Arrays;
4028
import java.util.Collections;
@@ -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;
@@ -137,7 +126,7 @@ public static SendPaymentResultResponse sendPaymentResult() {
137126
threeDSResult.setEci("05");
138127
threeDSResult.setThreeDSVersion("2.0");
139128
threeDSResult.setCavv("0");
140-
threeDSResult.setThreeDSInteractionMode("CHALLENGED");
129+
threeDSResult.setThreeDSInteractionMode("CHALLENGE");
141130
cardVerificationResult.setThreeDSResult(threeDSResult);
142131
request.setCardVerificationResult(cardVerificationResult);
143132
SendPaymentResultResponse response = null;
@@ -195,7 +184,7 @@ private static void buildRiskDecideRequest(RiskDecideRequest request) {
195184
goods.setGoodsName("[3 Boxes] Starbucks Cappuccino Milk Coffee Pods / Coffee Capsules by Nescafe Dolce Gusto");
196185
goods.setGoodsCategory("Digital Goods/Digital Vouchers/Food and Beverages");
197186
goods.setDeliveryMethodType("DIGITAL");
198-
goods.setGoodsQuantity("1");
187+
goods.setGoodsQuantity(1);
199188
Amount goodsAmount = new Amount();
200189
goodsAmount.setValue("30000");
201190
goodsAmount.setCurrency("BRL");

0 commit comments

Comments
 (0)