You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was following the instructions at https://stripe.com/docs/connect/identity-verification-api#additional-owners to update a connected account with a second additional owner. I noticed that the code actually raises a Undefined offset: 1 'error'. With default PHP settings, this is just a notice, and it isn't even logged.
The error seems to come from serializeAdditionalOwners:
if (!$originalValue || ($update != $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) {
$updateArr[$i] = $update;
}
}
}
$additionalOwners is the new value being passed in(which may be larger than the existing $originalValue), so we basically rely on being able to set an array property at an index that doesn't currently exist($originalValue[$i]). This works fine generally since it only throws an E_NOTICE level error.
However, if you have set up your PHP environment to convert errors into fatal exceptions(http://php.net/manual/en/class.errorexception.php#errorexception.examples), this can be a problem. I'm not sure how to proceed here since I'm not very familiar with PHP best practises — is it a problem that we generate an E_NOTICE level error and something that we should fix?
is it a problem that we generate an E_NOTICE level error and something that we should fix?
Yep, definitely.
This is probably my bad -- I ported the serialization logic over from stripe-ruby a while back, but Ruby simply returns a null value when trying to access invalid keys in a hash, without any warnings. I'll work on a fix.
I was following the instructions at https://stripe.com/docs/connect/identity-verification-api#additional-owners to update a connected account with a second additional owner. I noticed that the code actually raises a
Undefined offset: 1
'error'. With default PHP settings, this is just a notice, and it isn't even logged.The error seems to come from
serializeAdditionalOwners
:stripe-php/lib/Account.php
Lines 229 to 237 in b078870
$additionalOwners
is the new value being passed in(which may be larger than the existing$originalValue
), so we basically rely on being able to set an array property at an index that doesn't currently exist($originalValue[$i]
). This works fine generally since it only throws an E_NOTICE level error.However, if you have set up your PHP environment to convert errors into fatal exceptions(http://php.net/manual/en/class.errorexception.php#errorexception.examples), this can be a problem. I'm not sure how to proceed here since I'm not very familiar with PHP best practises — is it a problem that we generate an E_NOTICE level error and something that we should fix?
I have a repro script here : https://gist.github.com/karlr-stripe/a9447ef36d688afd84a5c1f3f9b294cf
You can workaround this by updating the account object this way instead :
The text was updated successfully, but these errors were encountered: