Skip to content

Commit

Permalink
Merge pull request #518 from ferrohd/invoice-void-feature
Browse files Browse the repository at this point in the history
feat: add `Invoice::void`
  • Loading branch information
arlyon authored Jul 23, 2024
2 parents 0a00d31 + 94816f9 commit eb9c5cc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/resources/invoice_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ impl Invoice {
pub fn search(client: &Client, params: InvoiceSearchParams) -> Response<SearchList<Invoice>> {
client.get_query("/invoices/search", params)
}

/// Voids an invoice.
///
/// For more details see <https://stripe.com/docs/api/invoices/void>.
pub fn void(client: &Client, invoice_id: &InvoiceId) -> Response<Invoice> {
client.post(&format!("/invoices/{}/void", invoice_id))
}
}

#[derive(Clone, Debug, Serialize)]
Expand Down

0 comments on commit eb9c5cc

Please sign in to comment.