Sha256: a2bef45d223b7ddb2a29d63609c33c28f528145e91b4aec459b28c1f9d7e5f95

Contents?: true

Size: 585 Bytes

Versions: 11

Compression:

Stored size: 585 Bytes

Contents

# frozen_string_literal: true

module Billomat
  module Actions
    # This actions cancels an invoice
    class Cancel
      # @param invoice_id [String] the invoice ID
      # @return [Billomat::Actions::Cancel]
      def initialize(invoice_id)
        @invoice_id = invoice_id
      end

      # Calls the gateway.
      #
      # @return [TrueClass]
      def call
        Billomat::Gateway.new(:put, path).run

        true
      end

      # @return [String] the cancel path with the invoice_id
      def path
        "/invoices/#{@invoice_id}/cancel"
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
billomat-1.2.5 lib/billomat/actions/cancel.rb
billomat-1.2.4 lib/billomat/actions/cancel.rb
billomat-1.2.3 lib/billomat/actions/cancel.rb
billomat-1.2.2 lib/billomat/actions/cancel.rb
billomat-1.2.1 lib/billomat/actions/cancel.rb
billomat-1.2.0 lib/billomat/actions/cancel.rb
billomat-1.1.0 lib/billomat/actions/cancel.rb
billomat-1.0.0 lib/billomat/actions/cancel.rb
billomat-0.4.1 lib/billomat/actions/cancel.rb
billomat-0.4.0 lib/billomat/actions/cancel.rb
billomat-0.3.0 lib/billomat/actions/cancel.rb