Class: Billomat::Actions::Cancel

Inherits:
Object
  • Object
show all
Defined in:
lib/billomat/actions/cancel.rb

Overview

This actions cancels an invoice

Instance Method Summary collapse

Constructor Details

#initialize(invoice_id) ⇒ Billomat::Actions::Cancel

Parameters:

  • invoice_id (String)

    The invoice ID



10
11
12
# File 'lib/billomat/actions/cancel.rb', line 10

def initialize(invoice_id)
  @invoice_id = invoice_id
end

Instance Method Details

#callTrueClass

Calls the gateway

Returns:

  • (TrueClass)


18
19
20
21
22
# File 'lib/billomat/actions/cancel.rb', line 18

def call
  Billomat::Gateway.new(:put, path).run

  true
end

#pathString

Returns The cancel path with the invoice_id.

Returns:

  • (String)

    The cancel path with the invoice_id



25
26
27
# File 'lib/billomat/actions/cancel.rb', line 25

def path
  "/invoices/#{@invoice_id}/cancel"
end