mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 13:30:39 +08:00
refactor(connector): [noon] update and add recommended fields (#2381)
Co-authored-by: Arjun Karthik <m.arjunkarthik@gmail.com>
This commit is contained in:
@ -283,6 +283,7 @@ pub trait PaymentsAuthorizeRequestData {
|
||||
fn get_payment_method_type(&self) -> Result<diesel_models::enums::PaymentMethodType, Error>;
|
||||
fn get_connector_mandate_id(&self) -> Result<String, Error>;
|
||||
fn get_complete_authorize_url(&self) -> Result<String, Error>;
|
||||
fn get_ip_address_as_optional(&self) -> Option<Secret<String, IpAddress>>;
|
||||
}
|
||||
|
||||
impl PaymentsAuthorizeRequestData for types::PaymentsAuthorizeData {
|
||||
@ -370,6 +371,13 @@ impl PaymentsAuthorizeRequestData for types::PaymentsAuthorizeData {
|
||||
self.connector_mandate_id()
|
||||
.ok_or_else(missing_field_err("connector_mandate_id"))
|
||||
}
|
||||
fn get_ip_address_as_optional(&self) -> Option<Secret<String, IpAddress>> {
|
||||
self.browser_info.clone().and_then(|browser_info| {
|
||||
browser_info
|
||||
.ip_address
|
||||
.map(|ip| Secret::new(ip.to_string()))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub trait ConnectorCustomerData {
|
||||
|
||||
Reference in New Issue
Block a user