mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 21:07:58 +08:00
feat(nexinets): Use connector_request_reference_id as reference to the connector - Work In Progress (#2515)
This commit is contained in:
@ -27,6 +27,7 @@ pub struct NexinetsPaymentsRequest {
|
|||||||
payment: Option<NexinetsPaymentDetails>,
|
payment: Option<NexinetsPaymentDetails>,
|
||||||
#[serde(rename = "async")]
|
#[serde(rename = "async")]
|
||||||
nexinets_async: NexinetsAsyncDetails,
|
nexinets_async: NexinetsAsyncDetails,
|
||||||
|
merchant_order_id: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Default)]
|
#[derive(Debug, Serialize, Default)]
|
||||||
@ -172,6 +173,11 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for NexinetsPaymentsRequest {
|
|||||||
failure_url: return_url,
|
failure_url: return_url,
|
||||||
};
|
};
|
||||||
let (payment, product) = get_payment_details_and_product(item)?;
|
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 {
|
Ok(Self {
|
||||||
initial_amount: item.request.amount,
|
initial_amount: item.request.amount,
|
||||||
currency: item.request.currency,
|
currency: item.request.currency,
|
||||||
@ -179,6 +185,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for NexinetsPaymentsRequest {
|
|||||||
product,
|
product,
|
||||||
payment,
|
payment,
|
||||||
nexinets_async,
|
nexinets_async,
|
||||||
|
merchant_order_id,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user