From e05a1ea6b8be787c482b6d34b561a9a634db466c Mon Sep 17 00:00:00 2001 From: Lab Rat Date: Sun, 1 Oct 2023 23:27:35 +0530 Subject: [PATCH] feat(connector): [Payeezy] add connector_response_reference_id reference support --- crates/router/src/connector/payeezy/transformers.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/router/src/connector/payeezy/transformers.rs b/crates/router/src/connector/payeezy/transformers.rs index d6c22ba67c31..98e8ea12c00d 100644 --- a/crates/router/src/connector/payeezy/transformers.rs +++ b/crates/router/src/connector/payeezy/transformers.rs @@ -67,6 +67,7 @@ pub struct PayeezyPaymentsRequest { pub currency_code: String, pub credit_card: PayeezyPaymentMethod, pub stored_credentials: Option, + pub reference: String, } #[derive(Serialize, Debug)] @@ -118,6 +119,7 @@ fn get_card_specific_payment_data( currency_code, credit_card, stored_credentials, + reference: item.connector_request_reference_id.clone(), }) } fn get_transaction_type_and_stored_creds( @@ -252,6 +254,7 @@ pub struct PayeezyPaymentsResponse { pub gateway_resp_code: String, pub gateway_message: String, pub stored_credentials: Option, + pub reference: Option, } #[derive(Debug, Deserialize)] @@ -354,13 +357,17 @@ impl status, response: Ok(types::PaymentsResponseData::TransactionResponse { resource_id: types::ResponseId::ConnectorTransactionId( - item.response.transaction_id, + item.response.transaction_id.clone(), ), redirection_data: None, mandate_reference, connector_metadata: metadata, network_txn_id: None, - connector_response_reference_id: None, + connector_response_reference_id: Some( + item.response + .reference + .unwrap_or(item.response.transaction_id), + ), }), ..item.data })