mangopay 3.0.30.1 → 3.0.31

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6346db992adff682f58586a8435d12bf7bb0ff9811927b4084c476264dc326d0
4
- data.tar.gz: 9cb2ff496c327154aea0b02f5672efa697f2ee139730ec7710bbe481d068e353
3
+ metadata.gz: 73c15899898b7b234b4acf3ce46155a7a206bd629b5ef98d682e6125d3c5cd52
4
+ data.tar.gz: f2e564568a12d93c36eb1fc42b70c21b6cf5753c18810b5cef5d28e8f1e1ae93
5
5
  SHA512:
6
- metadata.gz: 16c654da6df6533750d9d432139098596e281cd346634a75ff10106dbf90394e700b7d793fc3b48456a1766b616bd0e186a36390deafe4e4553ded25ebb28ae8
7
- data.tar.gz: c0d2989975569aab32456edba096693bfc8f2f3aa2b376b44a37135686087d3390b083c0fa08a974078d653712f4917763854ffbea2d5cb61c1879510e1a5a30
6
+ metadata.gz: df581e3dd8afa4312a20388604c2b1f907908898e92d26db4cd3bab264e5ac11ea2a2448cccac73b55054fcdb68bbed07b58bff7e5ab99996dd0a378fce3d819
7
+ data.tar.gz: 48e91bdd987927f105cd7fea1ef4863211b78e1f2728106cd0ab2618049db67988cd6d445e542ece17915c829a4c29f88995e05d480434e712fb40cb9ceecbea
@@ -26,6 +26,17 @@ module MangoPay
26
26
  MangoPay.request(:put, url(user_id, bank_account_id), params)
27
27
  end
28
28
 
29
+ # Fetches list of transactions belonging to given +bank_account_id+.
30
+ #
31
+ # Optional +filters+ is a hash accepting following keys:
32
+ # - +page+, +per_page+, +sort+: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
33
+ # - +Status+: TransactionStatus {CREATED, SUCCEEDED, FAILED}
34
+ # - +ResultCode+: string representing the transaction result
35
+ def transactions(bank_account_id, filters = {})
36
+ url = "#{MangoPay.api_path}/bankaccounts/#{bank_account_id}/transactions"
37
+ MangoPay.request(:get, url, {}, filters)
38
+ end
39
+
29
40
  def url(user_id, bank_account_id = nil)
30
41
  if bank_account_id
31
42
  "#{MangoPay.api_path}/users/#{CGI.escape(user_id.to_s)}/bankaccounts/#{CGI.escape(bank_account_id.to_s)}"
@@ -17,9 +17,24 @@ module MangoPay
17
17
  MangoPay.request(:get, fingerprint_url(fingerprint), {}, filters)
18
18
  end
19
19
 
20
+ # Retrieves a list of transactions belonging to given +card_id+.
21
+ #
22
+ # Optional +filters+ is a hash accepting following keys:
23
+ # - +page+, +per_page+, +sort+: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
24
+ # - +Status+: TransactionStatus {CREATED, SUCCEEDED, FAILED}
25
+ # - +ResultCode+: string representing the transaction result
26
+ def transactions(card_id, filters = {})
27
+ url = url(card_id) + '/transactions'
28
+ MangoPay.request(:get, url, {}, filters)
29
+ end
30
+
20
31
  def fingerprint_url(fingerprint)
21
32
  "#{MangoPay.api_path}/cards/fingerprints/#{fingerprint}"
22
33
  end
34
+
35
+ def get_pre_authorizations(card_id, filters = {})
36
+ MangoPay.request(:get, "#{MangoPay.api_path}/cards/#{card_id}/preauthorizations")
37
+ end
23
38
  end
24
39
  end
25
40
  end
@@ -27,6 +27,16 @@ module MangoPay
27
27
  MangoPay.request(:get, url, {}, filters)
28
28
  end
29
29
 
30
+ # Fetches list of transactions belonging to given +mandate_id+.
31
+ #
32
+ # Optional +filters+ is a hash accepting following keys:
33
+ # - +page+, +per_page+, +sort+: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
34
+ # - +Status+: TransactionStatus {CREATED, SUCCEEDED, FAILED}
35
+ # - +ResultCode+: string representing the transaction result
36
+ def transactions(mandate_id, filters = {})
37
+ url = url(mandate_id) + '/transactions'
38
+ MangoPay.request(:get, url, {}, filters)
39
+ end
30
40
  end
31
41
  end
32
42
  end
@@ -5,6 +5,17 @@ module MangoPay
5
5
  include HTTPCalls::Fetch
6
6
  include HTTPCalls::Refund
7
7
 
8
+ # Fetches list of refunds belonging to the given +pay_in_id+.
9
+ #
10
+ # Optional +filters+ is a hash accepting following keys:
11
+ # - +page+, +per_page+, +sort+: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
12
+ # - +Status+: TransactionStatus {CREATED, SUCCEEDED, FAILED}
13
+ # - +ResultCode+: string representing the transaction result
14
+ def self.refunds(pay_in_id, filters = {})
15
+ url = url(pay_in_id) + '/refunds'
16
+ MangoPay.request(:get, url, {}, filters)
17
+ end
18
+
8
19
  module Card
9
20
 
10
21
  # See http://docs.mangopay.com/api-references/payins/payins-card-web/
@@ -2,6 +2,17 @@ module MangoPay
2
2
  class PayOut < Resource
3
3
  include HTTPCalls::Fetch
4
4
 
5
+ # Fetches list of refunds belonging to the given +pay_out_id+.
6
+ #
7
+ # Optional +filters+ is a hash accepting following keys:
8
+ # - +page+, +per_page+, +sort+: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
9
+ # - +Status+: TransactionStatus {CREATED, SUCCEEDED, FAILED}
10
+ # - +ResultCode+: string representing the transaction result
11
+ def self.refunds(pay_out_id, filters = {})
12
+ url = url(pay_out_id) + '/refunds'
13
+ MangoPay.request(:get, url, {}, filters)
14
+ end
15
+
5
16
  # See http://docs.mangopay.com/api-references/pay-out-bank-wire/
6
17
  class BankWire < Resource
7
18
  include HTTPCalls::Create
@@ -3,5 +3,16 @@ module MangoPay
3
3
  # See http://docs.mangopay.com/api-references/refund/
4
4
  class Refund < Resource
5
5
  include HTTPCalls::Fetch
6
+
7
+ # Fetches list of refunds belonging to given +repudiation_id+
8
+ #
9
+ # Optional +filters+ is a hash accepting following keys:
10
+ # - +page+, +per_page+, +sort+: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
11
+ # - +Status+: TransactionStatus {CREATED, SUCCEEDED, FAILED}
12
+ # - +ResultCode+: string representing the transaction result
13
+ def self.of_repudiation(repudiation_id, filters = {})
14
+ url = "#{MangoPay.api_path}/repudiations/#{repudiation_id}/refunds"
15
+ MangoPay.request(:get, url, {}, filters)
16
+ end
6
17
  end
7
18
  end
@@ -5,5 +5,16 @@ module MangoPay
5
5
  include HTTPCalls::Create
6
6
  include HTTPCalls::Fetch
7
7
  include HTTPCalls::Refund
8
+
9
+ # Fetches list of refunds belonging to given +transfer_id+.
10
+ #
11
+ # Optional +filters+ is a hash accepting following keys:
12
+ # - +page+, +per_page+, +sort+: pagination and sorting params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
13
+ # - +Status+: TransactionStatus {CREATED, SUCCEEDED, FAILED}
14
+ # - +ResultCode+: string representing the transaction result
15
+ def self.refunds(transfer_id, filters = {})
16
+ url = url(transfer_id) + '/refunds'
17
+ MangoPay.request(:get, url, {}, filters)
18
+ end
8
19
  end
9
20
  end
@@ -53,6 +53,13 @@ module MangoPay
53
53
  def kyc_documents(user_id, filters={})
54
54
  MangoPay.request(:get, url(user_id) + '/KYC/documents', {}, filters)
55
55
  end
56
+
57
+ # Fetches list of pre-authorizations belonging to the given +user_id+.
58
+ # Optional +filters+ is a hash accepting the following keys:
59
+ # - +page+, +per_page+, +sort+, +Status+, +ResultCode+, +PaymentStatus+: pagination and sorting/filtering params (see MangoPay::HTTPCalls::Fetch::ClassMethods#fetch)
60
+ def pre_authorizations(user_id, filters={})
61
+ MangoPay.request(:get, url(user_id) + '/preauthorizations', {}, filters)
62
+ end
56
63
  end
57
64
  end
58
65
  end
@@ -1,3 +1,3 @@
1
1
  module MangoPay
2
- VERSION = '3.0.30.1'
2
+ VERSION = '3.0.31'
3
3
  end
@@ -94,4 +94,12 @@ describe MangoPay::BankAccount do
94
94
  expect(fetched['Active']).to eq(false)
95
95
  end
96
96
  end
97
+
98
+ describe 'FETCH Transaction' do
99
+ it "fetches a bank account's transactions" do
100
+ bank_account = new_bank_account
101
+ transactions = MangoPay::BankAccount.transactions(bank_account['Id'])
102
+ expect(transactions).to be_an(Array)
103
+ end
104
+ end
97
105
  end
@@ -85,4 +85,11 @@ describe MangoPay::CardRegistration do
85
85
  end
86
86
  end
87
87
 
88
+ describe 'FETCH Transactions' do
89
+ it "retrieves list of card's transactions" do
90
+ card_id = new_card_registration_completed['CardId']
91
+ transactions = MangoPay::Card.transactions(card_id)
92
+ expect(transactions).to be_an(Array)
93
+ end
94
+ end
88
95
  end
@@ -89,4 +89,11 @@ describe MangoPay::Mandate do
89
89
  end
90
90
  end
91
91
 
92
+ describe 'FETCH Transactions' do
93
+ it "fetches a mandate's transactions" do
94
+ mandate = new_mandate
95
+ transactions = MangoPay::Mandate.transactions(mandate['Id'])
96
+ expect(transactions).to be_an(Array)
97
+ end
98
+ end
92
99
  end
@@ -44,4 +44,12 @@ describe MangoPay::PayIn::Card::Web, type: :feature do
44
44
  end
45
45
  end
46
46
 
47
+ describe 'FETCH Refunds' do
48
+ it "fetches the pay-in's refunds" do
49
+ payin = new_payin_card_web
50
+ refunds = MangoPay::PayIn.refunds(payin['Id'])
51
+ expect(refunds).to be_an(Array)
52
+ end
53
+ end
54
+
47
55
  end
@@ -51,4 +51,12 @@ describe MangoPay::PayOut::BankWire, type: :feature do
51
51
  end
52
52
  end
53
53
 
54
+ describe 'GET Refunds' do
55
+ it "fetches the pay-out's refunds" do
56
+ payout = new_payout_bankwire
57
+ refunds = MangoPay::PayOut.refunds(payout['Id'])
58
+ expect(refunds).to be_an(Array)
59
+ end
60
+ end
61
+
54
62
  end
@@ -39,4 +39,13 @@ describe MangoPay::PreAuthorization do
39
39
  end
40
40
  end
41
41
 
42
+ describe 'FETCH FOR CARD' do
43
+ it "fetches a card's pre-authorizations" do
44
+ created = new_card_preauthorization
45
+ fetched = MangoPay::Card.get_pre_authorizations(created['CardId'])
46
+
47
+ expect(fetched).to be_an(Array)
48
+ end
49
+ end
50
+
42
51
  end
@@ -18,4 +18,17 @@ describe MangoPay::Refund do
18
18
  expect(refund['CreditedWalletId']).to eq(transfer['DebitedWalletId'])
19
19
  end
20
20
  end
21
+
22
+ describe 'FETCH for Repudiation' do
23
+ it "fetches a repudiation's refunds" do
24
+ disputes = MangoPay::Dispute.fetch
25
+ dispute = disputes.find do |dispute|
26
+ dispute['DisputeType'] == 'NOT_CONTESTABLE'\
27
+ && !dispute['InitialTransactionId'].nil?
28
+ end
29
+ repudiation_id = MangoPay::Dispute.transactions(dispute['Id'])[0]['Id']
30
+ refunds = MangoPay::Refund.of_repudiation(repudiation_id)
31
+ expect(refunds).to be_an(Array)
32
+ end
33
+ end
21
34
  end
@@ -66,4 +66,12 @@ describe MangoPay::Transfer, type: :feature do
66
66
  wallets_reload_and_check_amounts(wlt1, 1000, wlt2, 0)
67
67
  end
68
68
  end
69
+
70
+ describe 'FETCH Refunds' do
71
+ it "fetches a transfer's refunds" do
72
+ transfer = new_transfer
73
+ refunds = MangoPay::Transfer.refunds(transfer['Id'])
74
+ expect(refunds).to be_an(Array)
75
+ end
76
+ end
69
77
  end
@@ -190,4 +190,12 @@ describe MangoPay::User do
190
190
  expect(ubo_declaration['DeclaredUBOs'][0]['UserId']).to eq natural_user['Id']
191
191
  end
192
192
  end
193
+
194
+ describe 'FETCH Pre-Authorizations' do
195
+ it "fetches list of user's pre-authorizations belonging" do
196
+ legal_user = new_legal_user
197
+ pre_authorizations = MangoPay::User.pre_authorizations(legal_user['Id'])
198
+ expect(pre_authorizations).to be_an(Array)
199
+ end
200
+ end
193
201
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mangopay
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.30.1
4
+ version: 3.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoffroy Lorieux
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-01-16 00:00:00.000000000 Z
12
+ date: 2018-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  version: '0'
163
163
  requirements: []
164
164
  rubyforge_project:
165
- rubygems_version: 2.7.4
165
+ rubygems_version: 2.7.6
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: Ruby bindings for the version 2 of the MANGOPAY API