File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
crates/hyperswitch_connectors/src/connectors/worldpay Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ pub struct Instruction {
32
32
pub value : PaymentValue ,
33
33
#[ serde( skip_serializing_if = "Option::is_none" ) ]
34
34
pub debt_repayment : Option < bool > ,
35
- #[ serde( rename = "threeDS" ) ]
35
+ #[ serde( rename = "threeDS" , skip_serializing_if = "Option::is_none" ) ]
36
36
pub three_ds : Option < ThreeDSRequest > ,
37
37
/// For setting up mandates
38
38
pub token_creation : Option < TokenCreation > ,
Original file line number Diff line number Diff line change @@ -390,8 +390,14 @@ fn create_three_ds_request<T: WorldpayPaymentsRequestData>(
390
390
router_data : & T ,
391
391
is_mandate_payment : bool ,
392
392
) -> Result < Option < ThreeDSRequest > , error_stack:: Report < errors:: ConnectorError > > {
393
- match router_data. get_auth_type ( ) {
394
- enums:: AuthenticationType :: ThreeDs => {
393
+ match (
394
+ router_data. get_auth_type ( ) ,
395
+ router_data. get_payment_method_data ( ) ,
396
+ ) {
397
+ // 3DS for NTI flow
398
+ ( _, PaymentMethodData :: CardDetailsForNetworkTransactionId ( _) ) => Ok ( None ) ,
399
+ // 3DS for regular payments
400
+ ( enums:: AuthenticationType :: ThreeDs , _) => {
395
401
let browser_info = router_data. get_browser_info ( ) . ok_or (
396
402
errors:: ConnectorError :: MissingRequiredField {
397
403
field_name : "browser_info" ,
@@ -439,6 +445,7 @@ fn create_three_ds_request<T: WorldpayPaymentsRequestData>(
439
445
} ,
440
446
} ) )
441
447
}
448
+ // Non 3DS
442
449
_ => Ok ( None ) ,
443
450
}
444
451
}
You can’t perform that action at this time.
0 commit comments