-
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
refactor(connector): [Adyen] Change country and issuer type to Optional for OpenBankingUk #2993
Conversation
api::enums::BankNames::TsbBank => Ok(Self::TsbBank), | ||
api::enums::BankNames::TescoBank => Ok(Self::TescoBank), | ||
api::enums::BankNames::UlsterBank => Ok(Self::UlsterBank), | ||
Some(api::enums::BankNames::OpenBankSuccess) => Ok(Self::RedirectSuccess), |
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.
Let's have validation for bank names before calling try_from
Some(api::enums::BankNames::Starling) => Ok(Self::Starling), | ||
Some(api::enums::BankNames::TsbBank) => Ok(Self::TsbBank), | ||
Some(api::enums::BankNames::TescoBank) => Ok(Self::TescoBank), | ||
Some(api::enums::BankNames::UlsterBank) => Ok(Self::UlsterBank), | ||
_ => Err(errors::ConnectorError::NotSupported { |
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.
Please remove default case handling and cover all the cases
@@ -2622,7 +2622,7 @@ fn get_redirect_extra_details( | |||
Some(country.to_owned()), | |||
), | |||
api_models::payments::BankRedirectData::OpenBankingUk { country, .. } => { | |||
(None, Some(country.to_owned())) | |||
(None, country.to_owned()) |
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.
Since country is an optional field, can we have validation for country also
Type of Change
Description
In OpenBankingUk, we had two fields issuer and country. But these fields are not required for all the connector, I came with connector Volt which don't need these fields in their request so I made these fields optional.
Additional Changes
Motivation and Context
How did you test it?
Using Postman
Test cases
Test
Open_banking_uk
for Volt and Adyen Coonector.Curl For Open Banking Uk for Adyen:
{ "amount": 6540, "currency": "GBP", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 6540, "customer_id": "StripeCustomer", "email": "[email protected]", "name": "John Doe", "phone": "999999999", "phone_country_code": "+1", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://google.com/", "payment_method": "bank_redirect", "payment_method_type": "open_banking_uk", "payment_method_data": { "bank_redirect": { "open_banking_uk": { "issuer": "open_bank_success", "country": "GB" } } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "GB", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "127.0.0.1" }, "shipping": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "GB", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }
Checklist
cargo +nightly fmt --all
cargo clippy