Last active
May 23, 2024 10:58
-
-
Save mclarenmervin/33f846d58c54b2c161e27aad6bcb8ea1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// webhook: customer.subscription.deleted | |
$sec_key = 'sk_live_xxxxxxxxxxxxxxxxxx'; | |
require_once 'stripe-php/init.php'; | |
$stripe = new \Stripe\StripeClient($sec_key); | |
$last_invoice = $stripe->invoices->all(['limit' => 1]); | |
$invoice_id = $last_invoice->data[0]->id; | |
$stripe->invoices->voidInvoice($invoice_id, []); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment