module BtcpayManager
  class FetchInvoice < BtcpayManagerService
    def initialize(invoice_id:)
      @invoice_id = invoice_id
    end

    def call
      invoice = get "/invoices/#{@invoice_id}"
      payment_methods = get "/invoices/#{@invoice_id}/payment-methods"
      invoice["paymentMethods"] = payment_methods
      invoice
    end
  end
end
