fix: InvoicePaymentFailed event
This commit is contained in:
parent
ea13526515
commit
2be2409d66
1 changed files with 3 additions and 3 deletions
|
@ -262,12 +262,12 @@ pub async fn stripe_webhook(
|
||||||
}
|
}
|
||||||
EventType::InvoicePaymentFailed => {
|
EventType::InvoicePaymentFailed => {
|
||||||
// payment failed
|
// payment failed
|
||||||
let subscription = match req.data.object {
|
let invoice = match req.data.object {
|
||||||
EventObject::Subscription(c) => c,
|
EventObject::Invoice(i) => i,
|
||||||
_ => unreachable!("cannot be this"),
|
_ => unreachable!("cannot be this"),
|
||||||
};
|
};
|
||||||
|
|
||||||
let customer_id = subscription.customer.id();
|
let customer_id = invoice.customer.expect("TETRATTO_STRIPE_NO_CUSTOMER").id();
|
||||||
|
|
||||||
let user = match data.get_user_by_stripe_id(customer_id.as_str()).await {
|
let user = match data.get_user_by_stripe_id(customer_id.as_str()).await {
|
||||||
Ok(ua) => ua,
|
Ok(ua) => ua,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue