mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-06 00:02:18 -04:00
Usage on a top-level collection: ``` Stripe::Customer.list.auto_paging_each do |customer| puts customer end ``` Usage on a subcollection: ``` ruby customer.invoices.auto_paging_each do |invoice| puts invoice end ``` We've also renamed `#all` to `#list` to prevent confusion ("all" implies that all resources are being returned, and in Stripe's paginated API this was not the case). An alias has been provided for backward API compatibility. Fixes #167. Replaces #211 and #248.
15 lines
438 B
Ruby
15 lines
438 B
Ruby
module Stripe
|
|
class Reversal < APIResource
|
|
include Stripe::APIOperations::Update
|
|
extend Stripe::APIOperations::List
|
|
|
|
def url
|
|
"#{Transfer.url}/#{CGI.escape(transfer)}/reversals/#{CGI.escape(id)}"
|
|
end
|
|
|
|
def self.retrieve(id, opts={})
|
|
raise NotImplementedError.new("Reversals cannot be retrieved without a transfer ID. Retrieve a reversal using transfer.reversals.retrieve('reversal_id')")
|
|
end
|
|
end
|
|
end
|