@@ -47,16 +47,15 @@ public class RiskDecideTeeDemoCode {
47
47
private static final String GATE_WAY_URL = "" ;
48
48
private static final String merchantPrivateKey = "" ;
49
49
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
+
51
52
private static final String DATA_KEY = "" ;
52
53
public static void main (String [] args ) {
53
54
preAuthDecide ();
54
55
}
55
56
56
57
public static RiskDecideResponse preAuthDecide () {
57
58
RiskDecideRequest request = new RiskDecideRequest ();
58
- request .setClientId (CLIENT_ID );
59
- request .setPath ("/ams/api/v1/risk/privacy/payments/decide" );
60
59
request .setReferenceTransactionId ("test_20231012091493242" );
61
60
request .setAuthorizationPhase (AuthorizationPhase .PRE_AUTHORIZATION );
62
61
// 1. build plaintext request
@@ -77,8 +76,6 @@ public static RiskDecideResponse preAuthDecide() {
77
76
78
77
public static RiskDecideResponse postAuthDecide () {
79
78
RiskDecideRequest request = new RiskDecideRequest ();
80
- request .setClientId (CLIENT_ID );
81
- request .setPath ("/ams/api/v1/risk/privacy/payments/decide" );
82
79
request .setReferenceTransactionId ("test_20231012091493242" );
83
80
request .setAuthorizationPhase (AuthorizationPhase .POST_AUTHORIZATION );
84
81
// 1. build plaintext request
@@ -129,8 +126,6 @@ public static void encryptRequest(RiskDecideRequest request) throws CryptoExcept
129
126
130
127
public static SendPaymentResultResponse sendPaymentResult () {
131
128
SendPaymentResultRequest request = new SendPaymentResultRequest ();
132
- request .setClientId (CLIENT_ID );
133
- request .setPath ("/ams/api/v1/risk/privacy/payments/sendPaymentResult" );
134
129
request .setReferenceTransactionId ("test_20231012091493242" );
135
130
136
131
request .setPaymentStatus ("SUCCESS" );
@@ -156,8 +151,6 @@ public static SendPaymentResultResponse sendPaymentResult() {
156
151
157
152
public static SendRefundResultResponse sendPaymentRefund () {
158
153
SendRefundResultRequest request = new SendRefundResultRequest ();
159
- request .setClientId (CLIENT_ID );
160
- request .setPath ("/ams/api/v1/risk/privacy/payments/sendRefundResult" );
161
154
request .setReferenceTransactionId ("test_20231012091493242" );
162
155
163
156
SendRefundResultResponse response = null ;
@@ -171,8 +164,6 @@ public static SendRefundResultResponse sendPaymentRefund() {
171
164
172
165
public static RiskReportResponse reportRisk () {
173
166
RiskReportRequest request = new RiskReportRequest ();
174
- request .setClientId (CLIENT_ID );
175
- request .setPath ("/ams/api/v1/risk/privacy/payments/reportRisk" );
176
167
request .setReferenceTransactionId ("test_20231012091493242" );
177
168
request .setReportReason ("test" );
178
169
request .setRiskType ("FRAUD" );
0 commit comments