Skip to content

Commit ff7712f

Browse files
committed
update: update demoCode, CR by heyi
1 parent 2ed05cb commit ff7712f

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,15 @@ public class RiskDecideTeeDemoCode {
4747
private static final String GATE_WAY_URL = "";
4848
private static final String merchantPrivateKey = "";
4949
private static final String alipayPublicKey = "";
50-
private static final AlipayClient defaultAlipayClient = new DefaultAlipayClient(GATE_WAY_URL, merchantPrivateKey, alipayPublicKey);
50+
private static final AlipayClient defaultAlipayClient = new DefaultAlipayClient(GATE_WAY_URL, merchantPrivateKey, alipayPublicKey, CLIENT_ID);
51+
5152
private static final String DATA_KEY = "";
5253
public static void main(String[] args) {
5354
preAuthDecide();
5455
}
5556

5657
public static RiskDecideResponse preAuthDecide() {
5758
RiskDecideRequest request = new RiskDecideRequest();
58-
request.setClientId(CLIENT_ID);
59-
request.setPath("/ams/api/v1/risk/privacy/payments/decide");
6059
request.setReferenceTransactionId("test_20231012091493242");
6160
request.setAuthorizationPhase(AuthorizationPhase.PRE_AUTHORIZATION);
6261
// 1. build plaintext request
@@ -77,8 +76,6 @@ public static RiskDecideResponse preAuthDecide() {
7776

7877
public static RiskDecideResponse postAuthDecide() {
7978
RiskDecideRequest request = new RiskDecideRequest();
80-
request.setClientId(CLIENT_ID);
81-
request.setPath("/ams/api/v1/risk/privacy/payments/decide");
8279
request.setReferenceTransactionId("test_20231012091493242");
8380
request.setAuthorizationPhase(AuthorizationPhase.POST_AUTHORIZATION);
8481
// 1. build plaintext request
@@ -129,8 +126,6 @@ public static void encryptRequest(RiskDecideRequest request) throws CryptoExcept
129126

130127
public static SendPaymentResultResponse sendPaymentResult() {
131128
SendPaymentResultRequest request = new SendPaymentResultRequest();
132-
request.setClientId(CLIENT_ID);
133-
request.setPath("/ams/api/v1/risk/privacy/payments/sendPaymentResult");
134129
request.setReferenceTransactionId("test_20231012091493242");
135130

136131
request.setPaymentStatus("SUCCESS");
@@ -156,8 +151,6 @@ public static SendPaymentResultResponse sendPaymentResult() {
156151

157152
public static SendRefundResultResponse sendPaymentRefund() {
158153
SendRefundResultRequest request = new SendRefundResultRequest();
159-
request.setClientId(CLIENT_ID);
160-
request.setPath("/ams/api/v1/risk/privacy/payments/sendRefundResult");
161154
request.setReferenceTransactionId("test_20231012091493242");
162155

163156
SendRefundResultResponse response = null;
@@ -171,8 +164,6 @@ public static SendRefundResultResponse sendPaymentRefund() {
171164

172165
public static RiskReportResponse reportRisk() {
173166
RiskReportRequest request = new RiskReportRequest();
174-
request.setClientId(CLIENT_ID);
175-
request.setPath("/ams/api/v1/risk/privacy/payments/reportRisk");
176167
request.setReferenceTransactionId("test_20231012091493242");
177168
request.setReportReason("test");
178169
request.setRiskType("FRAUD");

0 commit comments

Comments
 (0)