Sha256: 7a724a7d8c4cc1b532e93dcdbbcc86c728bdb9754e4e3d16c39dc023750ca39f

Contents?: true

Size: 618 Bytes

Versions: 5

Compression:

Stored size: 618 Bytes

Contents

module Stripe
  class Charge < APIResource
    include Stripe::APIOperations::List
    include Stripe::APIOperations::Create
    include Stripe::APIOperations::Update

    def refund(params={})
      response, api_key = Stripe.request(:post, refund_url, @api_key, params)
      refresh_from(response, api_key)
      self
    end

    def capture(params={})
      response, api_key = Stripe.request(:post, capture_url, @api_key, params)
      refresh_from(response, api_key)
      self
    end

    private

    def refund_url
      url + '/refund'
    end

    def capture_url
      url + '/capture'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
stripe-1.7.6 lib/stripe/charge.rb
stripe-1.7.4 lib/stripe/charge.rb
stripe-1.7.3 lib/stripe/charge.rb
stripe-1.7.2 lib/stripe/charge.rb
stripe-1.7.1 lib/stripe/charge.rb