Module: FatZebra::APIOperation::Void

Included in:
Purchase, Refund
Defined in:
lib/fat_zebra/api_operation/void.rb

Overview

Void a resource for the API

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



48
49
50
# File 'lib/fat_zebra/api_operation/void.rb', line 48

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#void(params = {}, options = {}) ⇒ FatZebra::Object

Void an API Resource

Parameters:

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

    for the request

  • Additional (Hash)

    options for the request

Returns:

  • (FatZebra::Object)

    response from the API



39
40
41
42
43
44
45
46
# File 'lib/fat_zebra/api_operation/void.rb', line 39

def void(params = {}, options = {})
  params = {
    id: id
  }.merge(params)

  response = request(:post, "#{resource_path}/void", params, options)
  update_from(response)
end