Skip to content
Snippets Groups Projects

fix improper use of array in StripeIPN

Merged JonGold requested to merge JonGold/stripe:ipn-array into master

To fix missing data from before the mjwshared 1.2.17 fix, I tried Stripe.ipn and Stripe.retryall APIs. Both gave me an error that I can't access on object as an array.

At first I thought there were two code paths to Civi\Stripe\Webhook\Events::setData(), one that provides an array, the other an object. But lines like:

if (($this->getData()->object['object'] ?? '') !== 'invoice') {

are immediately followed by lines like:

$invoiceID = $this->api->getValueFromStripeObject('invoice_id', 'String', $this->getData()->object);

One requires $this->getData()->object to be an array, the other an object, so they both can't be right.

This standardizes all usages of $this->getData()->object to treat it as an object.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading