Skip to content

Migration guide for v10

anniel-stripe edited this page Nov 22, 2022 · 1 revision

Changes in 10.0.0 - 2022-11-15

"⚠️" symbol highlights breaking changes.

Deprecated

  • #1382 Mark resource.save as deprecated. Prefer the static update method that doesn't require retrieval of the resource to update it.
    // before
    $resource = $stripe->prices->retrieve('price_123');
    $resource->metadata['key'] = 'value';
    $resource->save();
    
    // after
    $resource = $stripe->prices->update('price_123', [
        'metadata' => ['key' => 'value'],
    ]);
    If you were using save to unset a parameter by assigning it NULL, when switching to update please assign the parameter to an empty string '' to preserve the previous behavior.
    // before
    $resource = $stripe->prices->retrieve('price_123');
    $resource->description = NULL;
    $resource->save();
    
    // after
    $resource = $stripe->prices->update('price_123', [
        'description' => '',
    ]);

⚠️ Removed

  • #1377 Removed deprecated Sku resource and service
  • #1375 Removed deprecated Orders resource and service
  • #1375 Removed deprecated Product field from the LineItem
  • #1388 Removed deprecated AlipayAccount resource
  • #1396 Removed charges field on PaymentIntent and replace it with latest_charge.

Read more at https://stripe.com/docs/upgrades#2022-11-15