mangopay 3.4.0 → 3.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby_cd.yml +34 -0
- data/.github/workflows/ruby_ci.yml +34 -0
- data/CHANGELOG.md +63 -4
- data/lib/mangopay/bankingaliases_iban.rb +2 -2
- data/lib/mangopay/dispute.rb +2 -2
- data/lib/mangopay/filter_parameters.rb +7 -2
- data/lib/mangopay/pay_in.rb +43 -0
- data/lib/mangopay/refund.rb +1 -0
- data/lib/mangopay/ubo_declaration.rb +6 -4
- 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/recurring_payin_spec.rb +78 -0
- data/spec/mangopay/shared_resources.rb +38 -0
- data/spec/mangopay/ubo_declaration_spec.rb +14 -3
- data/spec/mangopay/ubo_spec.rb +3 -3
- metadata +9 -4
- data/.travis.yml +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16def874b468b39fb00308d965802ef6a6fdb42ba9cb7d18a3a422a687d1d1fa
|
4
|
+
data.tar.gz: 18f0e0c679919c7e5849ac5052fb2490bc619142901c11fee81ccc4e3dd46e33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0678869fba9e64e0cbf5ed3c4ca2d9fb579aa99b99ade388e2e314d32ee277c53d49f784f225e098a1dda540ace70f08dbd0da2fe4a08e62d8d639db4a912c6
|
7
|
+
data.tar.gz: aac5ed97bc8e8e7aef927489c221a9428c54683e037c4059083f64b2003757761f511a74d84776c0a54e492754843d79eec2332a8c712768f3ec6e1863d5103d
|
@@ -0,0 +1,34 @@
|
|
1
|
+
name: mangopay2-net-ruby-cd
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
# Sequence of patterns matched against refs/tags
|
6
|
+
tags:
|
7
|
+
# It pushes any tags that contain a v. ex: v1.16.1
|
8
|
+
- '*'
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
build:
|
12
|
+
name: Build + Publish
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
permissions:
|
15
|
+
contents: read
|
16
|
+
packages: write
|
17
|
+
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
- name: Set up Ruby 2.6
|
21
|
+
uses: actions/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: 2.6.x
|
24
|
+
|
25
|
+
- name: Publish to RubyGems
|
26
|
+
run: |
|
27
|
+
mkdir -p $HOME/.gem
|
28
|
+
touch $HOME/.gem/credentials
|
29
|
+
chmod 0600 $HOME/.gem/credentials
|
30
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
31
|
+
gem build *.gemspec
|
32
|
+
gem push *.gem
|
33
|
+
env:
|
34
|
+
GEM_HOST_API_KEY: "${{secrets.GEM_HOST_API_KEY}}"
|
@@ -0,0 +1,34 @@
|
|
1
|
+
name: mangopay2-net-ruby-ci
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
# push on master branch
|
7
|
+
- master
|
8
|
+
# push on a feature branch
|
9
|
+
- feature/*
|
10
|
+
# push on a bugfix branch
|
11
|
+
- bugfix/*
|
12
|
+
pull_request:
|
13
|
+
branches: [ master ]
|
14
|
+
|
15
|
+
jobs:
|
16
|
+
build:
|
17
|
+
name: Build
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
permissions:
|
20
|
+
contents: read
|
21
|
+
packages: write
|
22
|
+
|
23
|
+
steps:
|
24
|
+
- uses: actions/checkout@v2
|
25
|
+
- name: Set up Ruby 2.6
|
26
|
+
uses: actions/setup-ruby@v1
|
27
|
+
with:
|
28
|
+
ruby-version: 2.6.x
|
29
|
+
- name: Install Rspec
|
30
|
+
run: |
|
31
|
+
gem install bundler
|
32
|
+
bundler install
|
33
|
+
- name: Test
|
34
|
+
run: bundle exec rspec
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,62 @@
|
|
1
|
+
## [3.8.0] - 2021.10.20
|
2
|
+
## Added
|
3
|
+
|
4
|
+
You can now change the status to "ENDED" for a recurring payment.
|
5
|
+
|
6
|
+
## Fixed
|
7
|
+
|
8
|
+
- "Status" is now available in the response when you request a recurring payment registration.
|
9
|
+
|
10
|
+
|
11
|
+
## [3.7.0] - 2021.10.11
|
12
|
+
## Added
|
13
|
+
|
14
|
+
### Payconiq
|
15
|
+
|
16
|
+
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.
|
17
|
+
|
18
|
+
### Flags for KYC documents
|
19
|
+
|
20
|
+
**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.
|
21
|
+
|
22
|
+
You are now able to see the exact explanation thanks to a new parameter called “Flags”.
|
23
|
+
|
24
|
+
It has been added to
|
25
|
+
|
26
|
+
`$this->_api->KycDocuments->Get($kycDocument->Id);`
|
27
|
+
|
28
|
+
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).
|
29
|
+
|
30
|
+
## Fixed
|
31
|
+
|
32
|
+
Idempotency key is not required anymore for UBO declarations
|
33
|
+
|
34
|
+
## [3.6.0] - 2021.08.10
|
35
|
+
## Added
|
36
|
+
|
37
|
+
- You can now update and view a Recurring PayIn Registration object. To know more about this feature, please consult the documentation [here](https://docs.mangopay.com/guide/recurring-payments-introduction).
|
38
|
+
- To improve recurring payments, we have added new parameters for CIT : DebitedFunds & Fees. To know more about this feature, please consult the documentation [here](https://docs.mangopay.com/endpoints/v2.01/payins#e1053_create-a-recurring-payin-cit)
|
39
|
+
|
40
|
+
## [3.5.0] - 2021.06.10
|
41
|
+
## Added
|
42
|
+
|
43
|
+
We have added a new feature **[recurring payments](https://docs.mangopay.com/guide/recurring-payments)** dedicated to clients needing to charge a card repeatedly, such as subscriptions or payments installments.
|
44
|
+
|
45
|
+
You can start testing in sandbox, to help you define your workflow. This release provides the first elements of the full feature.
|
46
|
+
|
47
|
+
- [Create a Recurring PayIn Registration object](https://docs.mangopay.com/endpoints/v2.01/payins#e1051_create-a-recurring-payin-registration), containing all the information to define the recurring payment
|
48
|
+
- [Initiate your recurring payment flow](https://docs.mangopay.com/endpoints/v2.01/payins#e1053_create-a-recurring-payin-cit) with an authenticated transaction (CIT) using the Card Recurring PayIn endpoint
|
49
|
+
- [Continue your recurring payment flow](https://docs.mangopay.com/endpoints/v2.01/payins#e1054_create-a-recurring-payin-mit) with an non-authenticated transaction (MIT) using the Card Recurring PayIn endpoint
|
50
|
+
|
51
|
+
This feature is not yet available in production and you need to contact the Support team to request access.
|
52
|
+
|
53
|
+
## Accepted PRs
|
54
|
+
|
55
|
+
- Add support for refund creation
|
56
|
+
- Allow to fetch UBO Declaration without User ID
|
57
|
+
|
58
|
+
|
59
|
+
|
1
60
|
## [3.4.0] - 2021.05.27
|
2
61
|
## Added
|
3
62
|
|
@@ -84,7 +143,7 @@ The parameter `Applied3DSVersion` shows you the version of the 3DS protocol used
|
|
84
143
|
|
85
144
|
## [3.1.0]
|
86
145
|
- 3DS2 integration with Shipping and Billing objects, including FirstName and LastName fields
|
87
|
-
The objects Billing and Shipping may be included on all calls to the following endpoints:
|
146
|
+
The objects Billing and Shipping may be included on all calls to the following endpoints:
|
88
147
|
- /preauthorizations/card/direct
|
89
148
|
- /payins/card/direct
|
90
149
|
- /payins/card/web
|
@@ -105,7 +164,7 @@ The objects Billing and Shipping may be included on all calls to the following e
|
|
105
164
|
## [3.0.35] - 2020-08-24
|
106
165
|
- Improvement to Net::ReadTimeout handling
|
107
166
|
- "User-agent" format in the headers changed, aligned to other assets 👤
|
108
|
-
|
167
|
+
|
109
168
|
## [3.0.34] - 2020-06-25
|
110
169
|
### Added
|
111
170
|
- This SDK is now GooglePay-ready ! Feel free to ask our lovely support for more infos about its activation.
|
@@ -123,7 +182,7 @@ The objects Billing and Shipping may be included on all calls to the following e
|
|
123
182
|
|
124
183
|
## [3.0.33] - 2019-09-23
|
125
184
|
### Added
|
126
|
-
- ApplePay `Payin` functions are now available. More info about activation to come in the following weeks...
|
185
|
+
- ApplePay `Payin` functions are now available. More info about activation to come in the following weeks...
|
127
186
|
### Changed
|
128
187
|
- GET EMoney method now supports year and month parameters. More info on our [docs](https://docs.mangopay.com/endpoints/v2.01/user-emoney#e895_view-a-users-emoney)
|
129
188
|
|
@@ -137,4 +196,4 @@ The objects Billing and Shipping may be included on all calls to the following e
|
|
137
196
|
- `APIKey` is now replacing `passphrase` property for credentials. You must update it by updating to 3.0.32 SDK version and upper ones.
|
138
197
|
|
139
198
|
|
140
|
-
|
199
|
+
|
@@ -3,9 +3,9 @@ module MangoPay
|
|
3
3
|
# See parent class MangoPay::BankingAliases
|
4
4
|
class BankingAliasesIBAN < BankingAliases
|
5
5
|
|
6
|
-
def self.create(params, wallet_id)
|
6
|
+
def self.create(params, wallet_id, headers_or_idempotency_key = nil)
|
7
7
|
url = "#{MangoPay.api_path}/wallets/#{wallet_id}/bankingaliases/iban"
|
8
|
-
MangoPay.request(:post, url, params, {})
|
8
|
+
MangoPay.request(:post, url, params, {}, headers_or_idempotency_key)
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.url(id = nil)
|
data/lib/mangopay/dispute.rb
CHANGED
@@ -50,9 +50,9 @@ module MangoPay
|
|
50
50
|
#####################################################
|
51
51
|
|
52
52
|
# see https://docs.mangopay.com/api-references/disputes/repudiations/
|
53
|
-
def fetch_repudiation(repudiation_id)
|
53
|
+
def fetch_repudiation(repudiation_id, idempotency_key = nil)
|
54
54
|
url = "#{MangoPay.api_path}/repudiations/#{repudiation_id}"
|
55
|
-
MangoPay.request(:get, url)
|
55
|
+
MangoPay.request(:get, url, {}, {}, idempotency_key)
|
56
56
|
end
|
57
57
|
|
58
58
|
# +params+: hash; see https://docs.mangopay.com/api-references/disputes/settlement-transfers/
|
@@ -39,12 +39,17 @@ module MangoPay
|
|
39
39
|
@@res_confidential_params ||= [
|
40
40
|
'access_token', 'AccessKey', 'IBAN', 'CardRegistrationURL',
|
41
41
|
'PreregistrationData', 'RedirectURL', 'RegistrationData',
|
42
|
-
'SecureModeRedirectUrl', 'OwnerName', 'OwnerAddress', 'BIC'
|
42
|
+
'SecureModeRedirectUrl', 'OwnerName', 'OwnerAddress', 'BIC',
|
43
|
+
'FirstName', 'LastName', 'Email', 'AddressLine1',
|
44
|
+
'AddressLine2',
|
43
45
|
].freeze
|
44
46
|
end
|
45
47
|
|
46
48
|
def self.req_confidential_params
|
47
|
-
@@req_confidential_params ||= [
|
49
|
+
@@req_confidential_params ||= [
|
50
|
+
'File', 'IBAN', 'OwnerName', 'OwnerAddress', 'BIC', 'FirstName',
|
51
|
+
'LastName', 'Email', 'AddressLine1', 'AddressLine2',
|
52
|
+
].freeze
|
48
53
|
end
|
49
54
|
|
50
55
|
end
|
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
|
@@ -126,5 +137,37 @@ module MangoPay
|
|
126
137
|
end
|
127
138
|
end
|
128
139
|
|
140
|
+
module RecurringPayments
|
141
|
+
class Recurring < Resource
|
142
|
+
include HTTPCalls::Create
|
143
|
+
include HTTPCalls::Fetch
|
144
|
+
include HTTPCalls::Update
|
145
|
+
|
146
|
+
def self.url(*args)
|
147
|
+
if args.any?
|
148
|
+
"#{MangoPay.api_path}/recurringpayinregistrations/#{args.first}"
|
149
|
+
else
|
150
|
+
"#{MangoPay.api_path}/recurringpayinregistrations"
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
class CIT < Resource
|
156
|
+
include HTTPCalls::Create
|
157
|
+
|
158
|
+
def self.url(*)
|
159
|
+
"#{MangoPay.api_path}/payins/recurring/card/direct"
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
class MIT < Resource
|
164
|
+
include HTTPCalls::Create
|
165
|
+
|
166
|
+
def self.url(*)
|
167
|
+
"#{MangoPay.api_path}/payins/recurring/card/direct"
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
129
172
|
end
|
130
173
|
end
|
data/lib/mangopay/refund.rb
CHANGED
@@ -10,15 +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
|
-
|
18
|
-
|
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 = nil)
|
19
|
+
url = (user_id) ? url(user_id, id) : "#{MangoPay.api_path}/kyc/ubodeclarations/#{CGI.escape(id.to_s)}"
|
20
|
+
MangoPay.request(:get, url, {}, {}, idempotency_key)
|
19
21
|
end
|
20
22
|
|
21
|
-
def update(user_id, id, params = {}, idempotency_key)
|
23
|
+
def update(user_id, id, params = {}, idempotency_key = nil)
|
22
24
|
request_params = {
|
23
25
|
Status: params['Status'],
|
24
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
|
@@ -0,0 +1,78 @@
|
|
1
|
+
describe MangoPay::PayIn::RecurringPayments, type: :feature do
|
2
|
+
include_context 'wallets'
|
3
|
+
include_context 'users'
|
4
|
+
include_context 'payins'
|
5
|
+
|
6
|
+
describe 'CREATE' do
|
7
|
+
it 'creates a recurring payment' do
|
8
|
+
cardreg = new_card_registration_3dsecure_completed
|
9
|
+
wallet = new_wallet
|
10
|
+
recurring = MangoPay::PayIn::RecurringPayments::Recurring.create(
|
11
|
+
AuthorId: new_natural_user['Id'],
|
12
|
+
CardId: cardreg['CardId'],
|
13
|
+
CreditedUserId: wallet['Owners'][0],
|
14
|
+
CreditedWalletId: wallet['Id'],
|
15
|
+
FirstTransactionDebitedFunds: {Currency: 'EUR', Amount: 10},
|
16
|
+
FirstTransactionFees: {Currency: 'EUR', Amount: 1},
|
17
|
+
Billing: {
|
18
|
+
Address: {
|
19
|
+
AddressLine1: 'AddressLine1',
|
20
|
+
AddressLine2: 'AddressLine2',
|
21
|
+
City: 'City',
|
22
|
+
Region: 'Region',
|
23
|
+
PostalCode: 'PostalCode',
|
24
|
+
Country: 'FR'
|
25
|
+
},
|
26
|
+
FirstName: 'Joe',
|
27
|
+
LastName: 'Blogs'
|
28
|
+
},
|
29
|
+
Shipping: {
|
30
|
+
Address: {
|
31
|
+
AddressLine1: 'AddressLine1',
|
32
|
+
AddressLine2: 'AddressLine2',
|
33
|
+
City: 'City',
|
34
|
+
Region: 'Region',
|
35
|
+
PostalCode: 'PostalCode',
|
36
|
+
Country: 'FR'
|
37
|
+
},
|
38
|
+
FirstName: 'Joe',
|
39
|
+
LastName: 'Blogs'
|
40
|
+
}
|
41
|
+
)
|
42
|
+
expect(recurring).not_to be_nil
|
43
|
+
expect(recurring['Status']).not_to be_nil
|
44
|
+
expect(recurring['Id']).not_to be_nil
|
45
|
+
id = recurring['Id']
|
46
|
+
|
47
|
+
get = MangoPay::PayIn::RecurringPayments::Recurring.fetch(id)
|
48
|
+
expect(get).not_to be_nil
|
49
|
+
|
50
|
+
cit = MangoPay::PayIn::RecurringPayments::CIT.create(
|
51
|
+
RecurringPayinRegistrationId: recurring['Id'],
|
52
|
+
IpAddress: "2001:0620:0000:0000:0211:24FF:FE80:C12C",
|
53
|
+
SecureModeReturnURL: "http://www.my-site.com/returnurl",
|
54
|
+
StatementDescriptor: "lorem",
|
55
|
+
Tag: "custom meta",
|
56
|
+
BrowserInfo: {
|
57
|
+
AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
|
58
|
+
JavaEnabled: true,
|
59
|
+
Language: "FR-FR",
|
60
|
+
ColorDepth: 4,
|
61
|
+
ScreenHeight: 1800,
|
62
|
+
ScreenWidth: 400,
|
63
|
+
JavascriptEnabled: true,
|
64
|
+
TimeZoneOffset: "+60",
|
65
|
+
UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
|
66
|
+
}
|
67
|
+
)
|
68
|
+
|
69
|
+
expect(cit).not_to be_nil
|
70
|
+
|
71
|
+
update = MangoPay::PayIn::RecurringPayments::Recurring.update(id, {
|
72
|
+
Status: 'Ended'
|
73
|
+
})
|
74
|
+
|
75
|
+
expect(update).not_to be_nil
|
76
|
+
end
|
77
|
+
end
|
78
|
+
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
|
###############################################
|
@@ -355,6 +371,28 @@ shared_context 'payins' do
|
|
355
371
|
RegistrationData: cardreg['RegistrationData'])
|
356
372
|
end
|
357
373
|
|
374
|
+
let(:new_card_registration_3dsecure_completed) do
|
375
|
+
# 1st step: create
|
376
|
+
cardreg = new_card_registration
|
377
|
+
|
378
|
+
# 2nd step: tokenize by payline (fills-in RegistrationData)
|
379
|
+
data = {
|
380
|
+
data: cardreg['PreregistrationData'],
|
381
|
+
accessKeyRef: cardreg['AccessKey'],
|
382
|
+
cardNumber: 4970105191923460,
|
383
|
+
cardExpirationDate: 1224,
|
384
|
+
cardCvx: 123}
|
385
|
+
|
386
|
+
res = Net::HTTP.post_form(URI(cardreg['CardRegistrationURL']), data)
|
387
|
+
raise Exception, [res, res.body] unless res.is_a?(Net::HTTPOK) && res.body.start_with?('data=')
|
388
|
+
|
389
|
+
cardreg['RegistrationData'] = res.body
|
390
|
+
|
391
|
+
# 3rd step: update (fills-in CardId) and return it
|
392
|
+
MangoPay::CardRegistration.update(cardreg['Id'],
|
393
|
+
RegistrationData: cardreg['RegistrationData'])
|
394
|
+
end
|
395
|
+
|
358
396
|
let(:new_payin_card_direct) { create_new_payin_card_direct(new_wallet) }
|
359
397
|
|
360
398
|
def create_new_payin_card_direct(to_wallet, amnt = 1000)
|
@@ -6,9 +6,20 @@ 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'])
|
10
|
+
|
11
|
+
ubo_declaration_byId = MangoPay::UboDeclaration.fetch(legal_user['Id'], ubo_declaration['Id'])
|
12
|
+
|
13
|
+
expect(ubo_declaration).not_to be_nil
|
14
|
+
expect(ubo_declaration_byId).not_to be_nil
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'fetches ubo declaration just by id' do
|
18
|
+
legal_user = new_legal_user
|
19
|
+
|
9
20
|
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'], nil)
|
10
21
|
|
11
|
-
ubo_declaration_byId = MangoPay::UboDeclaration.fetch(
|
22
|
+
ubo_declaration_byId = MangoPay::UboDeclaration.fetch(nil, ubo_declaration['Id'], nil)
|
12
23
|
|
13
24
|
expect(ubo_declaration).not_to be_nil
|
14
25
|
expect(ubo_declaration_byId).not_to be_nil
|
@@ -17,13 +28,13 @@ describe MangoPay::UboDeclaration do
|
|
17
28
|
describe 'UPDATE' do
|
18
29
|
it 'can update a UBO declaration' do
|
19
30
|
legal_user = new_legal_user
|
20
|
-
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id']
|
31
|
+
ubo_declaration = MangoPay::UboDeclaration.create(legal_user['Id'])
|
21
32
|
ubo_declaration['Status'] = 'VALIDATION_ASKED'
|
22
33
|
|
23
34
|
ubo = new_ubo(legal_user, ubo_declaration)
|
24
35
|
|
25
36
|
ubo_declaration['Ubos'] = [ubo]
|
26
|
-
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)
|
27
38
|
|
28
39
|
expect(ubo_declaration).not_to be_nil
|
29
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.8.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-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -63,9 +63,10 @@ executables:
|
|
63
63
|
extensions: []
|
64
64
|
extra_rdoc_files: []
|
65
65
|
files:
|
66
|
+
- ".github/workflows/ruby_cd.yml"
|
67
|
+
- ".github/workflows/ruby_ci.yml"
|
66
68
|
- ".gitignore"
|
67
69
|
- ".rspec"
|
68
|
-
- ".travis.yml"
|
69
70
|
- CHANGELOG.md
|
70
71
|
- Gemfile
|
71
72
|
- LICENSE
|
@@ -130,10 +131,12 @@ files:
|
|
130
131
|
- spec/mangopay/payin_card_web_spec.rb
|
131
132
|
- spec/mangopay/payin_directdebit_direct_spec.rb
|
132
133
|
- spec/mangopay/payin_directdebit_web_spec.rb
|
134
|
+
- spec/mangopay/payin_payconiq_web_spec.rb
|
133
135
|
- spec/mangopay/payin_paypal_web_spec.rb
|
134
136
|
- spec/mangopay/payin_preauthorized_direct_spec.rb
|
135
137
|
- spec/mangopay/payout_bankwire_spec.rb
|
136
138
|
- spec/mangopay/preauthorization_spec.rb
|
139
|
+
- spec/mangopay/recurring_payin_spec.rb
|
137
140
|
- spec/mangopay/refund_spec.rb
|
138
141
|
- spec/mangopay/report_spec.rb
|
139
142
|
- spec/mangopay/report_wallets_spec.rb
|
@@ -165,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
168
|
- !ruby/object:Gem::Version
|
166
169
|
version: '0'
|
167
170
|
requirements: []
|
168
|
-
rubygems_version: 3.0.
|
171
|
+
rubygems_version: 3.0.3.1
|
169
172
|
signing_key:
|
170
173
|
specification_version: 4
|
171
174
|
summary: Ruby bindings for the version 2 of the MANGOPAY API
|
@@ -194,10 +197,12 @@ test_files:
|
|
194
197
|
- spec/mangopay/payin_card_web_spec.rb
|
195
198
|
- spec/mangopay/payin_directdebit_direct_spec.rb
|
196
199
|
- spec/mangopay/payin_directdebit_web_spec.rb
|
200
|
+
- spec/mangopay/payin_payconiq_web_spec.rb
|
197
201
|
- spec/mangopay/payin_paypal_web_spec.rb
|
198
202
|
- spec/mangopay/payin_preauthorized_direct_spec.rb
|
199
203
|
- spec/mangopay/payout_bankwire_spec.rb
|
200
204
|
- spec/mangopay/preauthorization_spec.rb
|
205
|
+
- spec/mangopay/recurring_payin_spec.rb
|
201
206
|
- spec/mangopay/refund_spec.rb
|
202
207
|
- spec/mangopay/report_spec.rb
|
203
208
|
- spec/mangopay/report_wallets_spec.rb
|
data/.travis.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
# - 2.0.0
|
4
|
-
# - 2.1
|
5
|
-
# - 2.2
|
6
|
-
# - 2.3
|
7
|
-
# - 2.4
|
8
|
-
- 2.5
|
9
|
-
script:
|
10
|
-
- if [ $TRAVIS_BRANCH != "release" ]; then bundle exec rspec; fi
|
11
|
-
deploy:
|
12
|
-
provider: rubygems
|
13
|
-
api_key:
|
14
|
-
secure: gvlnYEh9cyL+mYeudKzlD+2Po+LgIzCjHzggJH+WDcbtgxlGAFpxbVJOOm/KY8VKhMgIudNV7FJl4Gl4rrG8JjNxbb+qM57ypU3yyDcUesQ+uj0DnN+xszv7M+XtcRQMlhkStawoj/E0QMYBPkAAr1lBpPIFQdC17GDkdn5XvaQ=
|
15
|
-
gem: mangopay
|
16
|
-
on:
|
17
|
-
tags: false
|
18
|
-
repo: Mangopay/mangopay2-ruby-sdk
|
19
|
-
branch: release
|