-
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
fix(connector): [Adyen] ErrorHandling
in case of Balance Check for Gift Cards
#1976
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sakilmostak
added
A-connector-integration
Area: Connector integration
A-core
Area: Core flows
C-bug
Category: Bug
A-errors
Area: error messages, structure & logging
R-waiting-on-L1
Review: Waiting on L1 reviewer
labels
Aug 21, 2023
ArjunKarthik
added
the
S-waiting-on-author
Status: This PR is incomplete or needs to address review comments
label
Sep 27, 2023
Please fix the conflicts and add test screenshots |
Sakilmostak
added
S-waiting-on-review
Status: This PR has been implemented and needs to be reviewed
and removed
S-waiting-on-author
Status: This PR is incomplete or needs to address review comments
labels
Oct 5, 2023
ArjunKarthik
requested changes
Oct 6, 2023
ArjunKarthik
added
the
S-waiting-on-author
Status: This PR is incomplete or needs to address review comments
label
Oct 23, 2023
ArjunKarthik
previously approved these changes
Oct 27, 2023
@@ -2867,7 +2879,7 @@ impl TryFrom<types::PaymentsBalanceResponseRouterData<AdyenBalanceResponse>> | |||
}), | |||
payment_method_balance: Some(types::PaymentMethodBalance { | |||
amount: item.response.balance.value, | |||
currency: item.response.balance.currency, | |||
currency: item.response.balance.currency.to_string(), |
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.
Can this be also changed to storage_enums::Currency
…mentMethodBalance
srujanchikke
previously approved these changes
Oct 31, 2023
ArjunKarthik
requested changes
Nov 28, 2023
crates/router/src/connector/adyen.rs
Outdated
message: consts::NO_ERROR_MESSAGE.to_string(), | ||
reason: Some(consts::LOW_BALANCE_ERROR_MESSAGE.to_string()), | ||
status_code: res.status_code, | ||
attempt_status: None, |
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.
send failed status
ArjunKarthik
approved these changes
Nov 28, 2023
ArjunKarthik
removed
the
S-waiting-on-author
Status: This PR is incomplete or needs to address review comments
label
Nov 28, 2023
srujanchikke
approved these changes
Nov 28, 2023
likhinbopanna
removed
the
S-waiting-on-review
Status: This PR has been implemented and needs to be reviewed
label
Nov 28, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-connector-integration
Area: Connector integration
A-core
Area: Core flows
A-errors
Area: error messages, structure & logging
C-bug
Category: Bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
##
Type of ChangeDescription
5xx error was being thrown in case of low balance which was unable to show the error to the merchant. Fix include failing the payment along with the error message in case of low balance
How did you test it?
Test cases added:
Success Case:
{ "amount": 4100, "currency": "EUR", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 100, "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": "gift_card", "payment_method_type": "givex", "payment_method_data": { "gift_card": { "givex": { "number": "6364530000000000", "cvc": "122222" } } }, "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" } }
Failure Case:
{ "amount": 14100, "currency": "EUR", "confirm": true, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 100, "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": "gift_card", "payment_method_type": "givex", "payment_method_data": { "gift_card": { "givex": { "number": "6364530000000000", "cvc": "122222" } } }, "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