Sha256: acb87f27e3af7ef0bba1bf188859abc4316162f488fe8ff8a67e8df60694283d

Contents?: true

Size: 781 Bytes

Versions: 4

Compression:

Stored size: 781 Bytes

Contents

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

    def refund(params = {}, opts = {})
      response, opts = request(:post, refund_url, params, opts)
      refresh_from(response, opts)
    end

    def capture(params = {}, opts = {})
      response, opts = request(:post, capture_url, params, opts)
      refresh_from(response, opts)
    end

    def reauth(params = {}, opts = {})
      response, opts = request(:post, reauth_url, params, opts)
      refresh_from(response, opts)
    end

    private

    def refund_url
      url + '/refund'
    end

    def capture_url
      url + '/capture'
    end

    def reauth_url
      url + '/reauth'
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
payjp-0.0.9 lib/payjp/charge.rb
payjp-0.0.8 lib/payjp/charge.rb
payjp-0.0.7 lib/payjp/charge.rb
payjp-0.0.6 lib/payjp/charge.rb