Skip to content
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): [Dlocal] Use connector_response_reference_id as reference to merchant #2446

Merged
merged 9 commits into from
Oct 15, 2023
27 changes: 18 additions & 9 deletions crates/router/src/connector/dlocal/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ pub struct DlocalPaymentsResponse {
status: DlocalPaymentStatus,
id: String,
three_dsecure: Option<ThreeDSecureResData>,
order_id: String,
}

impl<F, T>
Expand All @@ -269,12 +270,12 @@ impl<F, T>
});

let response = types::PaymentsResponseData::TransactionResponse {
resource_id: types::ResponseId::ConnectorTransactionId(item.response.id),
resource_id: types::ResponseId::ConnectorTransactionId(item.response.order_id.clone()),
redirection_data,
mandate_reference: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: None,
connector_response_reference_id: Some(item.response.order_id.clone()),
};
Ok(Self {
status: enums::AttemptStatus::from(item.response.status),
Expand All @@ -288,6 +289,7 @@ impl<F, T>
pub struct DlocalPaymentsSyncResponse {
status: DlocalPaymentStatus,
id: String,
order_id: String,
}

impl<F, T>
Expand All @@ -307,12 +309,14 @@ impl<F, T>
Ok(Self {
status: enums::AttemptStatus::from(item.response.status),
response: Ok(types::PaymentsResponseData::TransactionResponse {
resource_id: types::ResponseId::ConnectorTransactionId(item.response.id),
resource_id: types::ResponseId::ConnectorTransactionId(
item.response.order_id.clone(),
),
redirection_data: None,
mandate_reference: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: None,
connector_response_reference_id: Some(item.response.order_id.clone()),
}),
..item.data
})
Expand All @@ -323,6 +327,7 @@ impl<F, T>
pub struct DlocalPaymentsCaptureResponse {
status: DlocalPaymentStatus,
id: String,
order_id: String,
}

impl<F, T>
Expand All @@ -342,12 +347,14 @@ impl<F, T>
Ok(Self {
status: enums::AttemptStatus::from(item.response.status),
response: Ok(types::PaymentsResponseData::TransactionResponse {
resource_id: types::ResponseId::ConnectorTransactionId(item.response.id),
resource_id: types::ResponseId::ConnectorTransactionId(
item.response.order_id.clone(),
),
redirection_data: None,
mandate_reference: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: None,
connector_response_reference_id: Some(item.response.order_id.clone()),
}),
..item.data
})
Expand All @@ -356,7 +363,7 @@ impl<F, T>

pub struct DlocalPaymentsCancelResponse {
status: DlocalPaymentStatus,
id: String,
order_id: String,
}

impl<F, T>
Expand All @@ -376,12 +383,14 @@ impl<F, T>
Ok(Self {
status: enums::AttemptStatus::from(item.response.status),
response: Ok(types::PaymentsResponseData::TransactionResponse {
resource_id: types::ResponseId::ConnectorTransactionId(item.response.id),
resource_id: types::ResponseId::ConnectorTransactionId(
item.response.order_id.clone(),
),
redirection_data: None,
mandate_reference: None,
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: None,
connector_response_reference_id: Some(item.response.order_id.clone()),
}),
..item.data
})
Expand Down
Loading