-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(pm_list): add required fields for giropay #3194
Changes from 9 commits
bd1c1dc
b3d0f99
dd67fee
0bd5824
588c6b3
8679744
eb36df4
289503c
333ee50
2bfb7ba
701affa
e790955
678eb53
4c4e0c0
bd59a2e
3f52d5f
51fc9a0
4737bf5
8749233
28cb2cd
17ee23d
9bc80d4
1b7c138
2bc92a4
1717524
6d65743
cb87d75
ea7eb37
9c0af54
5821804
ab92bbf
b5b9fc7
29c16bd
3a3585d
c0ccd99
f8f868d
bdf11fc
f87f157
845121c
d988c81
d740753
457bb72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1096,7 +1096,13 @@ impl TryFrom<&payments::BankRedirectData> for StripeBillingAddress { | |
payments::BankRedirectData::Giropay { | ||
billing_details, .. | ||
} => Ok(Self { | ||
name: billing_details.billing_name.clone(), | ||
name: billing_details | ||
.clone() | ||
.ok_or(errors::ConnectorError::MissingRequiredField { | ||
field_name: "giropay.billing_details", | ||
})? | ||
.billing_name | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is |
||
.clone(), | ||
..Self::default() | ||
}), | ||
payments::BankRedirectData::Ideal { | ||
|
@@ -1145,8 +1151,12 @@ impl TryFrom<&payments::BankRedirectData> for StripeBillingAddress { | |
payments::BankRedirectData::Sofort { | ||
billing_details, .. | ||
} => Ok(Self { | ||
name: billing_details.billing_name.clone(), | ||
email: billing_details.email.clone(), | ||
name: billing_details | ||
.clone() | ||
.and_then(|billing_data| billing_data.billing_name.clone()), | ||
email: billing_details | ||
.clone() | ||
.and_then(|billing_data| billing_data.email.clone()), | ||
..Self::default() | ||
}), | ||
payments::BankRedirectData::Bizum {} | ||
|
@@ -1631,8 +1641,17 @@ impl TryFrom<&payments::BankRedirectData> for StripePaymentMethodData { | |
} => Ok(Self::BankRedirect(StripeBankRedirectData::StripeSofort( | ||
Box::new(StripeSofort { | ||
payment_method_data_type, | ||
country: country.to_owned(), | ||
preferred_language: preferred_language.to_owned(), | ||
country: country | ||
.ok_or(errors::ConnectorError::MissingRequiredField { | ||
field_name: "country", | ||
})? | ||
.to_owned(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add utils function |
||
preferred_language: preferred_language | ||
.clone() | ||
.ok_or(errors::ConnectorError::MissingRequiredField { | ||
field_name: "sofort.preferred_language", | ||
})? | ||
.to_owned(), | ||
}), | ||
))), | ||
payments::BankRedirectData::OnlineBankingFpx { .. } => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -383,11 +383,16 @@ fn make_bank_redirect_request( | |
{ | ||
PaymentMethodSpecificData::PaymentProduct816SpecificInput(Box::new(Giropay { | ||
bank_account_iban: BankAccountIban { | ||
account_holder_name: billing_details.billing_name.clone().ok_or( | ||
errors::ConnectorError::MissingRequiredField { | ||
account_holder_name: billing_details | ||
.clone() | ||
.ok_or(errors::ConnectorError::MissingRequiredField { | ||
field_name: "giropay.billing_details", | ||
})? | ||
.billing_name | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please use the utils method - |
||
.clone() | ||
.ok_or(errors::ConnectorError::MissingRequiredField { | ||
field_name: "billing_details.billing_name", | ||
}, | ||
)?, | ||
})?, | ||
iban: bank_account_iban.clone(), | ||
}, | ||
})) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we have changes for Sofort pm type in this pr? I observed there was another PR for sofort, please undo these changes if not necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there is another separate PR for Sofort. Sofort changes appeared in this branch as
dynamic_field/giropay
branch is built upondynamic_field/sofort
branch whilst the PR pointed to main.Now Sofort changes are removed. Requesting your review