feat(connector): [Dlocal] Use connector_response_reference_id as reference to merchant (#2446)

This commit is contained in:
Sargam Puram
2023-10-15 14:33:57 +05:30
committed by GitHub
parent 2609ef6aeb
commit f6677b8e93

View File

@ -250,6 +250,7 @@ pub struct DlocalPaymentsResponse {
status: DlocalPaymentStatus,
id: String,
three_dsecure: Option<ThreeDSecureResData>,
order_id: String,
}
impl<F, T>
@ -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),
@ -288,6 +289,7 @@ impl<F, T>
pub struct DlocalPaymentsSyncResponse {
status: DlocalPaymentStatus,
id: String,
order_id: String,
}
impl<F, T>
@ -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
})
@ -323,6 +327,7 @@ impl<F, T>
pub struct DlocalPaymentsCaptureResponse {
status: DlocalPaymentStatus,
id: String,
order_id: String,
}
impl<F, T>
@ -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
})
@ -356,7 +363,7 @@ impl<F, T>
pub struct DlocalPaymentsCancelResponse {
status: DlocalPaymentStatus,
id: String,
order_id: String,
}
impl<F, T>
@ -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
})