Sha256: ffd89e44ea2780ff3db4a192c52e4ade4776e5b188d94a42be1d4795cc193dae

Contents?: true

Size: 535 Bytes

Versions: 6

Compression:

Stored size: 535 Bytes

Contents

# frozen_string_literal: true

module Afterpay
  module API
    module Payment
      class Void < Base
        def initialize(params = {})
          @order_id = params[:order_id]
          @payment = params[:payment]
        end

        private

        attr_reader :payment, :order_id

        def payload
          {
            action: :post,
            body: payment.as_json,
            endpoint: endpoint
          }
        end

        def endpoint
          "#{URL}/#{order_id}/void"
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
afterpay-0.6.0 lib/afterpay/api/payment/void.rb
afterpay-0.5.0 lib/afterpay/api/payment/void.rb
afterpay-0.4.0 lib/afterpay/api/payment/void.rb
afterpay-0.3.0 lib/afterpay/api/payment/void.rb
afterpay-0.2.0 lib/afterpay/api/payment/void.rb
afterpay-0.1.0 lib/afterpay/api/payment/void.rb