Class: MangoPay::Report

Inherits:
Resource show all
Includes:
HTTPCalls::Fetch
Defined in:
lib/mangopay/report.rb

Overview

Class Method Summary collapse

Methods included from HTTPCalls::Fetch

included, parse_id_or_filters

Methods inherited from Resource

class_name, url

Class Method Details

.create(params, idempotency_key = nil) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/mangopay/report.rb', line 10

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