Class: Openpix::RubySdk::Resources::Payment

Inherits:
Resource
  • Object
show all
Defined in:
lib/openpix/ruby_sdk/resources/payment.rb

Overview

Make API operations on Payment resource

Constant Summary collapse

ATTRS =
%w[
  value
  destinationAlias
  correlationID
  comment
  sourceAccountId
].freeze

Instance Method Summary collapse

Methods inherited from Resource

#fetch, #fetch!, #fetch_next_page!, #fetch_previous_page!, #find, #find!, #initialize, #save, #save!, #to_body, #to_collection_resource, #to_single_resource

Constructor Details

This class inherits a constructor from Openpix::RubySdk::Resources::Resource

Instance Method Details

#create_attributesObject



29
30
31
# File 'lib/openpix/ruby_sdk/resources/payment.rb', line 29

def create_attributes
  ATTRS
end

#destroy(id:) ⇒ Object

rubocop:disable Lint/UnusedMethodArgument



38
39
40
41
42
43
# File 'lib/openpix/ruby_sdk/resources/payment.rb', line 38

def destroy(id:)
  raise(
    ActionNotImplementedError,
    'payment does not implement DELETE action'
  )
end

#destroy!(id:) ⇒ Object



45
46
47
48
49
50
# File 'lib/openpix/ruby_sdk/resources/payment.rb', line 45

def destroy!(id:)
  raise(
    ActionNotImplementedError,
    'payment does not implement DELETE action'
  )
end

#init_body(params: {}, rest: {}) ⇒ Object

Parameters:

  • params (Hash{String => String, Number, Hash{String, Number}, Array<Hash{String, String}>}) (defaults to: {})

    the attributes for creating a Charge

  • rest (Hash) (defaults to: {})

    more attributes to be merged at the body, use this only for unsupported fields



25
26
27
# File 'lib/openpix/ruby_sdk/resources/payment.rb', line 25

def init_body(params: {}, rest: {})
  super(base_attrs: ATTRS, params: params, rest: rest)
end

#to_urlObject



33
34
35
# File 'lib/openpix/ruby_sdk/resources/payment.rb', line 33

def to_url
  'payment'
end