Bump stripe-php from 19.4.1 to 20.0.0

This commit is contained in:
johnnyq
2026-04-08 12:44:45 -04:00
parent 346d7ed9f0
commit 123a581583
160 changed files with 957 additions and 279 deletions

View File

@@ -296,6 +296,16 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable
$values = $values->toArray();
}
// Apply int64_string response coercion on raw values before hydration.
// V2 resource classes declare fieldEncodings() with metadata about which
// fields are int64_string (wire format: JSON string, SDK type: PHP int).
if (\method_exists(static::class, 'fieldEncodings')) {
$encodings = static::fieldEncodings();
if (!empty($encodings)) {
$values = Util\Int64::coerceResponseValues($values, $encodings);
}
}
// Wipe old state before setting new. This is useful for e.g. updating a
// customer, where there is no persistent card parameter. Mark those values
// which don't persist as transient
@@ -331,7 +341,8 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable
// This is necessary in case metadata is empty, as PHP arrays do
// not differentiate between lists and hashes, and we consider
// empty arrays to be lists.
if (('metadata' === $k) && \is_array($v)) {
// The same applies to the previous_attributes attribute.
if (('metadata' === $k || 'previous_attributes' === $k) && \is_array($v)) {
$this->_values[$k] = StripeObject::constructFrom($v, $opts, $apiMode);
} else {
$this->_values[$k] = Util\Util::convertToStripeObject($v, $opts, $apiMode);