Invoice objects with null charges?

770 views
Skip to first unread message

Jose

unread,
Nov 13, 2014, 11:29:49 AM11/13/14
to api-d...@lists.stripe.com
Hello,

The documentation for the invoice object states that the charge field can be null if there are no previous charges related to the invoice. We're receiving invoice.payment_failed events with null charges and some with filled in charges and I'd think that the invoice.payment_failed event will always have the charge value filled in as a previous charge attempt was made and it failed. Is this correct?

To give some context, we're trying to get the charge to be able to get the reason why the invoice payment failed (it would be super nice if we could also get that information from the invoice).

Thanks,
Jose

Tender.io

Jim Danz

unread,
Nov 14, 2014, 1:59:23 AM11/14/14
to api-d...@lists.stripe.com
Hi Jose,

One reason that an invoice could fail payment and still have
charge=null is the case of a customer not having an active credit card
attached. If we are attempting payment on the invoice and the
customer has no card, there will be no actual charge object created,
so the invoice will continue to have charge=null.

If you're processing events as they're created, you should be able to
verify that case by fetching the customer and confirming that their
`cards` list is empty.

If you see in invoice.payment_failed with no charge=null where the
customer does in fact have a non-empty `cards` list, nothing comes to
mind right now about how that could happen, but I'd be happy to take a
look if you see such a case.

Hope that helps! Sorry that we don't expose this information more directly.
Jim
> --
> You received this message because you are subscribed to the Google Groups
> "Stripe API Discussion" group.
> To post to this group, send email to api-d...@lists.stripe.com.
> Visit this group at
> http://groups.google.com/a/lists.stripe.com/group/api-discuss/.
>
> To unsubscribe from this group and stop receiving emails from it, send an
> email to api-discuss...@lists.stripe.com.
Reply all
Reply to author
Forward
0 new messages