fix improper use of array in StripeIPN
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
Activity
added 14 commits
-
bf2f5e3f...33d3c8ba - 13 commits from branch
extensions:master
- 307ff56c - fix improper use of array in StripeIPN
-
bf2f5e3f...33d3c8ba - 13 commits from branch
️ PASS: Unit Tests: https://github.com/semperit/CiviCARROT/actions/runs/6592383190 ️ PASS: Unit Tests: https://github.com/semperit/CiviCARROT/actions/runs/6592383190 ️ PASS: Unit Tests: https://github.com/semperit/CiviCARROT/actions/runs/6592395770 ️ PASS: Unit Tests: https://github.com/semperit/CiviCARROT/actions/runs/6592402577 ️ PASS: Unit Tests: https://github.com/semperit/CiviCARROT/actions/runs/6592395770 ️ PASS: Unit Tests: https://github.com/semperit/CiviCARROT/actions/runs/6592402577@JonGold It confuses me too. But I'm puzzled as to why it only fails with Stripe.ipn and Stripe.retryall?
@mattwire It looks like StripeObject as defined in the SDK implements the ArrayAccess interface:
class StripeObject implements \ArrayAccess, \Countable, \JsonSerializab
added 2 commits