diff --git a/examples/transaction.rs b/examples/transaction.rs index 46d0e9d..8677df7 100644 --- a/examples/transaction.rs +++ b/examples/transaction.rs @@ -25,6 +25,7 @@ async fn main() { .email("email@example.com".to_string()) .currency(Some(Currency::NGN)) .channels(Some(vec![ + Channel::Card, Channel::ApplePay, Channel::Bank, Channel::BankTransfer, diff --git a/tests/api/charge.rs b/tests/api/charge.rs index 975409e..1970898 100644 --- a/tests/api/charge.rs +++ b/tests/api/charge.rs @@ -2,6 +2,9 @@ use crate::helpers::get_paystack_client; use paystack::{Channel, ChargeBodyBuilder, Currency}; use rand::Rng; +/// Values are hardcoded in this test because of the nature of the test. +/// The values reflect the values in my integration. +/// If you can come up with a way to improve this test, take a stab at it. #[tokio::test] async fn charge_authorization_succeeds() { // Arrange @@ -12,9 +15,9 @@ async fn charge_authorization_succeeds() { // In this test, an already created customer in the integration is used let amount = rng.gen_range(100..=100000).to_string(); let charge = ChargeBodyBuilder::default() - .email("melyssa@example.net".to_string()) + .email("susanna@example.net".to_string()) .amount(amount) - .authorization_code("AUTH_9v3686msvt".to_string()) + .authorization_code("AUTH_ik4t69fo2y".to_string()) .currency(Some(Currency::NGN)) .channel(Some(vec![Channel::Card])) .transaction_charge(Some(100)) @@ -31,7 +34,7 @@ async fn charge_authorization_succeeds() { assert!(charge_response.status); assert_eq!( charge_response.data.customer.unwrap().email.unwrap(), - "melyssa@example.net" + "susanna@example.net" ); assert_eq!( charge_response @@ -50,6 +53,6 @@ async fn charge_authorization_succeeds() { .unwrap() .authorization_code .unwrap(), - "AUTH_9v3686msvt" + "AUTH_ik4t69fo2y" ); } diff --git a/tests/api/transaction.rs b/tests/api/transaction.rs index 992403b..9772dac 100644 --- a/tests/api/transaction.rs +++ b/tests/api/transaction.rs @@ -22,6 +22,7 @@ async fn initialize_transaction_valid() { .email(email) .currency(Some(Currency::NGN)) .channels(Some(vec![ + Channel::Card, Channel::ApplePay, Channel::BankTransfer, Channel::Bank, @@ -35,7 +36,7 @@ async fn initialize_transaction_valid() { .await .expect("Unable to initialize transaction"); - // println!("{:#?}", res); + println!("{:#?}", res); // Assert assert!(res.status);