paymentlib/nswcpp/jsonb/
gateway_response.rs

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

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct GatewayResponse {
    pub response_code: String,
    pub response_description: String,
    pub summary_code: String,
    pub transaction_type: String,
}

impl GatewayResponse {
    pub fn normalize(&self) -> GatewayResponse {
        GatewayResponse {
            response_code: self.response_code.clone(),
            response_description: self.response_description.clone(),
            summary_code: self.summary_code.clone(),
            transaction_type: self.transaction_type.clone(),
        }
    }
}