Skip to content

Commit 142a22c

Browse files
sai-harsha-vardhanhrithikesh026hyperswitch-bot[bot]
authored
feat(connector): [Checkout] add support for external authentication for checkout connector (#4006)
Co-authored-by: hrithikesh026 <[email protected]> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Hrithikesh <[email protected]>
1 parent 06c3096 commit 142a22c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

crates/router/src/connector/checkout/transformers.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ pub enum CheckoutPaymentIntent {
259259
pub struct CheckoutThreeDS {
260260
enabled: bool,
261261
force_3ds: bool,
262+
eci: Option<String>,
263+
cryptogram: Option<String>,
264+
xid: Option<String>,
265+
version: Option<String>,
262266
}
263267

264268
impl TryFrom<&types::ConnectorAuthType> for CheckoutAuthType {
@@ -380,14 +384,24 @@ impl TryFrom<&CheckoutRouterData<&types::PaymentsAuthorizeRouterData>> for Payme
380384
)),
381385
}?;
382386

387+
let authentication_data = item.router_data.request.authentication_data.as_ref();
388+
383389
let three_ds = match item.router_data.auth_type {
384390
enums::AuthenticationType::ThreeDs => CheckoutThreeDS {
385391
enabled: true,
386392
force_3ds: true,
393+
eci: authentication_data.and_then(|auth| auth.eci.clone()),
394+
cryptogram: authentication_data.and_then(|auth| auth.cavv.clone()),
395+
xid: authentication_data.map(|auth| auth.threeds_server_transaction_id.clone()),
396+
version: authentication_data.map(|auth| auth.message_version.clone()),
387397
},
388398
enums::AuthenticationType::NoThreeDs => CheckoutThreeDS {
389399
enabled: false,
390400
force_3ds: false,
401+
eci: None,
402+
cryptogram: None,
403+
xid: None,
404+
version: None,
391405
},
392406
};
393407

0 commit comments

Comments
 (0)