Class: Tickethub::Supplier::Payment

Inherits:
Resource
  • Object
show all
Defined in:
lib/tickethub/supplier/payment.rb

Direct Known Subclasses

Card, Cash, Complimentary, Credit, Direct

Defined Under Namespace

Classes: Card, Cash, Complimentary, Credit, Direct

Instance Attribute Summary

Attributes inherited from Resource

#endpoint

Instance Method Summary collapse

Methods inherited from Resource

#==, #[], #[]=, all, association, attribute, attributes, collection, descendants, #destroy, dump_value, #eql?, #errors, #hash, inherited, #initialize, #inspect, load, #load, load_value, path, polymorphic, register_type, registered_types, #reload!, #respond_to?, scope, scopes, serialize, singleton?, #to_h, #to_param, #to_s, #update, #valid?

Constructor Details

This class inherits a constructor from Tickethub::Resource

Dynamic Method Handling

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

Instance Method Details

#refund(attributes) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/tickethub/supplier/payment.rb', line 28

def refund(attributes)
  self.load @endpoint[:refund].post(attributes).decoded
  return true
rescue Tickethub::ResourceInvalid => err
  self.load Tickethub::Response.new(err.response).decoded
  return false
end