Skip to content

Commit

Permalink
feature: payment vault create payment
Browse files Browse the repository at this point in the history
  • Loading branch information
nsantiago2719 committed Dec 9, 2023
1 parent e6eacfc commit 2f99d7a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion payment-vault/Cargo.toml
Expand Up @@ -7,7 +7,8 @@ edition = "2021"

[dependencies]
reqwest = { version = "0.11.16", features = ["json"] }
serde = { version = "1.0.159", features = ["derive"]}
serde = { version = "1.0.159", features = ["derive"] }
tokio = { version = "1", features = ["full"] }
maya-client-sdk = { path = "../client" }
async-trait = "0.1.68"
serde_with = "3.4.0"
1 change: 1 addition & 0 deletions payment-vault/src/lib.rs
Expand Up @@ -2,6 +2,7 @@ use async_trait::async_trait;
use maya_client_sdk::MayaClient;
use reqwest::header::{ACCEPT, AUTHORIZATION, CONTENT_TYPE};
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;

pub use self::payment::CardDetails;

Expand Down
1 change: 1 addition & 0 deletions payment-vault/src/payment.rs
Expand Up @@ -112,6 +112,7 @@ pub struct MetaData {
pub pf: PaymentFacilitator,
}

#[skip_serializing_none]
#[derive(Debug, Serialize)]
#[allow(non_snake_case)]
pub struct Payment {
Expand Down
5 changes: 2 additions & 3 deletions payment-vault/tests/payment_gateway/payment_token.rs
Expand Up @@ -120,8 +120,7 @@ mod test_payment_token {
requestReferenceNumber: Some("332211".to_string()),
};
let create_payment = maya_client.create_payment(payment).await.unwrap();
println!("Created payment {:?}", create_payment);

// assert_eq!(create_payment.json(), 200);
println!("{:?}", create_payment.text().await.unwrap());
// assert_eq!(create_payment.status(), 200);
}
}

0 comments on commit 2f99d7a

Please sign in to comment.