mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 11:06:50 +08:00
feat(connector): [Deutschebank] Implement Card 3ds (#6844)
Co-authored-by: Debarshi Gupta <debarshi.gupta@Debarshi-Gupta-CM92YWDXFD.local> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -942,6 +942,129 @@ impl Default for settings::RequiredFields {
|
||||
),
|
||||
}
|
||||
),
|
||||
(
|
||||
enums::Connector::Deutschebank,
|
||||
RequiredFieldFinal {
|
||||
mandate: HashMap::new(),
|
||||
non_mandate : HashMap::from(
|
||||
[
|
||||
(
|
||||
"payment_method_data.card.card_number".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.card.card_number".to_string(),
|
||||
display_name: "card_number".to_string(),
|
||||
field_type: enums::FieldType::UserCardNumber,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"payment_method_data.card.card_exp_month".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.card.card_exp_month".to_string(),
|
||||
display_name: "card_exp_month".to_string(),
|
||||
field_type: enums::FieldType::UserCardExpiryMonth,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"payment_method_data.card.card_exp_year".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.card.card_exp_year".to_string(),
|
||||
display_name: "card_exp_year".to_string(),
|
||||
field_type: enums::FieldType::UserCardExpiryYear,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"payment_method_data.card.card_cvc".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.card.card_cvc".to_string(),
|
||||
display_name: "card_cvc".to_string(),
|
||||
field_type: enums::FieldType::UserCardCvc,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"email".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "email".to_string(),
|
||||
display_name: "email".to_string(),
|
||||
field_type: enums::FieldType::UserEmailAddress,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.line1".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.line1".to_string(),
|
||||
display_name: "line1".to_string(),
|
||||
field_type: enums::FieldType::UserAddressLine1,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.city".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.city".to_string(),
|
||||
display_name: "city".to_string(),
|
||||
field_type: enums::FieldType::UserAddressCity,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.state".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.state".to_string(),
|
||||
display_name: "state".to_string(),
|
||||
field_type: enums::FieldType::UserAddressState,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.zip".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.zip".to_string(),
|
||||
display_name: "zip".to_string(),
|
||||
field_type: enums::FieldType::UserAddressPincode,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.country".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.country".to_string(),
|
||||
display_name: "country".to_string(),
|
||||
field_type: enums::FieldType::UserAddressCountry{
|
||||
options: vec![
|
||||
"ALL".to_string(),
|
||||
]
|
||||
},
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.first_name".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.first_name".to_string(),
|
||||
display_name: "first_name".to_string(),
|
||||
field_type: enums::FieldType::UserFullName,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.last_name".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.last_name".to_string(),
|
||||
display_name: "last_name".to_string(),
|
||||
field_type: enums::FieldType::UserFullName,
|
||||
value: None,
|
||||
}
|
||||
)
|
||||
]
|
||||
),
|
||||
common: HashMap::new(),
|
||||
}
|
||||
),
|
||||
(
|
||||
enums::Connector::Dlocal,
|
||||
RequiredFieldFinal {
|
||||
@ -4139,6 +4262,129 @@ impl Default for settings::RequiredFields {
|
||||
),
|
||||
}
|
||||
),
|
||||
(
|
||||
enums::Connector::Deutschebank,
|
||||
RequiredFieldFinal {
|
||||
mandate: HashMap::new(),
|
||||
non_mandate : HashMap::from(
|
||||
[
|
||||
(
|
||||
"payment_method_data.card.card_number".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.card.card_number".to_string(),
|
||||
display_name: "card_number".to_string(),
|
||||
field_type: enums::FieldType::UserCardNumber,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"payment_method_data.card.card_exp_month".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.card.card_exp_month".to_string(),
|
||||
display_name: "card_exp_month".to_string(),
|
||||
field_type: enums::FieldType::UserCardExpiryMonth,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"payment_method_data.card.card_exp_year".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.card.card_exp_year".to_string(),
|
||||
display_name: "card_exp_year".to_string(),
|
||||
field_type: enums::FieldType::UserCardExpiryYear,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"payment_method_data.card.card_cvc".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.card.card_cvc".to_string(),
|
||||
display_name: "card_cvc".to_string(),
|
||||
field_type: enums::FieldType::UserCardCvc,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"email".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "email".to_string(),
|
||||
display_name: "email".to_string(),
|
||||
field_type: enums::FieldType::UserEmailAddress,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.line1".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.line1".to_string(),
|
||||
display_name: "line1".to_string(),
|
||||
field_type: enums::FieldType::UserAddressLine1,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.city".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.city".to_string(),
|
||||
display_name: "city".to_string(),
|
||||
field_type: enums::FieldType::UserAddressCity,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.state".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.state".to_string(),
|
||||
display_name: "state".to_string(),
|
||||
field_type: enums::FieldType::UserAddressState,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.zip".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.zip".to_string(),
|
||||
display_name: "zip".to_string(),
|
||||
field_type: enums::FieldType::UserAddressPincode,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.country".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.country".to_string(),
|
||||
display_name: "country".to_string(),
|
||||
field_type: enums::FieldType::UserAddressCountry{
|
||||
options: vec![
|
||||
"ALL".to_string(),
|
||||
]
|
||||
},
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.first_name".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.first_name".to_string(),
|
||||
display_name: "first_name".to_string(),
|
||||
field_type: enums::FieldType::UserFullName,
|
||||
value: None,
|
||||
}
|
||||
),
|
||||
(
|
||||
"billing.address.last_name".to_string(),
|
||||
RequiredFieldInfo {
|
||||
required_field: "payment_method_data.billing.address.last_name".to_string(),
|
||||
display_name: "last_name".to_string(),
|
||||
field_type: enums::FieldType::UserFullName,
|
||||
value: None,
|
||||
}
|
||||
)
|
||||
]
|
||||
),
|
||||
common: HashMap::new(),
|
||||
}
|
||||
),
|
||||
(
|
||||
enums::Connector::Dlocal,
|
||||
RequiredFieldFinal {
|
||||
|
||||
@ -1535,6 +1535,46 @@ pub fn build_redirection_form(
|
||||
</script>")))
|
||||
}}
|
||||
}
|
||||
RedirectForm::DeutschebankThreeDSChallengeFlow { acs_url, creq } => {
|
||||
maud::html! {
|
||||
(maud::DOCTYPE)
|
||||
html {
|
||||
head {
|
||||
meta name="viewport" content="width=device-width, initial-scale=1";
|
||||
}
|
||||
|
||||
body style="background-color: #ffffff; padding: 20px; font-family: Arial, Helvetica, Sans-Serif;" {
|
||||
div id="loader1" class="lottie" style="height: 150px; display: block; position: relative; margin-top: 150px; margin-left: auto; margin-right: auto;" { "" }
|
||||
|
||||
(PreEscaped(r#"<script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.7.4/lottie.min.js"></script>"#))
|
||||
|
||||
(PreEscaped(r#"
|
||||
<script>
|
||||
var anime = bodymovin.loadAnimation({
|
||||
container: document.getElementById('loader1'),
|
||||
renderer: 'svg',
|
||||
loop: true,
|
||||
autoplay: true,
|
||||
name: 'hyperswitch loader',
|
||||
animationData: {"v":"4.8.0","meta":{"g":"LottieFiles AE 3.1.1","a":"","k":"","d":"","tc":""},"fr":29.9700012207031,"ip":0,"op":31.0000012626559,"w":400,"h":250,"nm":"loader_shape","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"circle 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[278.25,202.671,0],"ix":2},"a":{"a":0,"k":[23.72,23.72,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[12.935,0],[0,-12.936],[-12.935,0],[0,12.935]],"o":[[-12.952,0],[0,12.935],[12.935,0],[0,-12.936]],"v":[[0,-23.471],[-23.47,0.001],[0,23.471],[23.47,0.001]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.427451010311,0.976470648074,1],"ix":4},"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[10]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":19.99,"s":[100]},{"t":29.9800012211104,"s":[10]}],"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[23.72,23.721],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":48.0000019550801,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"square 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[196.25,201.271,0],"ix":2},"a":{"a":0,"k":[22.028,22.03,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[1.914,0],[0,0],[0,-1.914],[0,0],[-1.914,0],[0,0],[0,1.914],[0,0]],"o":[[0,0],[-1.914,0],[0,0],[0,1.914],[0,0],[1.914,0],[0,0],[0,-1.914]],"v":[[18.313,-21.779],[-18.312,-21.779],[-21.779,-18.313],[-21.779,18.314],[-18.312,21.779],[18.313,21.779],[21.779,18.314],[21.779,-18.313]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.427451010311,0.976470648074,1],"ix":4},"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":5,"s":[10]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":14.99,"s":[100]},{"t":24.9800010174563,"s":[10]}],"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[22.028,22.029],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":47.0000019143492,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Triangle 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[116.25,200.703,0],"ix":2},"a":{"a":0,"k":[27.11,21.243,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0.558,-0.879],[0,0],[-1.133,0],[0,0],[0.609,0.947],[0,0]],"o":[[-0.558,-0.879],[0,0],[-0.609,0.947],[0,0],[1.133,0],[0,0],[0,0]],"v":[[1.209,-20.114],[-1.192,-20.114],[-26.251,18.795],[-25.051,20.993],[25.051,20.993],[26.251,18.795],[1.192,-20.114]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.427451010311,0.976470648074,1],"ix":4},"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[10]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":9.99,"s":[100]},{"t":19.9800008138021,"s":[10]}],"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[27.11,21.243],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":48.0000019550801,"st":0,"bm":0}],"markers":[]}
|
||||
})
|
||||
</script>
|
||||
"#))
|
||||
|
||||
h3 style="text-align: center;" { "Please wait while we process your payment..." }
|
||||
}
|
||||
(PreEscaped(format!("<form id=\"PaReqForm\" method=\"POST\" action=\"{acs_url}\">
|
||||
<input type=\"hidden\" name=\"creq\" value=\"{creq}\">
|
||||
</form>")))
|
||||
(PreEscaped(format!("<script>
|
||||
{logging_template}
|
||||
window.onload = function() {{
|
||||
var paReqForm = document.querySelector('#PaReqForm'); if(paReqForm) paReqForm.submit();
|
||||
}}
|
||||
</script>")))
|
||||
}
|
||||
}
|
||||
}
|
||||
RedirectForm::Payme => {
|
||||
maud::html! {
|
||||
(maud::DOCTYPE)
|
||||
|
||||
Reference in New Issue
Block a user