172
172
fn get_request_body (
173
173
& self ,
174
174
req : & types:: SetupMandateRouterData ,
175
+ _connectors : & settings:: Connectors ,
175
176
) -> CustomResult < Option < types:: RequestBody > , errors:: ConnectorError > {
176
177
let authorize_req = types:: PaymentsAuthorizeRouterData :: from ( (
177
178
req,
203
204
. url ( & types:: SetupMandateType :: get_url ( self , req, connectors) ?)
204
205
. attach_default_headers ( )
205
206
. headers ( types:: SetupMandateType :: get_headers ( self , req, connectors) ?)
206
- . body ( types:: SetupMandateType :: get_request_body ( self , req) ?)
207
+ . body ( types:: SetupMandateType :: get_request_body (
208
+ self , req, connectors,
209
+ ) ?)
207
210
. build ( ) ,
208
211
) )
209
212
}
306
309
fn get_request_body (
307
310
& self ,
308
311
req : & types:: PaymentsCaptureRouterData ,
312
+ _connectors : & settings:: Connectors ,
309
313
) -> CustomResult < Option < types:: RequestBody > , errors:: ConnectorError > {
310
314
let connector_router_data = adyen:: AdyenRouterData :: try_from ( (
311
315
& self . get_currency_unit ( ) ,
334
338
. headers ( types:: PaymentsCaptureType :: get_headers (
335
339
self , req, connectors,
336
340
) ?)
337
- . body ( types:: PaymentsCaptureType :: get_request_body ( self , req) ?)
341
+ . body ( types:: PaymentsCaptureType :: get_request_body (
342
+ self , req, connectors,
343
+ ) ?)
338
344
. build ( ) ,
339
345
) )
340
346
}
398
404
fn get_request_body (
399
405
& self ,
400
406
req : & types:: RouterData < api:: PSync , types:: PaymentsSyncData , types:: PaymentsResponseData > ,
407
+ _connectors : & settings:: Connectors ,
401
408
) -> CustomResult < Option < types:: RequestBody > , errors:: ConnectorError > {
402
409
// Adyen doesn't support PSync flow. We use PSync flow to fetch payment details,
403
410
// specifically the redirect URL that takes the user to their Payment page. In non-redirection flows,
@@ -482,15 +489,17 @@ impl
482
489
req : & types:: RouterData < api:: PSync , types:: PaymentsSyncData , types:: PaymentsResponseData > ,
483
490
connectors : & settings:: Connectors ,
484
491
) -> CustomResult < Option < services:: Request > , errors:: ConnectorError > {
485
- let request_body = self . get_request_body ( req) ?;
492
+ let request_body = self . get_request_body ( req, connectors ) ?;
486
493
match request_body {
487
494
Some ( _) => Ok ( Some (
488
495
services:: RequestBuilder :: new ( )
489
496
. method ( services:: Method :: Post )
490
497
. url ( & types:: PaymentsSyncType :: get_url ( self , req, connectors) ?)
491
498
. attach_default_headers ( )
492
499
. headers ( types:: PaymentsSyncType :: get_headers ( self , req, connectors) ?)
493
- . body ( types:: PaymentsSyncType :: get_request_body ( self , req) ?)
500
+ . body ( types:: PaymentsSyncType :: get_request_body (
501
+ self , req, connectors,
502
+ ) ?)
494
503
. build ( ) ,
495
504
) ) ,
496
505
None => Ok ( None ) ,
632
641
fn get_request_body (
633
642
& self ,
634
643
req : & types:: PaymentsAuthorizeRouterData ,
644
+ _connectors : & settings:: Connectors ,
635
645
) -> CustomResult < Option < types:: RequestBody > , errors:: ConnectorError > {
636
646
let connector_router_data = adyen:: AdyenRouterData :: try_from ( (
637
647
& self . get_currency_unit ( ) ,
664
674
. headers ( types:: PaymentsAuthorizeType :: get_headers (
665
675
self , req, connectors,
666
676
) ?)
667
- . body ( types:: PaymentsAuthorizeType :: get_request_body ( self , req) ?)
677
+ . body ( types:: PaymentsAuthorizeType :: get_request_body (
678
+ self , req, connectors,
679
+ ) ?)
668
680
. build ( ) ,
669
681
) )
670
682
}
752
764
fn get_request_body (
753
765
& self ,
754
766
req : & types:: PaymentsBalanceRouterData ,
767
+ _connectors : & settings:: Connectors ,
755
768
) -> CustomResult < Option < types:: RequestBody > , errors:: ConnectorError > {
756
769
let connector_req = adyen:: AdyenBalanceRequest :: try_from ( req) ?;
757
770
776
789
. headers ( types:: PaymentsBalanceType :: get_headers (
777
790
self , req, connectors,
778
791
) ?)
779
- . body ( types:: PaymentsBalanceType :: get_request_body ( self , req) ?)
792
+ . body ( types:: PaymentsBalanceType :: get_request_body (
793
+ self , req, connectors,
794
+ ) ?)
780
795
. build ( ) ,
781
796
) )
782
797
}
845
860
fn get_request_body (
846
861
& self ,
847
862
req : & types:: PaymentsCancelRouterData ,
863
+ _connectors : & settings:: Connectors ,
848
864
) -> CustomResult < Option < types:: RequestBody > , errors:: ConnectorError > {
849
865
let connector_req = adyen:: AdyenCancelRequest :: try_from ( req) ?;
850
866
866
882
. url ( & types:: PaymentsVoidType :: get_url ( self , req, connectors) ?)
867
883
. attach_default_headers ( )
868
884
. headers ( types:: PaymentsVoidType :: get_headers ( self , req, connectors) ?)
869
- . body ( types:: PaymentsVoidType :: get_request_body ( self , req) ?)
885
+ . body ( types:: PaymentsVoidType :: get_request_body (
886
+ self , req, connectors,
887
+ ) ?)
870
888
. build ( ) ,
871
889
) )
872
890
}
@@ -955,6 +973,7 @@ impl services::ConnectorIntegration<api::PoCancel, types::PayoutsData, types::Pa
955
973
fn get_request_body (
956
974
& self ,
957
975
req : & types:: PayoutsRouterData < api:: PoCancel > ,
976
+ _connectors : & settings:: Connectors ,
958
977
) -> CustomResult < Option < types:: RequestBody > , errors:: ConnectorError > {
959
978
let connector_req = adyen:: AdyenPayoutCancelRequest :: try_from ( req) ?;
960
979
let adyen_req = types:: RequestBody :: log_and_get_request_body (
@@ -975,7 +994,9 @@ impl services::ConnectorIntegration<api::PoCancel, types::PayoutsData, types::Pa
975
994
. url ( & types:: PayoutCancelType :: get_url ( self , req, connectors) ?)
976
995
. attach_default_headers ( )
977
996
. headers ( types:: PayoutCancelType :: get_headers ( self , req, connectors) ?)
978
- . body ( types:: PayoutCancelType :: get_request_body ( self , req) ?)
997
+ . body ( types:: PayoutCancelType :: get_request_body (
998
+ self , req, connectors,
999
+ ) ?)
979
1000
. build ( ) ;
980
1001
981
1002
Ok ( Some ( request) )
@@ -1040,6 +1061,7 @@ impl services::ConnectorIntegration<api::PoCreate, types::PayoutsData, types::Pa
1040
1061
fn get_request_body (
1041
1062
& self ,
1042
1063
req : & types:: PayoutsRouterData < api:: PoCreate > ,
1064
+ _connectors : & settings:: Connectors ,
1043
1065
) -> CustomResult < Option < types:: RequestBody > , errors:: ConnectorError > {
1044
1066
let connector_router_data = adyen:: AdyenRouterData :: try_from ( (
1045
1067
& self . get_currency_unit ( ) ,
@@ -1066,7 +1088,9 @@ impl services::ConnectorIntegration<api::PoCreate, types::PayoutsData, types::Pa
1066
1088
. url ( & types:: PayoutCreateType :: get_url ( self , req, connectors) ?)
1067
1089
. attach_default_headers ( )
1068
1090
. headers ( types:: PayoutCreateType :: get_headers ( self , req, connectors) ?)
1069
- . body ( types:: PayoutCreateType :: get_request_body ( self , req) ?)
1091
+ . body ( types:: PayoutCreateType :: get_request_body (
1092
+ self , req, connectors,
1093
+ ) ?)
1070
1094
. build ( ) ;
1071
1095
1072
1096
Ok ( Some ( request) )
@@ -1132,6 +1156,7 @@ impl
1132
1156
fn get_request_body (
1133
1157
& self ,
1134
1158
req : & types:: PayoutsRouterData < api:: PoEligibility > ,
1159
+ _connectors : & settings:: Connectors ,
1135
1160
) -> CustomResult < Option < types:: RequestBody > , errors:: ConnectorError > {
1136
1161
let connector_router_data = adyen:: AdyenRouterData :: try_from ( (
1137
1162
& self . get_currency_unit ( ) ,
@@ -1162,7 +1187,9 @@ impl
1162
1187
. headers ( types:: PayoutEligibilityType :: get_headers (
1163
1188
self , req, connectors,
1164
1189
) ?)
1165
- . body ( types:: PayoutEligibilityType :: get_request_body ( self , req) ?)
1190
+ . body ( types:: PayoutEligibilityType :: get_request_body (
1191
+ self , req, connectors,
1192
+ ) ?)
1166
1193
. build ( ) ;
1167
1194
1168
1195
Ok ( Some ( request) )
@@ -1241,6 +1268,7 @@ impl services::ConnectorIntegration<api::PoFulfill, types::PayoutsData, types::P
1241
1268
fn get_request_body (
1242
1269
& self ,
1243
1270
req : & types:: PayoutsRouterData < api:: PoFulfill > ,
1271
+ _connectors : & settings:: Connectors ,
1244
1272
) -> CustomResult < Option < types:: RequestBody > , errors:: ConnectorError > {
1245
1273
let connector_router_data = adyen:: AdyenRouterData :: try_from ( (
1246
1274
& self . get_currency_unit ( ) ,
@@ -1269,7 +1297,9 @@ impl services::ConnectorIntegration<api::PoFulfill, types::PayoutsData, types::P
1269
1297
. headers ( types:: PayoutFulfillType :: get_headers (
1270
1298
self , req, connectors,
1271
1299
) ?)
1272
- . body ( types:: PayoutFulfillType :: get_request_body ( self , req) ?)
1300
+ . body ( types:: PayoutFulfillType :: get_request_body (
1301
+ self , req, connectors,
1302
+ ) ?)
1273
1303
. build ( ) ;
1274
1304
1275
1305
Ok ( Some ( request) )
@@ -1339,6 +1369,7 @@ impl services::ConnectorIntegration<api::Execute, types::RefundsData, types::Ref
1339
1369
fn get_request_body (
1340
1370
& self ,
1341
1371
req : & types:: RefundsRouterData < api:: Execute > ,
1372
+ _connectors : & settings:: Connectors ,
1342
1373
) -> CustomResult < Option < types:: RequestBody > , errors:: ConnectorError > {
1343
1374
let connector_router_data = adyen:: AdyenRouterData :: try_from ( (
1344
1375
& self . get_currency_unit ( ) ,
@@ -1369,7 +1400,9 @@ impl services::ConnectorIntegration<api::Execute, types::RefundsData, types::Ref
1369
1400
. headers ( types:: RefundExecuteType :: get_headers (
1370
1401
self , req, connectors,
1371
1402
) ?)
1372
- . body ( types:: RefundExecuteType :: get_request_body ( self , req) ?)
1403
+ . body ( types:: RefundExecuteType :: get_request_body (
1404
+ self , req, connectors,
1405
+ ) ?)
1373
1406
. build ( ) ,
1374
1407
) )
1375
1408
}
0 commit comments