Class: BillForward::PaymentMethod

Inherits:
MutableEntity show all
Defined in:
lib/bill_forward/entities/payment_method.rb

Instance Attribute Summary

Attributes inherited from BillingEntity

#_client

Class Method Summary collapse

Methods inherited from MutableEntity

#delete, #initialize, #save

Methods inherited from InsertableEntity

create, #initialize

Methods inherited from BillingEntity

#[], #[]=, #_dump, _load, build_entity, build_entity_array, #camel_case_lower, get_all, get_by_id, #initialize, #method_missing, request_ambiguous, request_first_heterotyped, request_many_heterotyped, #serialize, #serialize_field, singleton_client, #state_params, #to_json, #to_ordered_hash, #to_s, #to_unordered_hash

Constructor Details

This class inherits a constructor from BillForward::MutableEntity

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BillForward::BillingEntity

Class Method Details

.get_by_account_id(id, query_params = {}, custom_client = nil) ⇒ Object

Raises:

  • (ArgumentError)


16
17
18
19
20
21
22
23
24
# File 'lib/bill_forward/entities/payment_method.rb', line 16

def (id, query_params = {}, custom_client = nil)
  raise ArgumentError.new("id cannot be nil") if id.nil?

  endpoint = sprintf('account/%s',
                     ERB::Util.url_encode(id)
  )

  self.request_many('get', endpoint, query_params, custom_client)
end

Raises:

  • (ArgumentError)


6
7
8
9
10
11
12
13
14
# File 'lib/bill_forward/entities/payment_method.rb', line 6

def get_by_link_id(id, query_params = {}, custom_client = nil)
  raise ArgumentError.new("id cannot be nil") if id.nil?

  endpoint = sprintf('link-id/%s',
                     ERB::Util.url_encode(id)
  )

  self.request_first('get', endpoint, query_params, custom_client)
end