Sha256: 9d73381092a06bf9cc021a1aeb097aeb7949832068e03327aea25fc090c6df67

Contents?: true

Size: 525 Bytes

Versions: 1

Compression:

Stored size: 525 Bytes

Contents

module MonoMerchant
  module Invoice

    # Cancel successful payment
    class Cancel < ApiRequest

      attr_reader :ext_ref, :invoice_id, :amount, :items

      def initialize(invoice_id, amount, ext_ref: nil, items: [])
        @invoice_id, @amount, @items, @ext_ref = invoice_id, amount, items, ext_ref
        super()
      end

      protected

      def body
        { invoiceId: invoice_id,
          amount: amount,
          extRef: ext_ref,
          items: items.presence
        }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mono-merchant-0.2.0 lib/mono-merchant/invoice/cancel.rb