Skip to content
Snippets Groups Projects
Commit fcbc3d55 authored by mattwire's avatar mattwire
Browse files

Fix charge.failed - handle both collapsed and expanded invoice in charge

parent 5432745b
Branches
Tags
1 merge request!217Implement Stripe Checkout (with support for SEPA and ACH)
......@@ -53,7 +53,13 @@ class CRM_Stripe_Api {
return self::formatDate($stripeObject->created);
case 'invoice_id':
return (string) $stripeObject->invoice;
// Handle both "expanded" and "collapsed" response
if (is_object($stripeObject->invoice)) {
return (string) $stripeObject->invoice->id;
}
else {
return (string) $stripeObject->invoice;
}
case 'captured':
return (bool) $stripeObject->captured;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment