Sha256: a1bddd9deef119e734460cdbebc38f22df7c84d026a62023f7747981bd88c3c1

Contents?: true

Size: 705 Bytes

Versions: 44

Compression:

Stored size: 705 Bytes

Contents

module MangoPay

  # See https://docs.mangopay.com/endpoints/v2.01/reporting
  class Report < Resource
    include HTTPCalls::Fetch

    class << self

      # +params+: hash; see https://docs.mangopay.com/endpoints/v2.01/reporting#e825_create-a-transaction-report
      def create(params, idempotency_key = nil)
        if params[:ReportType] == 'transactions'
          url = url() + '/transactions/'
        elsif params[:ReportType] == 'wallets'
          url = url() + '/wallets/'
        else
          raise 'When creating a report, ReportType is required. Ex: ("transactions", "wallets")'
        end

        MangoPay.request(:post, url, params, {}, idempotency_key)
      end

    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
mangopay-3.28.0 lib/mangopay/report.rb
mangopay-3.27.0 lib/mangopay/report.rb
mangopay-3.26.1 lib/mangopay/report.rb
mangopay-3.26.0 lib/mangopay/report.rb
mangopay-3.25.1 lib/mangopay/report.rb
mangopay-3.25.0 lib/mangopay/report.rb
mangopay-3.24.1 lib/mangopay/report.rb
mangopay-3.24.0 lib/mangopay/report.rb
mangopay-3.23.0 lib/mangopay/report.rb
mangopay-3.22.0 lib/mangopay/report.rb
mangopay-3.21.0 lib/mangopay/report.rb
mangopay-3.20.0 lib/mangopay/report.rb
mangopay-3.19.0 lib/mangopay/report.rb
mangopay-3.18.0 lib/mangopay/report.rb
mangopay-3.17.0 lib/mangopay/report.rb
mangopay-3.16.0 lib/mangopay/report.rb
mangopay-3.15.0 lib/mangopay/report.rb
mangopay-3.14.0 lib/mangopay/report.rb
mangopay-3.13.2 lib/mangopay/report.rb
mangopay-3.12.0 lib/mangopay/report.rb