-
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): accept connector_transaction_id in error_response of connector flows for Trustpay #3060
feat(connector): accept connector_transaction_id in error_response of connector flows for Trustpay #3060
Changes from all commits
f43de21
9383e03
97a415a
7f69ed0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -722,13 +722,13 @@ fn handle_cards_response( | |
reason: msg, | ||
status_code, | ||
attempt_status: None, | ||
connector_transaction_id: None, | ||
connector_transaction_id: Some(response.instance_id.clone()), | ||
}) | ||
} else { | ||
None | ||
}; | ||
let payment_response_data = types::PaymentsResponseData::TransactionResponse { | ||
resource_id: types::ResponseId::ConnectorTransactionId(response.instance_id), | ||
resource_id: types::ResponseId::ConnectorTransactionId(response.instance_id.clone()), | ||
redirection_data, | ||
mandate_reference: None, | ||
connector_metadata: None, | ||
|
@@ -825,14 +825,24 @@ fn handle_bank_redirects_sync_response( | |
reason: reason_info.reason.reject_reason, | ||
status_code, | ||
attempt_status: None, | ||
connector_transaction_id: None, | ||
connector_transaction_id: Some( | ||
response | ||
.payment_information | ||
.references | ||
.payment_request_id | ||
.clone(), | ||
), | ||
}) | ||
} else { | ||
None | ||
}; | ||
let payment_response_data = types::PaymentsResponseData::TransactionResponse { | ||
resource_id: types::ResponseId::ConnectorTransactionId( | ||
response.payment_information.references.payment_request_id, | ||
response | ||
.payment_information | ||
.references | ||
.payment_request_id | ||
.clone(), | ||
), | ||
redirection_data: None, | ||
mandate_reference: None, | ||
|
@@ -1637,16 +1647,13 @@ pub struct Errors { | |
} | ||
|
||
#[derive(Default, Debug, Serialize, Deserialize, PartialEq)] | ||
#[serde(rename_all = "camelCase")] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you confirm TrustPayTransactionStatusErrorResponse also requires camelCase There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
pub struct TrustpayErrorResponse { | ||
pub status: i64, | ||
pub description: Option<String>, | ||
pub errors: Option<Vec<Errors>>, | ||
} | ||
|
||
#[derive(Deserialize)] | ||
pub struct TrustPayTransactionStatusErrorResponse { | ||
pub status: i64, | ||
pub payment_description: String, | ||
pub instance_id: Option<String>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We shouldn't get There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
pub payment_description: Option<String>, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] | ||
|
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.
for bank redirects do we get payment_request_id instead of instance_id?
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 we use bank payment_request_id instead of instance_id for bank redirects. Ref
page.no 333
oftrustpay.rs