mangopay 3.3.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/.github/workflows/ruby_cd.yml +34 -0
- data/.github/workflows/ruby_ci.yml +34 -0
- data/CHANGELOG.md +76 -4
- data/lib/mangopay/bankingaliases_iban.rb +2 -2
- data/lib/mangopay/dispute.rb +2 -2
- data/lib/mangopay/errors.rb +9 -4
- data/lib/mangopay/filter_parameters.rb +7 -2
- data/lib/mangopay/pay_in.rb +41 -0
- data/lib/mangopay/pay_out.rb +5 -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/client_spec.png +0 -0
- data/spec/mangopay/configuration_spec.rb +5 -1
- data/spec/mangopay/dispute_spec.png +0 -0
- data/spec/mangopay/kyc_document_spec.png +0 -0
- data/spec/mangopay/kyc_document_spec.rb +1 -0
- data/spec/mangopay/payin_payconiq_web_spec.rb +25 -0
- data/spec/mangopay/payout_bankwire_spec.rb +9 -0
- data/spec/mangopay/recurring_payin_spec.rb +66 -0
- data/spec/mangopay/shared_resources.rb +40 -1
- 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: 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
|
|
@@ -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,75 @@
|
|
|
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
|
+
|
|
24
|
+
## [3.6.0] - 2021.08.10
|
|
25
|
+
## Added
|
|
26
|
+
|
|
27
|
+
- 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).
|
|
28
|
+
- 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)
|
|
29
|
+
|
|
30
|
+
## [3.5.0] - 2021.06.10
|
|
31
|
+
## Added
|
|
32
|
+
|
|
33
|
+
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.
|
|
34
|
+
|
|
35
|
+
You can start testing in sandbox, to help you define your workflow. This release provides the first elements of the full feature.
|
|
36
|
+
|
|
37
|
+
- [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
|
|
38
|
+
- [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
|
|
39
|
+
- [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
|
|
40
|
+
|
|
41
|
+
This feature is not yet available in production and you need to contact the Support team to request access.
|
|
42
|
+
|
|
43
|
+
## Accepted PRs
|
|
44
|
+
|
|
45
|
+
- Add support for refund creation
|
|
46
|
+
- Allow to fetch UBO Declaration without User ID
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## [3.4.0] - 2021.05.27
|
|
51
|
+
## Added
|
|
52
|
+
|
|
53
|
+
### Instant payment
|
|
54
|
+
|
|
55
|
+
Mangopay introduces the instant payment mode. It allows payouts (transfer from wallet to user bank account) to be processed within 25 seconds, rather than the 48 hours for a standard payout.
|
|
56
|
+
|
|
57
|
+
You can now use this new type of payout with the Ruby SDK.
|
|
58
|
+
|
|
59
|
+
Example :
|
|
60
|
+
|
|
61
|
+
```ruby
|
|
62
|
+
bankwire = MangoPay::PayOut::BankWire.get_bankwire(payout['Id'])
|
|
63
|
+
# where payout['Id'] is the id of an existing payout
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Please note that this feature must be authorized and activated by MANGOPAY. More information [here](https://docs.mangopay.com/guide/instant-payment-payout).
|
|
67
|
+
|
|
68
|
+
### Accepted PRs
|
|
69
|
+
|
|
70
|
+
- Add support to create refunds for PayIn, Transfer and PayOut transactions.
|
|
71
|
+
- ResponseError object improvement
|
|
72
|
+
|
|
1
73
|
## [3.3.0]
|
|
2
74
|
## Fixed
|
|
3
75
|
|
|
@@ -61,7 +133,7 @@ The parameter `Applied3DSVersion` shows you the version of the 3DS protocol used
|
|
|
61
133
|
|
|
62
134
|
## [3.1.0]
|
|
63
135
|
- 3DS2 integration with Shipping and Billing objects, including FirstName and LastName fields
|
|
64
|
-
The objects Billing and Shipping may be included on all calls to the following endpoints:
|
|
136
|
+
The objects Billing and Shipping may be included on all calls to the following endpoints:
|
|
65
137
|
- /preauthorizations/card/direct
|
|
66
138
|
- /payins/card/direct
|
|
67
139
|
- /payins/card/web
|
|
@@ -82,7 +154,7 @@ The objects Billing and Shipping may be included on all calls to the following e
|
|
|
82
154
|
## [3.0.35] - 2020-08-24
|
|
83
155
|
- Improvement to Net::ReadTimeout handling
|
|
84
156
|
- "User-agent" format in the headers changed, aligned to other assets 👤
|
|
85
|
-
|
|
157
|
+
|
|
86
158
|
## [3.0.34] - 2020-06-25
|
|
87
159
|
### Added
|
|
88
160
|
- This SDK is now GooglePay-ready ! Feel free to ask our lovely support for more infos about its activation.
|
|
@@ -100,7 +172,7 @@ The objects Billing and Shipping may be included on all calls to the following e
|
|
|
100
172
|
|
|
101
173
|
## [3.0.33] - 2019-09-23
|
|
102
174
|
### Added
|
|
103
|
-
- ApplePay `Payin` functions are now available. More info about activation to come in the following weeks...
|
|
175
|
+
- ApplePay `Payin` functions are now available. More info about activation to come in the following weeks...
|
|
104
176
|
### Changed
|
|
105
177
|
- 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)
|
|
106
178
|
|
|
@@ -114,4 +186,4 @@ The objects Billing and Shipping may be included on all calls to the following e
|
|
|
114
186
|
- `APIKey` is now replacing `passphrase` property for credentials. You must update it by updating to 3.0.32 SDK version and upper ones.
|
|
115
187
|
|
|
116
188
|
|
|
117
|
-
|
|
189
|
+
|
|
@@ -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/
|
data/lib/mangopay/errors.rb
CHANGED
|
@@ -49,12 +49,17 @@ module MangoPay
|
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
def type; @details['Type']; end
|
|
52
|
-
def
|
|
52
|
+
def error; @details['error']; end
|
|
53
|
+
def errors; @details['errors'] || error; end
|
|
53
54
|
|
|
54
55
|
def message;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
if error
|
|
57
|
+
msg = error
|
|
58
|
+
else
|
|
59
|
+
msg = @details['Message']
|
|
60
|
+
msg += errors.sort.map {|k,v| " #{k}: #{v}"}.join if (errors && errors.is_a?(Hash))
|
|
61
|
+
msg
|
|
62
|
+
end
|
|
58
63
|
end
|
|
59
64
|
|
|
60
65
|
end
|
|
@@ -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,35 @@ module MangoPay
|
|
|
126
137
|
end
|
|
127
138
|
end
|
|
128
139
|
|
|
140
|
+
module RecurringPayments
|
|
141
|
+
class Recurring < Resource
|
|
142
|
+
include HTTPCalls::Create
|
|
143
|
+
|
|
144
|
+
def self.url(*args)
|
|
145
|
+
if args.any?
|
|
146
|
+
"#{MangoPay.api_path}/recurringpayinregistrations/#{args.first}"
|
|
147
|
+
else
|
|
148
|
+
"#{MangoPay.api_path}/recurringpayinregistrations"
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
class CIT < Resource
|
|
154
|
+
include HTTPCalls::Create
|
|
155
|
+
|
|
156
|
+
def self.url(*)
|
|
157
|
+
"#{MangoPay.api_path}/payins/recurring/card/direct"
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
class MIT < Resource
|
|
162
|
+
include HTTPCalls::Create
|
|
163
|
+
|
|
164
|
+
def self.url(*)
|
|
165
|
+
"#{MangoPay.api_path}/payins/recurring/card/direct"
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
|
|
129
170
|
end
|
|
130
171
|
end
|
data/lib/mangopay/pay_out.rb
CHANGED
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
|
Binary file
|
|
@@ -6,7 +6,11 @@ describe MangoPay::Configuration do
|
|
|
6
6
|
c.client_id = 'test_asd'
|
|
7
7
|
c.client_apiKey = '00000'
|
|
8
8
|
MangoPay::User.fetch()
|
|
9
|
-
}.to raise_error
|
|
9
|
+
}.to raise_error { |err|
|
|
10
|
+
expect(err).to be_a MangoPay::ResponseError
|
|
11
|
+
expect(err.code).to eq '401'
|
|
12
|
+
expect(err.message).to eq 'invalid_client'
|
|
13
|
+
}
|
|
10
14
|
end
|
|
11
15
|
|
|
12
16
|
it 'goes ok when calling with correct client credentials' do
|
|
Binary file
|
|
Binary file
|
|
@@ -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
|
|
@@ -40,6 +40,15 @@ describe MangoPay::PayOut::BankWire, type: :feature do
|
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
+
describe 'Get Bankwire' do
|
|
44
|
+
it 'gets a bankwire' do
|
|
45
|
+
created = new_payout_bankwire
|
|
46
|
+
fetched = MangoPay::PayOut::BankWire.get_bankwire(created['Id'])
|
|
47
|
+
expect(fetched['Id']).to eq(created['Id'])
|
|
48
|
+
expect(fetched['CreationDate']).to eq(created['CreationDate'])
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
43
52
|
describe 'FETCH' do
|
|
44
53
|
it 'fetches a payout' do
|
|
45
54
|
created = new_payout_bankwire
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
|
|
44
|
+
cit = MangoPay::PayIn::RecurringPayments::CIT.create(
|
|
45
|
+
RecurringPayinRegistrationId: recurring['Id'],
|
|
46
|
+
IpAddress: "2001:0620:0000:0000:0211:24FF:FE80:C12C",
|
|
47
|
+
SecureModeReturnURL: "http://www.my-site.com/returnurl",
|
|
48
|
+
StatementDescriptor: "lorem",
|
|
49
|
+
Tag: "custom meta",
|
|
50
|
+
BrowserInfo: {
|
|
51
|
+
AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
|
|
52
|
+
JavaEnabled: true,
|
|
53
|
+
Language: "FR-FR",
|
|
54
|
+
ColorDepth: 4,
|
|
55
|
+
ScreenHeight: 1800,
|
|
56
|
+
ScreenWidth: 400,
|
|
57
|
+
JavascriptEnabled: true,
|
|
58
|
+
TimeZoneOffset: "+60",
|
|
59
|
+
UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
expect(cit).not_to be_nil
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
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)
|
|
@@ -439,7 +477,8 @@ shared_context 'payouts' do
|
|
|
439
477
|
Fees: {Currency: 'EUR', Amount: 0},
|
|
440
478
|
BankAccountId: new_bank_account['Id'],
|
|
441
479
|
Communication: 'This is a test',
|
|
442
|
-
Tag: 'Test PayOut/Bank/Wire'
|
|
480
|
+
Tag: 'Test PayOut/Bank/Wire',
|
|
481
|
+
PayoutModeRequested: 'Standard'
|
|
443
482
|
)
|
|
444
483
|
end
|
|
445
484
|
end
|
|
@@ -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.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
|
|
@@ -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
|