paymentlib/nswcpp/jsonb/
agency_completion_payment.rsuse crate::nswcpp::jsonb::b_pay::BPay;
use crate::nswcpp::jsonb::card::Card;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct AgencyCompletionPayment {
pub payment_method: String,
pub payment_reference: String,
pub payment_completion_reference: String,
pub bank_reference: String,
pub amount: f64,
pub surcharge: f64,
pub surcharge_gst: f64,
pub agency_transaction_id: String,
pub card: Option<Vec<Card>>,
pub b_pay: Option<Vec<BPay>>,
}
impl AgencyCompletionPayment {
pub fn normalize(&self) -> AgencyCompletionPayment {
AgencyCompletionPayment {
payment_method: self.payment_method.clone(),
payment_reference: self.payment_reference.clone(),
payment_completion_reference: self.payment_completion_reference.clone(),
bank_reference: self.bank_reference.clone(),
amount: self.amount,
surcharge: self.surcharge,
surcharge_gst: self.surcharge_gst,
agency_transaction_id: self.agency_transaction_id.clone(),
card: self.card.clone().clone(),
b_pay: self.b_pay.clone(),
}
}
}