From 34b8cadd8871c572f56e2fbc9923a63e0eb0948d Mon Sep 17 00:00:00 2001 From: Norman Santiago Date: Sat, 8 Apr 2023 06:18:15 +0800 Subject: [PATCH] added address struct --- payment-vault/src/payment.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/payment-vault/src/payment.rs b/payment-vault/src/payment.rs index 41198a0..29f86cd 100644 --- a/payment-vault/src/payment.rs +++ b/payment-vault/src/payment.rs @@ -15,6 +15,30 @@ struct Card { pub card: CardDetails, } +#[derive(Debug)] +pub enum ShippingType { + ST, + SD, +} + +#[derive(Debug, Serialize)] +#[allow(non_snake_case)] +pub struct Address { + pub line1: Option, + pub line2: Option, + pub city: Option, + pub state: Option, + pub zipCode: Option, + // ISO 3166 aplha-2 notion of the country + pub countryCode: String, + pub firstName: Option, + pub middleName: Option, + pub lastName: Option, + pub phone: Option, + pub email: Option, + pub shippingType: T, +} + #[async_trait] pub trait PaymentGateway { /// Returns a response that contains the paymentTokenId to be use for furhter transaction @@ -28,6 +52,12 @@ pub trait PaymentGateway { async fn create_payment(&self) -> Result>; } +impl Address { + fn new(&self) -> Self { + todo!() + } +} + /// Implement the PaymentGateway trait to MayaClient #[async_trait] impl PaymentGateway for MayaClient {