Skip to content

Commit

Permalink
change option<string> to string
Browse files Browse the repository at this point in the history
  • Loading branch information
nsantiago2719 committed Aug 10, 2023
1 parent 74d4877 commit 48dd0af
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
22 changes: 11 additions & 11 deletions payment-vault/src/payment.rs
Expand Up @@ -60,19 +60,19 @@ pub struct RedirectUrl {
#[derive(Debug, Serialize)]
#[allow(non_snake_case)]
pub struct ShippingAddress<T = ShippingType> {
pub line1: Option<String>,
pub line2: Option<String>,
pub city: Option<String>,
pub state: Option<String>,
pub zipCode: Option<String>,
pub line1: String,
pub line2: String,
pub city: String,
pub state: String,
pub zipCode: String,
// ISO 3166 alpha-2 notion of the country
pub countryCode: Option<String>,
pub countryCode: String,
pub firstName: String,
pub lastName: Option<String>,
pub middleName: Option<String>,
pub phone: Option<String>,
pub email: Option<String>,
shippingType: T,
pub lastName: String,
pub middleName: String,
pub phone: String,
pub email: String,
pub shippingType: T,
}

#[derive(Debug, Serialize)]
Expand Down
18 changes: 17 additions & 1 deletion payment-vault/tests/payment_gateway/payment_token.rs
@@ -1,6 +1,7 @@
use maya_client_sdk::MayaClient;
use maya_payment_vault_sdk::payment::payment_gateway::*;
use maya_payment_vault_sdk::payment::*;

#[cfg(test)]
mod test_payment_token {

Expand Down Expand Up @@ -38,13 +39,28 @@ mod test_payment_token {

#[tokio::test]
async fn create_payment() {
let billing_address = BillingAddress {
let _billing_address = BillingAddress {
line1: "Street 123".to_string(),
line2: "Brgy. Poblacion".to_string(),
city: "Mandaluyong".to_string(),
state: "Philippines".to_string(),
zipCode: "2313".to_string(),
countryCode: "PH".to_string(),
};

let _shipping_address: ShippingAddress = ShippingAddress {
line1: "Street 123".to_string(),
line2: "Brgy. Poblacion".to_string(),
city: "Mandaluyong".to_string(),
state: "Philippines".to_string(),
zipCode: "2313".to_string(),
countryCode: "PH".to_string(),
firstName: "John".to_string(),
lastName: "Doe".to_string(),
middleName: "".to_string(),
email: "john.doe@example.com".to_string(),
phone: "12345567889".to_string(),
shippingType: ShippingType::ST,
};
}
}

0 comments on commit 48dd0af

Please sign in to comment.