Class: Invoiced::Transaction
- Defined in:
- lib/invoiced/transaction.rb
Constant Summary collapse
- OBJECT_NAME =
'transaction'
Instance Attribute Summary
Attributes inherited from Object
Instance Method Summary collapse
- #initiate_charge(params = {}, opts = {}) ⇒ Object
- #refund(params = {}, opts = {}) ⇒ Object
- #send(params = {}, opts = {}) ⇒ Object
Methods included from Operations::Delete
Methods included from Operations::Update
Methods included from Operations::Create
Methods included from Operations::List
Methods inherited from Object
#[], #[]=, #add_accessors, #build_endpoint, #each, #endpoint, #endpoint_base, #initialize, #inspect, #keys, #metaclass, #method_missing, #refresh_from, #remove_accessors, #retrieve, #set_endpoint_base, #to_hash, #to_json, #to_s, #values
Constructor Details
This class inherits a constructor from Invoiced::Object
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Invoiced::Object
Instance Method Details
#initiate_charge(params = {}, opts = {}) ⇒ Object
24 25 26 27 28 |
# File 'lib/invoiced/transaction.rb', line 24 def initiate_charge(params={}, opts={}) response = @client.request(:post, "/charges", params, opts) Util.convert_to_object(self, response[:body]) end |
#refund(params = {}, opts = {}) ⇒ Object
18 19 20 21 22 |
# File 'lib/invoiced/transaction.rb', line 18 def refund(params={}, opts={}) response = @client.request(:post, "#{self.endpoint()}/refunds", params, opts) Util.convert_to_object(self, response[:body]) end |
#send(params = {}, opts = {}) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/invoiced/transaction.rb', line 10 def send(params={}, opts={}) response = @client.request(:post, "#{self.endpoint()}/emails", params, opts) # build email objects email = Email.new(@client) Util.build_objects(email, response[:body]) end |