Sha256: d9f4c7e0993f04adc877aa8af5215531a275848a29b3ce2b86a4bcbb1e45c341

Contents?: true

Size: 537 Bytes

Versions: 6

Compression:

Stored size: 537 Bytes

Contents

# frozen_string_literal: true

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

        private

        attr_reader :refund, :order_id

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

        def endpoint
          "#{URL}/#{order_id}/refund"
        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/refund.rb
afterpay-0.5.0 lib/afterpay/api/payment/refund.rb
afterpay-0.4.0 lib/afterpay/api/payment/refund.rb
afterpay-0.3.0 lib/afterpay/api/payment/refund.rb
afterpay-0.2.0 lib/afterpay/api/payment/refund.rb
afterpay-0.1.0 lib/afterpay/api/payment/refund.rb