Skip to content

Commit

Permalink
feat(nexinets): Use connector_request_reference_id as reference to th…
Browse files Browse the repository at this point in the history
…e connector - Work In Progress (#2515)
  • Loading branch information
frazar authored Oct 13, 2023
1 parent fbf3c03 commit 088dce0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/router/src/connector/nexinets/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub struct NexinetsPaymentsRequest {
payment: Option<NexinetsPaymentDetails>,
#[serde(rename = "async")]
nexinets_async: NexinetsAsyncDetails,
merchant_order_id: Option<String>,
}

#[derive(Debug, Serialize, Default)]
Expand Down Expand Up @@ -172,13 +173,19 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for NexinetsPaymentsRequest {
failure_url: return_url,
};
let (payment, product) = get_payment_details_and_product(item)?;
let merchant_order_id = match item.payment_method {
// Merchant order id is sent only in case of card payment
enums::PaymentMethod::Card => Some(item.connector_request_reference_id.clone()),
_ => None,
};
Ok(Self {
initial_amount: item.request.amount,
currency: item.request.currency,
channel: NexinetsChannel::Ecom,
product,
payment,
nexinets_async,
merchant_order_id,
})
}
}
Expand Down

0 comments on commit 088dce0

Please sign in to comment.