paymentlib/nswcpp/jsonb/
notification_details.rsuse crate::nswcpp::jsonb::gateway_response::GatewayResponse;
use crate::nswcpp::jsonb::payment_components::PaymentComponents;
use serde::{Deserialize, Serialize};
use crate::nswcpp::enums::status::Status;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct NotificationDetails {
pub payment_reference: String,
pub status: Status,
pub payment_completion_reference: String,
pub requested_amount: f64,
pub amount: f64,
pub total_surcharge: f64,
pub payment_components: Vec<PaymentComponents>,
pub agency_transaction_id: String,
pub calling_system: String,
pub customer_reference: String,
pub gateway_response: Vec<GatewayResponse>,
}
impl NotificationDetails {
pub fn normalize(&self) -> NotificationDetails {
NotificationDetails {
payment_reference: self.payment_reference.clone(),
status: self.status.clone(),
payment_completion_reference: self.payment_completion_reference.clone(),
requested_amount: self.requested_amount,
amount: self.amount,
total_surcharge: self.total_surcharge,
payment_components: self.payment_components.clone(),
agency_transaction_id: self.agency_transaction_id.clone(),
calling_system: self.calling_system.clone(),
customer_reference: self.customer_reference.clone(),
gateway_response: self.gateway_response.clone(),
}
}
}