refactor(connector): [AUTHORIZEDOTNET] Add metadata information to connector request#7011
Merged
Gnanasundari24 merged 6 commits intomainfrom Feb 5, 2025
Merged
Conversation
2 tasks
awasthi21
previously approved these changes
Jan 10, 2025
awasthi21
reviewed
Jan 10, 2025
Contributor
awasthi21
left a comment
There was a problem hiding this comment.
nit : should we use Btree's here @deepanshu-iiitu?
deepanshu-iiitu
requested changes
Jan 10, 2025
| impl ForeignFrom<Value> for Vec<UserField> { | ||
| fn foreign_from(metadata: Value) -> Self { | ||
| let hashmap: BTreeMap<String, Value> = | ||
| serde_json::from_str(&metadata.to_string()).unwrap_or(BTreeMap::new()); |
Contributor
There was a problem hiding this comment.
Instead of using unwrap_or and handling this with a default value throw a deserialization error.
Contributor
Author
There was a problem hiding this comment.
I have resolved it
awasthi21
previously approved these changes
Jan 13, 2025
deepanshu-iiitu
requested changes
Jan 13, 2025
| type Error = error_stack::Report<errors::ConnectorError>; | ||
| fn foreign_try_from(metadata: Value) -> Result<Self, Self::Error> { | ||
| let hashmap: BTreeMap<String, Value> = serde_json::from_str(&metadata.to_string()) | ||
| .change_context(errors::ConnectorError::ResponseDeserializationFailed) |
Contributor
There was a problem hiding this comment.
Why are we throwing ResponseDeserializationFailed error here?
Lets use RequestEncodingFailedWithReason error
Contributor
Author
There was a problem hiding this comment.
Thanks, I have resolved it.
deepanshu-iiitu
approved these changes
Jan 13, 2025
awasthi21
approved these changes
Jan 13, 2025
awasthi21
approved these changes
Jan 20, 2025
Contributor
|
@Debarshi-Gupta Can you add authorizedotnet connector in cypress |
Narayanbhat166
pushed a commit
that referenced
this pull request
Feb 6, 2025
…nnector request (#7011) Co-authored-by: Debarshi Gupta <debarshi.gupta@Debarshi-Gupta-CM92YWDXFD.local> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This PR is for code changes which sends the metadata passed in payment intent create to authorizedotnet as request payload, as per merchant requirements.
The merchant receives a receipt of the transaction through email, which contains the metadata passed by the merchant in payment intent create request.
Additional Changes
Motivation and Context
All flows have been tested as per the authorizedotnet developer docs:
https://developer.authorize.net/api/reference/index.html#payment-transactions-charge-a-credit-card
How did you test it?
Postman Tests
1. Authorize (Manual)
2. Capture (Manual)
3. Authorize + Capture
4. PSync
5. Refund
6. RSync
7. Cancel/Void
Checklist
cargo +nightly fmt --allcargo clippy