mirror of https://github.com/zulip/zulip.git
corporate: Fix type annotations for payment failed handler.
When being called, the wrapped function is passed `PaymentIntent` (the `content_object` of `Event`). With that, since `customer` can be `None`, an assertion is also required. Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
parent
4099e56a1f
commit
6277f09296
|
@ -161,11 +161,12 @@ def handle_payment_intent_succeeded_event(
|
||||||
|
|
||||||
@error_handler
|
@error_handler
|
||||||
def handle_payment_intent_payment_failed_event(
|
def handle_payment_intent_payment_failed_event(
|
||||||
stripe_payment_intent: stripe.PaymentIntent, payment_intent: Event
|
stripe_payment_intent: stripe.PaymentIntent, payment_intent: PaymentIntent
|
||||||
) -> None:
|
) -> None:
|
||||||
payment_intent.status = PaymentIntent.get_status_integer_from_status_text(
|
payment_intent.status = PaymentIntent.get_status_integer_from_status_text(
|
||||||
stripe_payment_intent.status
|
stripe_payment_intent.status
|
||||||
)
|
)
|
||||||
|
assert payment_intent.customer.realm is not None
|
||||||
billing_logger.info(
|
billing_logger.info(
|
||||||
"Stripe payment intent failed: %s %s %s %s",
|
"Stripe payment intent failed: %s %s %s %s",
|
||||||
payment_intent.customer.realm.string_id,
|
payment_intent.customer.realm.string_id,
|
||||||
|
|
Loading…
Reference in New Issue