-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(core): add network error related columns in payment attempt [v2] #7706
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
Merged
Conversation
This file contains hidden or 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
AkshayaFoiger
previously approved these changes
Apr 3, 2025
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.
Connector Code changes, LGTM!
jarnura
previously approved these changes
Apr 3, 2025
AkshayaFoiger
approved these changes
Apr 4, 2025
jarnura
approved these changes
Apr 4, 2025
pixincreate
added a commit
that referenced
this pull request
Apr 4, 2025
…acilitapay-pix-pmt * 'main' of github.com:juspay/hyperswitch: (33 commits) fix(connector): [Nexixpay] handle error code and message in failure response (#7713) fix(connector): [Coingate] Fix Wasm Changes (#7716) fix(config): add billing payment sync configs in different environments (#7708) chore(dashboard): update dashboard toml (#7703) chore(postman): update auth for payment connectors in postman collection (#7702) feat(connector): [BANKOFAMERICA] Enable SamsungPay In Dashboard (#7677) feat(session): Added dpa_client_id, provider to click to pay session response (#7683) feat(core): add network error related columns in payment attempt [v2] (#7706) chore(version): 2025.04.04.0 refactor(accounts): move accounts related tables to accounts schema (#7626) revert: implement `NameType` for name validation (#6734) (#7717) fix(errors): Entry not found error as 4xx instead of 5xx (#7712) refactor(analytics): default config for forex_enabled (#7695) refactor(core): made provider field in ctp_service_details backward compatible (#7705) refactor(openapi): modify profile-delete auth to AdminAPIKey in API doc (#7697) fix: web-docker pull from docker hub (#7700) ci(cypress): fix iatapay upi payments (#7698) docs: Updated next steps after deployment setup on Readme (#7686) chore(version): 2025.04.03.0 fix(connector): [JPMORGAN, PAYU, DIGITALVIRGO, BITPAY, HELCIM, PAYBOX] Replaced lazystatic macros with LazyLock (#7524) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-core
Area: Core flows
A-payments
Area: payments
api-v2
M-api-contract-changes
Metadata: This PR involves API contract changes
M-database-changes
Metadata: This PR involves database schema changes
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 Change
Description
Currently error related information is stored in payment attempt as :
error_code,error_message, error_reason in payment attempt table, apart from this we have unified_code and unified_message which are hyperswitch error codes and error messages mapped to PG error codes and messages(Static).
We need to store network error relation info as well for passive churn product.
Why does passive churn require network error relation info ?
Card network share knowledge on whether failed payments should be retried or not. Errors like Insufficient funds and Donot honor can be retried after sometime with limited no of retries. PG error codes can be only used for immediate retries not async retries.
What is the expected format across multiple connectors ?
Stripe - Stripe shares network adivice code and network decline code. source
Adyen -
refusalCodeRaw (only available for Visa and Mastercard transactions through our own acquiring platform): the numeric part of the raw response. For example: 51. This represents the underlying scenario that caused the transaction to fail.
Note: This fields are populated in prod based on request with adyen team.
Cybersource & Bank of america -
Globalpay -
payment method result & code : source
Worldpay -
Refusal response code and refusal advice code source
Why this information should not be stored in existing columns ?
Existing columns already have different purpose like displaying them to customer/shoppers, smart retires etc .
The raw response provides additional information about why the transaction failed. Be aware that card schemes and issuers sometimes change the text without notice.To prevent the malicious use of data, you must not expose the details of raw responses to shoppers.
How should we store it in our DB ?
Create new columns in our DB
Note : We will try to consume this fields in 3 scenarios for internal payments(payments created by HS),
Additional Changes
Motivation and Context
How did you test it?
Payment gateway's don't provide raw network response in sandbox. this won't break any connector flow since this fields are made option. I have tested it via adyen. adyen gives network error message but not code.
Payments confirm :
response :
Note: This will not effect v1 implementations and payments response. In v1 equivalent fields are issuer error code and issuer error message.
Checklist
cargo +nightly fmt --all
cargo clippy