Skip to content

Migration guide for v8

anniel-stripe edited this page Nov 22, 2022 · 6 revisions

Deprecated

  • The save method is deprecated. Prefer the static update method that doesn't require retrieval of the resource to update it.
    # before
    refund = Stripe::Refund.retrieve("re_123")
    refund.description = "Refund description"
    refund.save
    
    # after
    Stripe::Refund.update("re_123", description: "Refund description")
    If you were using save to unset a parameter by assigning it a nil value, when switching to update please assign the parameter to an empty string "" to preserve the previous behavior.
    # before
    refund = Stripe::Refund.retrieve("re_123")
    refund.description = nil
    refund.save
    
    # after
    Stripe::Refund.update("re_123", description: "")
    
Clone this wiki locally