Skip to content

Commit eff5605

Browse files
committed
Use connector_request_reference_id as reference to the connector
The reference is passed as the "merchantOrderId" attribute, as described in NexiNets documentation: https://developer.nexigroup.com/payengine/en-EU/api/payengine-api-v1/#orders-debit-post
1 parent 8029a89 commit eff5605

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/router/src/connector/nexinets/transformers.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub struct NexinetsPaymentsRequest {
2727
payment: Option<NexinetsPaymentDetails>,
2828
#[serde(rename = "async")]
2929
nexinets_async: NexinetsAsyncDetails,
30+
merchant_order_id: Option<String>,
3031
}
3132

3233
#[derive(Debug, Serialize, Default)]
@@ -172,13 +173,19 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for NexinetsPaymentsRequest {
172173
failure_url: return_url,
173174
};
174175
let (payment, product) = get_payment_details_and_product(item)?;
176+
let merchant_order_id = match item.payment_method {
177+
// Merchant order id is sent only in case of card payment
178+
enums::PaymentMethod::Card => Some(item.connector_request_reference_id.clone()),
179+
_ => None,
180+
};
175181
Ok(Self {
176182
initial_amount: item.request.amount,
177183
currency: item.request.currency,
178184
channel: NexinetsChannel::Ecom,
179185
product,
180186
payment,
181187
nexinets_async,
188+
merchant_order_id,
182189
})
183190
}
184191
}

0 commit comments

Comments
 (0)