Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix charge tests #2

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/charge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async fn charge_create_test() {
.body(serde_json::to_string(&json).expect("failed to serialize body"))),
);

let client = Client::from_url(server.url_str("/").as_str(), "sk_test_12345");
let client = Client::from_url(server.url_str("/1/").as_str(), "sk_test_12345");

let charge = Charge::create(
&client,
Expand Down Expand Up @@ -110,7 +110,7 @@ async fn get_charge_test() {

let token = "ch_lfUYEBK14zotCTykezJkfg".parse().unwrap();

let client = Client::from_url(server.url_str("/").as_str(), "sk_test_12345");
let client = Client::from_url(server.url_str("/1/").as_str(), "sk_test_12345");
let charge = Charge::retrieve(&client, &token).await.unwrap();

assert_eq!(charge.token, "ch_lfUYEBK14zotCTykezJkfg");
Expand All @@ -137,7 +137,7 @@ async fn charge_void_test() {

let token = "ch_lfUYEBK14zotCTykezJkfg".parse().unwrap();

let client = Client::from_url(server.url_str("/").as_str(), "sk_test_12345");
let client = Client::from_url(server.url_str("/1/").as_str(), "sk_test_12345");
let charge = Charge::void(&client, &token).await.unwrap();

assert_eq!(charge.token, "ch_lfUYEBK14zotCTykezJkfg");
Expand Down Expand Up @@ -166,7 +166,7 @@ async fn charge_capture_test() {

let token = "ch_lfUYEBK14zotCTykezJkfg".parse().unwrap();

let client = Client::from_url(server.url_str("/").as_str(), "sk_test_12345");
let client = Client::from_url(server.url_str("/1/").as_str(), "sk_test_12345");
let charge = Charge::capture(&client, &token).await.unwrap();

assert_eq!(charge.token, "ch_lfUYEBK14zotCTykezJkfg");
Expand All @@ -188,7 +188,7 @@ async fn charge_list_test() {
respond_with(json_encoded(json)),
);

let client = Client::from_url(server.url_str("/").as_str(), "sk_test_12345");
let client = Client::from_url(server.url_str("/1/").as_str(), "sk_test_12345");
let charges = Charge::list(&client, None, None).await.unwrap();

assert_eq!(charges.items[0].token, "ch_lfUYEBK14zotCTykezJkfg");
Expand Down Expand Up @@ -217,7 +217,7 @@ async fn charge_verify_test() {

let session_token = "se_sGt9PuNYfVzJqTSLP2CV8g".parse().unwrap();

let client = Client::from_url(server.url_str("/").as_str(), "sk_test_12345");
let client = Client::from_url(server.url_str("/1/").as_str(), "sk_test_12345");
let charge = Charge::verify(&client, &session_token).await.unwrap();

assert_eq!(charge.success, true);
Expand Down