@@ -133,7 +133,7 @@ async fn should_capture_authorized_payment() {
133
133
)
134
134
. await
135
135
. expect ( "Capture payment response" ) ;
136
- assert_eq ! ( response. status, enums:: AttemptStatus :: Charged ) ;
136
+ assert_eq ! ( response. status, enums:: AttemptStatus :: Pending ) ;
137
137
}
138
138
139
139
// Partially captures a payment using the manual capture flow (Non 3DS).
@@ -156,7 +156,7 @@ async fn should_partially_capture_authorized_payment() {
156
156
)
157
157
. await
158
158
. expect ( "Capture payment response" ) ;
159
- assert_eq ! ( response. status, enums:: AttemptStatus :: Charged ) ;
159
+ assert_eq ! ( response. status, enums:: AttemptStatus :: Pending ) ;
160
160
}
161
161
162
162
// Voids a payment using the manual capture flow (Non 3DS).
@@ -207,7 +207,7 @@ async fn should_refund_manually_captured_payment() {
207
207
. unwrap ( ) ;
208
208
assert_eq ! (
209
209
response. response. unwrap( ) . refund_status,
210
- enums:: RefundStatus :: Success ,
210
+ enums:: RefundStatus :: Pending ,
211
211
) ;
212
212
}
213
213
@@ -235,7 +235,7 @@ async fn should_partially_refund_manually_captured_payment() {
235
235
. unwrap ( ) ;
236
236
assert_eq ! (
237
237
response. response. unwrap( ) . refund_status,
238
- enums:: RefundStatus :: Success ,
238
+ enums:: RefundStatus :: Pending ,
239
239
) ;
240
240
}
241
241
@@ -255,7 +255,7 @@ async fn should_make_payment() {
255
255
)
256
256
. await
257
257
. unwrap ( ) ;
258
- assert_eq ! ( authorize_response. status, enums:: AttemptStatus :: Charged ) ;
258
+ assert_eq ! ( authorize_response. status, enums:: AttemptStatus :: Pending ) ;
259
259
}
260
260
261
261
// Refunds a payment using the automatic capture flow (Non 3DS).
@@ -281,7 +281,7 @@ async fn should_refund_auto_captured_payment() {
281
281
. unwrap ( ) ;
282
282
assert_eq ! (
283
283
response. response. unwrap( ) . refund_status,
284
- enums:: RefundStatus :: Success ,
284
+ enums:: RefundStatus :: Pending ,
285
285
) ;
286
286
}
287
287
@@ -308,30 +308,49 @@ async fn should_partially_refund_succeeded_payment() {
308
308
. unwrap ( ) ;
309
309
assert_eq ! (
310
310
refund_response. response. unwrap( ) . refund_status,
311
- enums:: RefundStatus :: Success ,
311
+ enums:: RefundStatus :: Pending ,
312
312
) ;
313
313
}
314
314
315
315
// Creates multiple refunds against a payment using the automatic capture flow (Non 3DS).
316
316
#[ actix_web:: test]
317
317
async fn should_refund_succeeded_payment_multiple_times ( ) {
318
- CONNECTOR
319
- . make_payment_and_multiple_refund (
318
+ let payment_info = AdyenTest :: get_payment_info ( ) ;
319
+ //make a successful payment
320
+ let response = CONNECTOR
321
+ . make_payment (
320
322
AdyenTest :: get_payment_authorize_data (
321
323
"2222400070000005" ,
322
324
"03" ,
323
325
"2030" ,
324
326
"737" ,
325
327
enums:: CaptureMethod :: Automatic ,
326
328
) ,
327
- Some ( types:: RefundsData {
328
- refund_amount : 100 ,
329
- reason : Some ( "CUSTOMER REQUEST" . to_string ( ) ) ,
330
- ..utils:: PaymentRefundType :: default ( ) . 0
331
- } ) ,
332
- AdyenTest :: get_payment_info ( ) ,
329
+ payment_info. clone ( ) ,
333
330
)
334
- . await ;
331
+ . await
332
+ . unwrap ( ) ;
333
+
334
+ //try refund for previous payment
335
+ let transaction_id = utils:: get_connector_transaction_id ( response. response ) . unwrap ( ) ;
336
+ for _x in 0 ..2 {
337
+ let refund_response = CONNECTOR
338
+ . refund_payment (
339
+ transaction_id. clone ( ) ,
340
+ Some ( types:: RefundsData {
341
+ refund_amount : 100 ,
342
+ reason : Some ( "CUSTOMER REQUEST" . to_string ( ) ) ,
343
+ ..utils:: PaymentRefundType :: default ( ) . 0
344
+ } ) ,
345
+ payment_info. clone ( ) ,
346
+ )
347
+ . await
348
+ . unwrap ( ) ;
349
+ assert_eq ! (
350
+ refund_response. response. unwrap( ) . refund_status,
351
+ enums:: RefundStatus :: Pending ,
352
+ ) ;
353
+ }
335
354
}
336
355
337
356
// Cards Negative scenerios
0 commit comments