-
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): [fiserv] fix metadata deserialization in merchant_connector_account #2746
Conversation
.change_context(errors::ConnectorError::RequestEncodingFailed)?; | ||
let session: FiservSessionObject = | ||
metadata.parse_value("FiservSessionObject").change_context( | ||
errors::ConnectorError::InvalidConnectorConfig { config: "metadata" }, |
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.
We have metadata in Payments request also, So here let's give the clarity of Merchant Connector account metadata. The same comment is applicable for all the places where ever you are using "metadata" for the deserialization error
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.
Done!
Type of Change
Description
While creating merchant connector account for fiserv , we store a field called
terminal_id
. If it is not present while making payment we throw 500 in this case .This PR add validation to connector metadata while creating merchant connector account for fiserv .The existing merchant connector will not process payment as terminal_id validation is added . The following data migrations queries need to be run
If
terminalId
is present then convert it toterminal_id
and then if
terminal_id
is not present setterminal_id
to empty stringAdditional Changes
Motivation and Context
While creating merchant connector account for fiserv , we store a field called
terminal_id
. If it is not present while making payment we throw 500 in this case .This PR add validation to connector metadata while creating merchant connector account for fiserv .How did you test it?
terminal_id
in metadata while creating merchant connector account .it should throw 422 error .created a issue for postman collection : https://github.com/juspay/hyperswitch-cloud/issues/3276
Checklist
cargo +nightly fmt --all
cargo clippy