Skip to content

Commit

Permalink
fix(connector): Paypal BankRedirects (Ideal/EPS) (#6864)
Browse files Browse the repository at this point in the history
  • Loading branch information
awasthi21 authored Dec 20, 2024
1 parent d5710a3 commit dcd51a7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions crates/router/src/connector/paypal/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,21 @@ pub struct PaypalRedirectionResponse {
attributes: Option<AttributeResponse>,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct EpsRedirectionResponse {
name: Option<Secret<String>>,
country_code: Option<enums::CountryAlpha2>,
bic: Option<Secret<String>>,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct IdealRedirectionResponse {
name: Option<Secret<String>>,
country_code: Option<enums::CountryAlpha2>,
bic: Option<Secret<String>>,
iban_last_chars: Option<Secret<String>>,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct AttributeResponse {
vault: PaypalVaultResponse,
Expand Down Expand Up @@ -518,6 +533,8 @@ pub struct CardVaultResponse {
pub enum PaymentSourceItemResponse {
Card(CardVaultResponse),
Paypal(PaypalRedirectionResponse),
Eps(EpsRedirectionResponse),
Ideal(IdealRedirectionResponse),
}

#[derive(Debug, Serialize)]
Expand Down Expand Up @@ -1826,6 +1843,8 @@ impl<F, T>
PaymentSourceItemResponse::Card(card) => {
card.attributes.map(|attr| attr.vault.id)
}
PaymentSourceItemResponse::Eps(_)
| PaymentSourceItemResponse::Ideal(_) => None,
},
None => None,
},
Expand Down

0 comments on commit dcd51a7

Please sign in to comment.