mangopay 3.0.11 → 3.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/README.md +26 -0
- data/lib/mangopay.rb +97 -105
- data/lib/mangopay/bank_account.rb +4 -4
- data/lib/mangopay/card.rb +2 -2
- data/lib/mangopay/card_registration.rb +3 -3
- data/lib/mangopay/client.rb +1 -1
- data/lib/mangopay/errors.rb +35 -1
- data/lib/mangopay/event.rb +16 -16
- data/lib/mangopay/hook.rb +3 -3
- data/lib/mangopay/http_calls.rb +1 -1
- data/lib/mangopay/json.rb +6 -15
- data/lib/mangopay/kyc_document.rb +3 -3
- data/lib/mangopay/legal_user.rb +2 -2
- data/lib/mangopay/natural_user.rb +2 -2
- data/lib/mangopay/pay_in.rb +47 -0
- data/lib/mangopay/pay_out.rb +13 -0
- data/lib/mangopay/pre_authorization.rb +11 -0
- data/lib/mangopay/refund.rb +1 -1
- data/lib/mangopay/resource.rb +3 -3
- data/lib/mangopay/transaction.rb +1 -1
- data/lib/mangopay/transfer.rb +3 -3
- data/lib/mangopay/user.rb +3 -3
- data/lib/mangopay/version.rb +1 -1
- data/lib/mangopay/wallet.rb +5 -5
- data/mangopay.gemspec +3 -6
- data/spec/{lib/mangopay → mangopay}/authorization_token_spec.rb +70 -72
- data/spec/{lib/mangopay → mangopay}/bank_account_spec.rb +0 -2
- data/spec/{lib/mangopay → mangopay}/card_registration_spec.rb +0 -2
- data/spec/{lib/mangopay → mangopay}/client_spec.rb +2 -4
- data/spec/{lib/mangopay → mangopay}/configuration_spec.rb +18 -20
- data/spec/{lib/mangopay → mangopay}/event_spec.rb +31 -33
- data/spec/{lib/mangopay → mangopay}/fetch_filters_spec.rb +0 -2
- data/spec/{lib/mangopay → mangopay}/hook_spec.rb +0 -2
- data/spec/{lib/mangopay → mangopay}/kyc_document_spec.rb +58 -60
- data/spec/{lib/mangopay → mangopay}/payin_bankwire_direct_spec.rb +0 -2
- data/spec/{lib/mangopay → mangopay}/payin_card_direct_spec.rb +0 -2
- data/spec/{lib/mangopay → mangopay}/payin_card_web_spec.rb +54 -56
- data/spec/{lib/mangopay → mangopay}/payin_preauthorized_direct_spec.rb +0 -2
- data/spec/{lib/mangopay → mangopay}/payout_bankwire_spec.rb +54 -56
- data/spec/{lib/mangopay → mangopay}/preauthorization_spec.rb +0 -2
- data/spec/{lib/mangopay → mangopay}/refund_spec.rb +0 -2
- data/spec/{lib/mangopay → mangopay}/shared_resources.rb +0 -4
- data/spec/{lib/mangopay → mangopay}/transaction_spec.rb +0 -2
- data/spec/{lib/mangopay → mangopay}/transfer_spec.rb +0 -2
- data/spec/{lib/mangopay → mangopay}/user_spec.rb +0 -2
- data/spec/{lib/mangopay → mangopay}/wallet_spec.rb +87 -89
- data/spec/spec_helper.rb +28 -20
- metadata +53 -95
- data/lib/mangopay/payin.rb +0 -47
- data/lib/mangopay/payout.rb +0 -13
- data/lib/mangopay/preauthorization.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57a5f31ff878a4a9988ae5bbbeec2bd486f12c9a
|
4
|
+
data.tar.gz: b6f9ade3a53e81ed24050cda7ed5af6ba44af521
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f41b043ef15a410cb45269d7f244176d75f10744ad565f2601032e22ea97be59e6d5beddc5fc933f45ce937a6ce80e4302d29e02554c73688645b1d115043017
|
7
|
+
data.tar.gz: 3a32c7cf5bd666e30a54cfb0e789f09b0d09a14b9cdb4d03094b31198f78a566e76925db4c2b3755c5be1067ecd4f6890345efb3a95bc6a300894191e30c4f72
|
data/.rspec
CHANGED
data/README.md
CHANGED
@@ -34,6 +34,7 @@ between you and the MangoPay Team.
|
|
34
34
|
```ruby
|
35
35
|
require 'mangopay'
|
36
36
|
|
37
|
+
|
37
38
|
# configuration (not required if Rails generator fired as above)
|
38
39
|
MangoPay.configure do |c|
|
39
40
|
c.preproduction = true
|
@@ -41,19 +42,44 @@ MangoPay.configure do |c|
|
|
41
42
|
c.client_passphrase = 'YOUR_CLIENT_PASSWORD'
|
42
43
|
end
|
43
44
|
|
45
|
+
|
44
46
|
# get some user by id
|
45
47
|
john = MangoPay::User.fetch(john_id) # => {FirstName"=>"John", "LastName"=>"Doe", ...}
|
46
48
|
|
49
|
+
|
47
50
|
# update some of his data
|
48
51
|
MangoPay::NaturalUser.update(john_id, {'LastName' => 'CHANGED'}) # => {FirstName"=>"John", "LastName"=>"CHANGED", ...}
|
49
52
|
|
53
|
+
|
50
54
|
# get all users (with pagination)
|
51
55
|
pagination = {'page' => 1, 'per_page' => 8} # get 1st page, 8 items per page
|
52
56
|
users = MangoPay::User.fetch(pagination) # => [{...}, ...]: list of 8 users data hashes
|
53
57
|
pagination # => {"page"=>1, "per_page"=>8, "total_pages"=>748, "total_items"=>5978}
|
54
58
|
|
59
|
+
|
55
60
|
# get John's bank accounts
|
56
61
|
accounts = MangoPay::BankAccount.fetch(john_id) # => [{...}, ...]: list of accounts data hashes (10 per page by default)
|
62
|
+
|
63
|
+
|
64
|
+
# errors handling
|
65
|
+
begin
|
66
|
+
MangoPay::NaturalUser.create({})
|
67
|
+
rescue MangoPay::ResponseError => ex
|
68
|
+
|
69
|
+
ex # => #<MangoPay::ResponseError: One or several required parameters are missing or incorrect. [...] FirstName: The FirstName field is required. LastName: The LastName field is required. Nationality: The Nationality field is required.>
|
70
|
+
|
71
|
+
ex.details # => {
|
72
|
+
# "Message"=>"One or several required parameters are missing or incorrect. [...]",
|
73
|
+
# "Type"=>"param_error",
|
74
|
+
# "Id"=>"5c080105-4da3-467d-820d-0906164e55fe",
|
75
|
+
# "Date"=>1409048671.0,
|
76
|
+
# "errors"=>{
|
77
|
+
# "FirstName"=>"The FirstName field is required.",
|
78
|
+
# "LastName"=>"The LastName field is required.", ...},
|
79
|
+
# "Code"=>"400",
|
80
|
+
# "Url"=>"/v2/.../users/natural"
|
81
|
+
# }
|
82
|
+
end
|
57
83
|
```
|
58
84
|
|
59
85
|
### Tests
|
data/lib/mangopay.rb
CHANGED
@@ -4,139 +4,131 @@ require 'multi_json'
|
|
4
4
|
|
5
5
|
# helpers
|
6
6
|
require 'mangopay/version'
|
7
|
-
require 'mangopay/json'
|
8
7
|
require 'mangopay/errors'
|
9
|
-
|
10
|
-
|
11
|
-
# resources
|
12
|
-
require 'mangopay/http_calls'
|
13
|
-
require 'mangopay/resource'
|
14
|
-
require 'mangopay/client'
|
15
|
-
require 'mangopay/user'
|
16
|
-
require 'mangopay/natural_user'
|
17
|
-
require 'mangopay/legal_user'
|
18
|
-
require 'mangopay/payin'
|
19
|
-
require 'mangopay/payout'
|
20
|
-
require 'mangopay/transfer'
|
21
|
-
require 'mangopay/transaction'
|
22
|
-
require 'mangopay/wallet'
|
23
|
-
require 'mangopay/bank_account'
|
24
|
-
require 'mangopay/card_registration'
|
25
|
-
require 'mangopay/preauthorization'
|
26
|
-
require 'mangopay/card'
|
27
|
-
require 'mangopay/event'
|
28
|
-
require 'mangopay/kyc_document'
|
29
|
-
require 'mangopay/hook'
|
30
|
-
require 'mangopay/refund'
|
8
|
+
|
31
9
|
|
32
10
|
module MangoPay
|
33
11
|
|
12
|
+
autoload :HTTPCalls, 'mangopay/http_calls'
|
13
|
+
autoload :Resource, 'mangopay/resource'
|
14
|
+
autoload :Client, 'mangopay/client'
|
15
|
+
autoload :User, 'mangopay/user'
|
16
|
+
autoload :NaturalUser, 'mangopay/natural_user'
|
17
|
+
autoload :LegalUser, 'mangopay/legal_user'
|
18
|
+
autoload :PayIn, 'mangopay/pay_in'
|
19
|
+
autoload :PayOut, 'mangopay/pay_out'
|
20
|
+
autoload :Transfer, 'mangopay/transfer'
|
21
|
+
autoload :Transaction, 'mangopay/transaction'
|
22
|
+
autoload :Wallet, 'mangopay/wallet'
|
23
|
+
autoload :BankAccount, 'mangopay/bank_account'
|
24
|
+
autoload :CardRegistration, 'mangopay/card_registration'
|
25
|
+
autoload :PreAuthorization, 'mangopay/pre_authorization'
|
26
|
+
autoload :Card, 'mangopay/card'
|
27
|
+
autoload :Event, 'mangopay/event'
|
28
|
+
autoload :KycDocument, 'mangopay/kyc_document'
|
29
|
+
autoload :Hook, 'mangopay/hook'
|
30
|
+
autoload :Refund, 'mangopay/refund'
|
31
|
+
autoload :JSON, 'mangopay/json'
|
32
|
+
autoload :AuthorizationToken, 'mangopay/authorization_token'
|
33
|
+
|
34
34
|
class Configuration
|
35
35
|
attr_accessor :preproduction, :root_url,
|
36
|
-
|
37
|
-
|
36
|
+
:client_id, :client_passphrase,
|
37
|
+
:temp_dir
|
38
38
|
|
39
39
|
def preproduction
|
40
40
|
@preproduction || false
|
41
41
|
end
|
42
42
|
|
43
43
|
def root_url
|
44
|
-
@root_url || (@preproduction == true
|
44
|
+
@root_url || (@preproduction == true ? "https://api.sandbox.mangopay.com" : "https://api.mangopay.com")
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
48
|
class << self
|
49
49
|
attr_accessor :configuration
|
50
|
-
end
|
51
|
-
|
52
|
-
def self.configure
|
53
|
-
self.configuration ||= Configuration.new
|
54
|
-
yield configuration
|
55
|
-
end
|
56
50
|
|
57
|
-
|
58
|
-
|
59
|
-
end
|
60
|
-
|
61
|
-
#
|
62
|
-
# - +method+: HTTP method; lowercase symbol, e.g. :get, :post etc.
|
63
|
-
# - +url+: the part after Configuration#root_url
|
64
|
-
# - +params+: hash; entity data for creation, update etc.; will dump it by JSON and assign to Net::HTTPRequest#body
|
65
|
-
# - +filters+: hash; pagination params etc.; will encode it by URI and assign to URI#query
|
66
|
-
# - +headers+: hash; request_headers by default
|
67
|
-
# - +before_request_proc+: optional proc; will call it passing the Net::HTTPRequest instance just before Net::HTTPRequest#request
|
68
|
-
#
|
69
|
-
# Raises MangoPay::ResponseError if response code != 200.
|
70
|
-
#
|
71
|
-
def self.request(method, url, params={}, filters={}, headers = request_headers, before_request_proc = nil)
|
72
|
-
uri = api_uri(url)
|
73
|
-
uri.query = URI.encode_www_form(filters) unless filters.empty?
|
74
|
-
|
75
|
-
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
76
|
-
req = Net::HTTP::const_get(method.capitalize).new(uri.request_uri, headers)
|
77
|
-
req.body = MangoPay::JSON.dump(params)
|
78
|
-
before_request_proc.call(req) if before_request_proc
|
79
|
-
http.request req
|
51
|
+
def api_path
|
52
|
+
"/v2/#{MangoPay.configuration.client_id}"
|
80
53
|
end
|
81
54
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
rescue MultiJson::LoadError
|
86
|
-
data = {}
|
55
|
+
def configure
|
56
|
+
self.configuration ||= Configuration.new
|
57
|
+
yield configuration
|
87
58
|
end
|
88
59
|
|
89
|
-
|
90
|
-
|
91
|
-
#pp res, data
|
92
|
-
#puts
|
93
|
-
|
94
|
-
if (!(res.is_a? Net::HTTPOK))
|
95
|
-
ex = MangoPay::ResponseError.new(uri, res.code, data)
|
96
|
-
############## TEMP!!!! ########################################################
|
97
|
-
#pp ex, data
|
98
|
-
raise ex
|
60
|
+
def api_uri(url='')
|
61
|
+
URI(configuration.root_url + url)
|
99
62
|
end
|
100
63
|
|
101
|
-
#
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
64
|
+
#
|
65
|
+
# - +method+: HTTP method; lowercase symbol, e.g. :get, :post etc.
|
66
|
+
# - +url+: the part after Configuration#root_url
|
67
|
+
# - +params+: hash; entity data for creation, update etc.; will dump it by JSON and assign to Net::HTTPRequest#body
|
68
|
+
# - +filters+: hash; pagination params etc.; will encode it by URI and assign to URI#query
|
69
|
+
# - +headers+: hash; request_headers by default
|
70
|
+
# - +before_request_proc+: optional proc; will call it passing the Net::HTTPRequest instance just before Net::HTTPRequest#request
|
71
|
+
#
|
72
|
+
# Raises MangoPay::ResponseError if response code != 200.
|
73
|
+
#
|
74
|
+
def request(method, url, params={}, filters={}, headers = request_headers, before_request_proc = nil)
|
75
|
+
uri = api_uri(url)
|
76
|
+
uri.query = URI.encode_www_form(filters) unless filters.empty?
|
77
|
+
|
78
|
+
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
|
79
|
+
req = Net::HTTP::const_get(method.capitalize).new(uri.request_uri, headers)
|
80
|
+
req.body = JSON.dump(params)
|
81
|
+
before_request_proc.call(req) if before_request_proc
|
82
|
+
http.request req
|
83
|
+
end
|
84
|
+
|
85
|
+
# decode json data
|
86
|
+
data = JSON.load(res.body.to_s) rescue {}
|
87
|
+
|
88
|
+
|
89
|
+
unless res.is_a?(Net::HTTPOK)
|
90
|
+
raise MangoPay::ResponseError.new(uri, res.code, data)
|
91
|
+
end
|
92
|
+
|
93
|
+
# copy pagination info if any
|
94
|
+
['x-number-of-pages', 'x-number-of-items'].each { |k|
|
95
|
+
filters[k.gsub('x-number-of-', 'total_')] = res[k].to_i if res[k]
|
96
|
+
}
|
97
|
+
|
98
|
+
data
|
99
|
+
end
|
110
100
|
|
111
|
-
|
112
|
-
@uname ||= get_uname
|
101
|
+
private
|
113
102
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
103
|
+
def user_agent
|
104
|
+
{
|
105
|
+
bindings_version: VERSION,
|
106
|
+
lang: 'ruby',
|
107
|
+
lang_version: "#{RUBY_VERSION} p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE})",
|
108
|
+
platform: RUBY_PLATFORM,
|
109
|
+
uname: get_uname
|
110
|
+
}
|
111
|
+
end
|
122
112
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
113
|
+
def get_uname
|
114
|
+
`uname -a 2>/dev/null`.strip if RUBY_PLATFORM =~ /linux|darwin/i
|
115
|
+
rescue Errno::ENOMEM
|
116
|
+
'uname lookup failed'
|
117
|
+
end
|
128
118
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
119
|
+
def request_headers
|
120
|
+
auth_token = AuthorizationToken::Manager.get_token
|
121
|
+
headers = {
|
122
|
+
'user_agent' => "MangoPay V2 RubyBindings/#{VERSION}",
|
123
|
+
'Authorization' => "#{auth_token['token_type']} #{auth_token['access_token']}",
|
124
|
+
'Content-Type' => 'application/json'
|
125
|
+
}
|
126
|
+
begin
|
127
|
+
headers.update('x_mangopay_client_user_agent' => JSON.dump(user_agent))
|
128
|
+
rescue => e
|
129
|
+
headers.update('x_mangopay_client_raw_user_agent' => user_agent.inspect, error: "#{e} (#{e.class})")
|
130
|
+
end
|
140
131
|
end
|
132
|
+
|
141
133
|
end
|
142
134
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module MangoPay
|
2
2
|
class BankAccount < Resource
|
3
|
-
include
|
3
|
+
include HTTPCalls::Fetch
|
4
4
|
class << self
|
5
5
|
def create(user_id, params)
|
6
6
|
type = params.fetch(:Type) { |no_symbol_key| params.fetch('Type') }
|
@@ -15,15 +15,15 @@ module MangoPay
|
|
15
15
|
# (+page+, +per_page+; see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
|
16
16
|
#
|
17
17
|
def fetch(user_id, bank_account_id_or_filters={})
|
18
|
-
bank_account_id, filters =
|
18
|
+
bank_account_id, filters = HTTPCalls::Fetch.parse_id_or_filters(bank_account_id_or_filters)
|
19
19
|
MangoPay.request(:get, url(user_id, bank_account_id), {}, filters)
|
20
20
|
end
|
21
21
|
|
22
22
|
def url(user_id, bank_account_id = nil)
|
23
23
|
if bank_account_id
|
24
|
-
"
|
24
|
+
"#{MangoPay.api_path}/users/#{CGI.escape(user_id.to_s)}/bankaccounts/#{CGI.escape(bank_account_id.to_s)}"
|
25
25
|
else
|
26
|
-
"
|
26
|
+
"#{MangoPay.api_path}/users/#{CGI.escape(user_id.to_s)}/bankaccounts"
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
data/lib/mangopay/card.rb
CHANGED
data/lib/mangopay/client.rb
CHANGED
@@ -3,7 +3,7 @@ module MangoPay
|
|
3
3
|
|
4
4
|
def self.create(params)
|
5
5
|
MangoPay.request(:post, '/api/clients/', params, {}, {
|
6
|
-
'user_agent' => "MangoPay V2 RubyBindings/#{
|
6
|
+
'user_agent' => "MangoPay V2 RubyBindings/#{VERSION}",
|
7
7
|
'Content-Type' => 'application/json'
|
8
8
|
})
|
9
9
|
end
|
data/lib/mangopay/errors.rb
CHANGED
@@ -8,17 +8,51 @@ module MangoPay
|
|
8
8
|
|
9
9
|
# Thrown from any MangoPay API call whenever
|
10
10
|
# it returns response with HTTP code != 200.
|
11
|
+
# Check @details hash for further info.
|
12
|
+
#
|
13
|
+
# Two example exceptions with details:
|
14
|
+
#
|
15
|
+
# #<MangoPay::ResponseError:
|
16
|
+
# One or several required parameters are missing or incorrect. [...]
|
17
|
+
# Email: The Email field is required.>
|
18
|
+
# {"Message"=>"One or several required parameters are missing or incorrect.
|
19
|
+
# An incorrect resource ID also raises this kind of error.",
|
20
|
+
# "Type"=>"param_error",
|
21
|
+
# "Id"=>"66936e92-3f21-4a35-b6cf-f1d17c2fb6e5",
|
22
|
+
# "Date"=>1409047252.0,
|
23
|
+
# "errors"=>{"Email"=>"The Email field is required."},
|
24
|
+
# "Code"=>"400",
|
25
|
+
# "Url"=>"/v2/sdk-unit-tests/users/natural"}
|
26
|
+
#
|
27
|
+
# #<MangoPay::ResponseError: Internal Server Error>
|
28
|
+
# {"Message"=>"Internal Server Error",
|
29
|
+
# "Type"=>"other",
|
30
|
+
# "Id"=>"7bdc5c6f-2000-4cd3-96f3-2a3fcb746f07",
|
31
|
+
# "Date"=>1409047251.0,
|
32
|
+
# "errors"=>nil,
|
33
|
+
# "Code"=>"500",
|
34
|
+
# "Url"=>"/v2/sdk-unit-tests/payins/3380640/refunds"}
|
11
35
|
class ResponseError < Error
|
12
36
|
|
13
37
|
attr_reader :request_url, :code, :details
|
14
38
|
|
15
39
|
def initialize(request_url, code, details)
|
16
40
|
@request_url, @code, @details = request_url, code, details
|
41
|
+
|
42
|
+
@details['Code'] = code
|
43
|
+
@details['Url'] = request_url.request_uri
|
44
|
+
|
17
45
|
super(message) if message
|
18
46
|
end
|
19
47
|
|
20
|
-
def message; @details['Message']; end
|
21
48
|
def type; @details['Type']; end
|
22
49
|
def errors; @details['errors']; end
|
50
|
+
|
51
|
+
def message;
|
52
|
+
msg = @details['Message']
|
53
|
+
msg += errors.sort.map {|k,v| " #{k}: #{v}"}.join if (errors && errors.is_a?(Hash))
|
54
|
+
msg
|
55
|
+
end
|
56
|
+
|
23
57
|
end
|
24
58
|
end
|
data/lib/mangopay/event.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
module MangoPay
|
2
|
-
class Event < Resource
|
3
|
-
|
4
|
-
# Fetches list of events (PayIns, PayOuts, Transfers).
|
5
|
-
#
|
6
|
-
# Optional +filters+ is a hash accepting following keys:
|
7
|
-
# - +page+, +per_page+: pagination params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
|
8
|
-
# - +EventType+: {PAYIN_NORMAL_CREATED, PAYIN_NORMAL_SUCCEEDED, PAYIN_NORMAL_FAILED etc...} (see http://docs.mangopay.com/api-references/events/)
|
9
|
-
# - +BeforeDate+ (timestamp): filters events with Date _before_ this date
|
10
|
-
# - +AfterDate+ (timestamp): filters events with Date _after_ this date
|
11
|
-
#
|
12
|
-
def self.fetch(filters={})
|
13
|
-
MangoPay.request(:get, url(), {}, filters)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
1
|
+
module MangoPay
|
2
|
+
class Event < Resource
|
3
|
+
|
4
|
+
# Fetches list of events (PayIns, PayOuts, Transfers).
|
5
|
+
#
|
6
|
+
# Optional +filters+ is a hash accepting following keys:
|
7
|
+
# - +page+, +per_page+: pagination params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
|
8
|
+
# - +EventType+: {PAYIN_NORMAL_CREATED, PAYIN_NORMAL_SUCCEEDED, PAYIN_NORMAL_FAILED etc...} (see http://docs.mangopay.com/api-references/events/)
|
9
|
+
# - +BeforeDate+ (timestamp): filters events with Date _before_ this date
|
10
|
+
# - +AfterDate+ (timestamp): filters events with Date _after_ this date
|
11
|
+
#
|
12
|
+
def self.fetch(filters={})
|
13
|
+
MangoPay.request(:get, url(), {}, filters)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|