Class: Paysio::Charge

Inherits:
Resource show all
Includes:
Actions::Create, Actions::Find, Actions::List, Actions::Update
Defined in:
lib/paysio/resources/charge.rb

Instance Attribute Summary

Attributes inherited from Resource

#redirect

Instance Method Summary collapse

Methods included from Actions::Find

included

Methods included from Actions::Update

#save, #update

Methods included from Actions::Create

included

Methods included from Actions::List

included

Methods inherited from Resource

#action_path, #as_json, #attribute, #attributes, build_from, #each, #initialize, #inspect, #method_missing, path, #path, #refresh_from, resource, #to_hash, #to_json, #to_s

Constructor Details

This class inherits a constructor from Paysio::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Paysio::Resource

Instance Method Details

#invoiceObject



14
15
16
17
# File 'lib/paysio/resources/charge.rb', line 14

def invoice
  response = Paysio::Client.request(:get, action_path(:invoice))
  Resource.build_from(response.to_hash)
end

#refund(attrs = {}) ⇒ Object



9
10
11
12
# File 'lib/paysio/resources/charge.rb', line 9

def refund(attrs = {})
  response = Paysio::Client.request(:post, action_path(:refund), attrs)
  refresh_from(response.to_hash)
end