mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-12 03:14:12 +08:00
feat(connector): [HELCIM] Implement Cards for Helcim (#2210)
This commit is contained in:
@@ -248,19 +248,25 @@ impl PaymentsPreProcessingData for types::PaymentsPreProcessingData {
|
||||
|
||||
pub trait PaymentsCaptureRequestData {
|
||||
fn is_multiple_capture(&self) -> bool;
|
||||
fn get_browser_info(&self) -> Result<types::BrowserInformation, Error>;
|
||||
}
|
||||
|
||||
impl PaymentsCaptureRequestData for types::PaymentsCaptureData {
|
||||
fn is_multiple_capture(&self) -> bool {
|
||||
self.multiple_capture_data.is_some()
|
||||
}
|
||||
fn get_browser_info(&self) -> Result<types::BrowserInformation, Error> {
|
||||
self.browser_info
|
||||
.clone()
|
||||
.ok_or_else(missing_field_err("browser_info"))
|
||||
}
|
||||
}
|
||||
|
||||
pub trait SetupMandateRequestData {
|
||||
pub trait PaymentsSetupMandateRequestData {
|
||||
fn get_browser_info(&self) -> Result<types::BrowserInformation, Error>;
|
||||
}
|
||||
|
||||
impl SetupMandateRequestData for types::SetupMandateRequestData {
|
||||
impl PaymentsSetupMandateRequestData for types::SetupMandateRequestData {
|
||||
fn get_browser_info(&self) -> Result<types::BrowserInformation, Error> {
|
||||
self.browser_info
|
||||
.clone()
|
||||
@@ -511,6 +517,7 @@ pub trait PaymentsCancelRequestData {
|
||||
fn get_amount(&self) -> Result<i64, Error>;
|
||||
fn get_currency(&self) -> Result<diesel_models::enums::Currency, Error>;
|
||||
fn get_cancellation_reason(&self) -> Result<String, Error>;
|
||||
fn get_browser_info(&self) -> Result<types::BrowserInformation, Error>;
|
||||
}
|
||||
|
||||
impl PaymentsCancelRequestData for PaymentsCancelData {
|
||||
@@ -525,11 +532,17 @@ impl PaymentsCancelRequestData for PaymentsCancelData {
|
||||
.clone()
|
||||
.ok_or_else(missing_field_err("cancellation_reason"))
|
||||
}
|
||||
fn get_browser_info(&self) -> Result<types::BrowserInformation, Error> {
|
||||
self.browser_info
|
||||
.clone()
|
||||
.ok_or_else(missing_field_err("browser_info"))
|
||||
}
|
||||
}
|
||||
|
||||
pub trait RefundsRequestData {
|
||||
fn get_connector_refund_id(&self) -> Result<String, Error>;
|
||||
fn get_webhook_url(&self) -> Result<String, Error>;
|
||||
fn get_browser_info(&self) -> Result<types::BrowserInformation, Error>;
|
||||
}
|
||||
|
||||
impl RefundsRequestData for types::RefundsData {
|
||||
@@ -545,6 +558,11 @@ impl RefundsRequestData for types::RefundsData {
|
||||
.clone()
|
||||
.ok_or_else(missing_field_err("webhook_url"))
|
||||
}
|
||||
fn get_browser_info(&self) -> Result<types::BrowserInformation, Error> {
|
||||
self.browser_info
|
||||
.clone()
|
||||
.ok_or_else(missing_field_err("browser_info"))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize)]
|
||||
|
||||
Reference in New Issue
Block a user