paymentlib/nswcpp/jsonb/
card.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Card {
    pub card_type: String,
    pub last_4_digits: String,
}

impl Card {
    pub fn normalize(&self) -> Card {
        Card {
            card_type: self.card_type.clone(),
            last_4_digits: self.last_4_digits.clone(),
        }
    }
}