mangopay 3.6.0 → 3.7.0
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/CHANGELOG.md +23 -0
- data/lib/mangopay/pay_in.rb +11 -0
- data/lib/mangopay/ubo_declaration.rb +3 -3
- data/lib/mangopay/version.rb +1 -1
- data/spec/mangopay/kyc_document_spec.rb +1 -0
- data/spec/mangopay/payin_payconiq_web_spec.rb +25 -0
- data/spec/mangopay/shared_resources.rb +16 -0
- data/spec/mangopay/ubo_declaration_spec.rb +4 -4
- data/spec/mangopay/ubo_spec.rb +3 -3
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 508461f85b104c5fc4670347ca07dd80fceaa1783a46339d26d98332f00b7030
|
4
|
+
data.tar.gz: 32d29746e95fb843ed856cb3a7cbe2513bf62e3f5f3145eebff249f8c756934a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6258fcdfec472aaf69a5a1107e68dbdef041bb4f0dc1dc0ed5e09cc8e211d47e5d79c8ca21ab3a2560cb02c969478081d221a27cb4b0be2fcfb0fb68b3361ef1
|
7
|
+
data.tar.gz: 3083417ce359cbe42ce2be77a2051c5f4b8cae8fd0ae8d386b3899581b812ded7e6318508dd16d2f1d8ed103cac2dd6fe748953c9429b09d9b5ae006d9803696
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,26 @@
|
|
1
|
+
## [3.7.0] - 2021.10.11
|
2
|
+
## Added
|
3
|
+
|
4
|
+
### Payconiq
|
5
|
+
|
6
|
+
As requested by numerous clients, we are now providing [Payconiq](https://www.payconiq.be) as a new mean-of-payment. To request access, please contact MANGOPAY.
|
7
|
+
|
8
|
+
### Flags for KYC documents
|
9
|
+
|
10
|
+
**We provide more information regarding refused KYC documents.** Therefore it will be easier for you to adapt your app behavior and help your end user.
|
11
|
+
|
12
|
+
You are now able to see the exact explanation thanks to a new parameter called “Flags”.
|
13
|
+
|
14
|
+
It has been added to
|
15
|
+
|
16
|
+
`$this->_api->KycDocuments->Get($kycDocument->Id);`
|
17
|
+
|
18
|
+
It will display one or several error codes that provide the reason(s) why your document validation has failed. These error codes description are available [here](https://docs.mangopay.com/guide/kyc-document).
|
19
|
+
|
20
|
+
## Fixed
|
21
|
+
|
22
|
+
Idempotency key is not required anymore for UBO declarations
|
23
|
+
|
1
24
|
## [3.6.0] - 2021.08.10
|
2
25
|
## Added
|
3
26
|
|
data/lib/mangopay/pay_in.rb
CHANGED
@@ -106,6 +106,17 @@ module MangoPay
|
|
106
106
|
|
107
107
|
end
|
108
108
|
|
109
|
+
module Payconiq
|
110
|
+
|
111
|
+
class Web < Resource
|
112
|
+
include HTTPCalls::Create
|
113
|
+
def self.url(*)
|
114
|
+
"#{MangoPay.api_path}/payins/payconiq/#{CGI.escape(class_name.downcase)}"
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
end
|
119
|
+
|
109
120
|
module ApplePay
|
110
121
|
class Direct < Resource
|
111
122
|
include HTTPCalls::Create
|
@@ -10,17 +10,17 @@ module MangoPay
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
def create(user_id, idempotency_key)
|
13
|
+
def create(user_id, idempotency_key = nil)
|
14
14
|
MangoPay.request(:post, url(user_id), {}, {}, idempotency_key)
|
15
15
|
end
|
16
16
|
|
17
17
|
# Fetches the Ubo declaration belonging to the given +user_id+ if given, with the given +id+.
|
18
|
-
def fetch(user_id, id, idempotency_key)
|
18
|
+
def fetch(user_id, id, idempotency_key = nil)
|
19
19
|
url = (user_id) ? url(user_id, id) : "#{MangoPay.api_path}/kyc/ubodeclarations/#{CGI.escape(id.to_s)}"
|
20
20
|
MangoPay.request(:get, url, {}, {}, idempotency_key)
|
21
21
|
end
|
22
22
|
|
23
|
-
def update(user_id, id, params = {}, idempotency_key)
|
23
|
+
def update(user_id, id, params = {}, idempotency_key = nil)
|
24
24
|
request_params = {
|
25
25
|
Status: params['Status'],
|
26
26
|
Ubos: params['Ubos']
|
data/lib/mangopay/version.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
describe MangoPay::PayIn::Payconiq::Web, type: :feature do
|
2
|
+
include_context 'payins'
|
3
|
+
|
4
|
+
def check_type_and_status(payin)
|
5
|
+
expect(payin['Type']).to eq('PAYIN')
|
6
|
+
expect(payin['Nature']).to eq('REGULAR')
|
7
|
+
expect(payin['PaymentType']).to eq('PAYCONIQ')
|
8
|
+
expect(payin['ExecutionType']).to eq('WEB')
|
9
|
+
|
10
|
+
# not SUCCEEDED yet: waiting for processing
|
11
|
+
expect(payin['Status']).to eq('CREATED')
|
12
|
+
expect(payin['ResultCode']).to be_nil
|
13
|
+
expect(payin['ResultMessage']).to be_nil
|
14
|
+
expect(payin['ExecutionDate']).to be_nil
|
15
|
+
end
|
16
|
+
|
17
|
+
describe 'CREATE' do
|
18
|
+
it 'creates a payconiq web payin' do
|
19
|
+
created = new_payin_payconiq_web
|
20
|
+
expect(created['Id']).not_to be_nil
|
21
|
+
check_type_and_status(created)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -215,6 +215,22 @@ shared_context 'payins' do
|
|
215
215
|
)
|
216
216
|
end
|
217
217
|
|
218
|
+
###############################################
|
219
|
+
# payconiq/web
|
220
|
+
###############################################
|
221
|
+
|
222
|
+
let(:new_payin_payconiq_web) do
|
223
|
+
MangoPay::PayIn::Payconiq::Web.create(
|
224
|
+
AuthorId: new_natural_user['Id'],
|
225
|
+
CreditedWalletId: new_wallet['Id'],
|
226
|
+
DebitedFunds: {Currency: 'EUR', Amount: 100},
|
227
|
+
Fees: {Currency: 'EUR', Amount: 0},
|
228
|
+
ReturnURL: MangoPay.configuration.root_url,
|
229
|
+
Country: "BE",
|
230
|
+
Tag: 'Custom Meta'
|
231
|
+
)
|
232
|
+
end
|
233
|
+
|
218
234
|
###############################################
|
219
235
|
# applepay/direct
|
220
236
|
###############################################
|
@@ -6,9 +6,9 @@ describe MangoPay::UboDeclaration do
|
|
6
6
|
it 'can fetch a UBO declaration' do
|
7
7
|
legal_user = new_legal_user
|
8
8
|
|
9
|
-
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id']
|
9
|
+
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'])
|
10
10
|
|
11
|
-
ubo_declaration_byId = MangoPay::UboDeclaration.fetch(legal_user['Id'], ubo_declaration['Id']
|
11
|
+
ubo_declaration_byId = MangoPay::UboDeclaration.fetch(legal_user['Id'], ubo_declaration['Id'])
|
12
12
|
|
13
13
|
expect(ubo_declaration).not_to be_nil
|
14
14
|
expect(ubo_declaration_byId).not_to be_nil
|
@@ -28,13 +28,13 @@ describe MangoPay::UboDeclaration do
|
|
28
28
|
describe 'UPDATE' do
|
29
29
|
it 'can update a UBO declaration' do
|
30
30
|
legal_user = new_legal_user
|
31
|
-
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id']
|
31
|
+
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'])
|
32
32
|
ubo_declaration['Status'] = 'VALIDATION_ASKED'
|
33
33
|
|
34
34
|
ubo = new_ubo(legal_user, ubo_declaration)
|
35
35
|
|
36
36
|
ubo_declaration['Ubos'] = [ubo]
|
37
|
-
ubo_declaration = MangoPay::UboDeclaration.update(legal_user['Id'], ubo_declaration['Id'], ubo_declaration
|
37
|
+
ubo_declaration = MangoPay::UboDeclaration.update(legal_user['Id'], ubo_declaration['Id'], ubo_declaration)
|
38
38
|
|
39
39
|
expect(ubo_declaration).not_to be_nil
|
40
40
|
expect(ubo_declaration['Status']).to eq 'VALIDATION_ASKED'
|
data/spec/mangopay/ubo_spec.rb
CHANGED
@@ -5,7 +5,7 @@ describe MangoPay::Ubo do
|
|
5
5
|
describe 'FETCH' do
|
6
6
|
it 'can fetch a Ubo' do
|
7
7
|
legal_user = new_legal_user
|
8
|
-
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id']
|
8
|
+
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'])
|
9
9
|
ubo = new_ubo(legal_user, ubo_declaration)
|
10
10
|
result = MangoPay::Ubo.fetch(legal_user['Id'], ubo_declaration['Id'], ubo['Id'])
|
11
11
|
expect(result).not_to be_nil
|
@@ -16,7 +16,7 @@ describe MangoPay::Ubo do
|
|
16
16
|
describe 'CREATE' do
|
17
17
|
it 'can create a new Ubo' do
|
18
18
|
legal_user = new_legal_user
|
19
|
-
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id']
|
19
|
+
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'])
|
20
20
|
result = new_ubo(legal_user, ubo_declaration)
|
21
21
|
expect(result).not_to be_nil
|
22
22
|
end
|
@@ -25,7 +25,7 @@ describe MangoPay::Ubo do
|
|
25
25
|
describe 'UPDATE' do
|
26
26
|
it 'can update a Ubo' do
|
27
27
|
legal_user = new_legal_user
|
28
|
-
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id']
|
28
|
+
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'])
|
29
29
|
ubo = new_ubo(legal_user, ubo_declaration)
|
30
30
|
ubo['FirstName'] = 'Santa'
|
31
31
|
ubo['LastName'] = 'Clause'
|
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.
|
4
|
+
version: 3.7.0
|
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: 2021-
|
12
|
+
date: 2021-10-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -131,6 +131,7 @@ files:
|
|
131
131
|
- spec/mangopay/payin_card_web_spec.rb
|
132
132
|
- spec/mangopay/payin_directdebit_direct_spec.rb
|
133
133
|
- spec/mangopay/payin_directdebit_web_spec.rb
|
134
|
+
- spec/mangopay/payin_payconiq_web_spec.rb
|
134
135
|
- spec/mangopay/payin_paypal_web_spec.rb
|
135
136
|
- spec/mangopay/payin_preauthorized_direct_spec.rb
|
136
137
|
- spec/mangopay/payout_bankwire_spec.rb
|
@@ -196,6 +197,7 @@ test_files:
|
|
196
197
|
- spec/mangopay/payin_card_web_spec.rb
|
197
198
|
- spec/mangopay/payin_directdebit_direct_spec.rb
|
198
199
|
- spec/mangopay/payin_directdebit_web_spec.rb
|
200
|
+
- spec/mangopay/payin_payconiq_web_spec.rb
|
199
201
|
- spec/mangopay/payin_paypal_web_spec.rb
|
200
202
|
- spec/mangopay/payin_preauthorized_direct_spec.rb
|
201
203
|
- spec/mangopay/payout_bankwire_spec.rb
|