Skip to content
Open
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: 7 additions & 5 deletions ows/crates/ows-cli/src/commands/pay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ pub fn run(

let result = rt.block_on(ows_pay::pay(&wallet, url, method, body))?;

if let Some(ref payment) = result.payment {
if result.status >= 400 {
if result.payment.is_some() {
eprintln!("HTTP {} — payment rejected by server", result.status);
} else {
eprintln!("HTTP {}", result.status);
}
} else if let Some(ref payment) = result.payment {
if !payment.amount.is_empty() {
eprintln!(
"Paid {} on {} via {}",
Expand All @@ -116,10 +122,6 @@ pub fn run(
}
}

if result.status >= 400 {
eprintln!("HTTP {}", result.status);
}

println!("{}", result.body);
Ok(())
}
Expand Down
Loading