-
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
feat(connector): [Bluesnap] Metadata to connector metadata mapping #3331
Conversation
@@ -590,6 +621,14 @@ impl TryFrom<&BluesnapRouterData<&types::PaymentsCompleteAuthorizeRouterData>> | |||
.parse_value("BluesnapRedirectionResponse") | |||
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?; | |||
|
|||
let transaction_meta_data = match item.router_data.request.metadata.as_ref() { |
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.
Do we need to pass meta data in complete authorize as well?
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.
Yes, because transaction call to Bluesnap for 3ds payments happen through complete authorize
@@ -590,6 +621,14 @@ impl TryFrom<&BluesnapRouterData<&types::PaymentsCompleteAuthorizeRouterData>> | |||
.parse_value("BluesnapRedirectionResponse") | |||
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?; | |||
|
|||
let transaction_meta_data = match item.router_data.request.metadata.as_ref() { | |||
Some(metadata) => Some(BluesnapMetadata { | |||
meta_data: Vec::<RequestMetadata>::foreign_from(metadata.peek().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.
Incase of manual capture and void were we able to see the metadata for those transaction?
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.
Yes, metadata sent in auth is visible on dashboard for capture and void calls
meta_key: Option<String>, | ||
meta_value: Option<String>, | ||
is_visible: Option<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.
Why do we need to keep these fields as optional? RequestMetadata should be instructed only incase of payment metadata is present
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.
These fields are optional at the connector end. Hence made them optional in RequestMetadata
struct
006ae75
to
285442f
Compare
vector.push(RequestMetadata { | ||
meta_key: key, | ||
meta_value: value.map(|field_value| field_value.to_string()), | ||
is_visible: Some("Y".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.
Please assign this to constant and use it here
Type of Change
Description
resolve #3839
Metadata should be in
{String : Value } type where Value is not an object.
In case it is an object an Request Encoding error is thrown
Test Case?
Testing can be done by creating a card/gpay/applepay payment and by passing the following metadata in PAYMENTS-CREATE:
Checklist
cargo +nightly fmt --all
cargo clippy