feat(router): Return psp_tokenization_enabled in Customer PML (#7519)

This commit is contained in:
Anurag Thakur
2025-03-20 15:02:07 +05:30
committed by GitHub
parent a5be11498f
commit a341e82d4a
8 changed files with 130 additions and 12 deletions

View File

@ -985,6 +985,15 @@ impl transformers::ForeignTryFrom<domain::PaymentMethod> for api::CustomerPaymen
// TODO: check how we can get this field
let recurring_enabled = true;
let psp_tokenization_enabled = item.connector_mandate_details.and_then(|details| {
details.payments.map(|payments| {
payments.values().any(|connector_token_reference| {
connector_token_reference.connector_token_status
== api_enums::ConnectorTokenStatus::Active
})
})
});
Ok(Self {
id: item.id,
customer_id: item.customer_id,
@ -999,6 +1008,7 @@ impl transformers::ForeignTryFrom<domain::PaymentMethod> for api::CustomerPaymen
is_default: false,
billing: payment_method_billing,
network_tokenization: network_token_resp,
psp_tokenization_enabled: psp_tokenization_enabled.unwrap_or(false),
})
}
}