mangopay 3.12.0 → 3.14.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 +3 -3
- data/CHANGELOG.md +22 -0
- data/lib/mangopay/pay_in.rb +10 -0
- data/lib/mangopay/version.rb +1 -1
- data/lib/mangopay.rb +13 -2
- data/spec/mangopay/bankingaliases_spec.rb +1 -1
- data/spec/mangopay/payin_mbway_direct_spec.rb +32 -0
- data/spec/mangopay/shared_resources.rb +16 -1
- 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: beedb37b5e5b4381ee58a8ed47575aa8f4b1df22a033387fa3cdda2d2b65062a
|
4
|
+
data.tar.gz: df0350f49877a9c4121f1d2e37dcb4d015f57061622c3e915d1e1e99f28b27da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 130b77d46dd296fa3434295c12c914783e1e9ce64f62f32ca8469eb78978c4be27f96d5d2c703c453ca22bad192a07cff32c80f68b5fc6c7c74bd4bab5ac2abd
|
7
|
+
data.tar.gz: ee23071676d425d0d50e719dc346349ff139eaec66fb5a0d59c166a3f547e4cb784cadb3e9b5a9cf64beb2b39814c41e149a1c1c6a040ff28167b72f2dcc2dea
|
@@ -16,11 +16,11 @@ jobs:
|
|
16
16
|
packages: write
|
17
17
|
|
18
18
|
steps:
|
19
|
-
- uses: actions/checkout@
|
19
|
+
- uses: actions/checkout@v3
|
20
20
|
- name: Set up Ruby 2.6
|
21
|
-
uses:
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
22
|
with:
|
23
|
-
ruby-version: 2.6.
|
23
|
+
ruby-version: 2.6.10
|
24
24
|
|
25
25
|
- name: Publish to RubyGems
|
26
26
|
run: |
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
## [3.14.0] - 2023-06-21
|
2
|
+
### Added
|
3
|
+
|
4
|
+
- MB WAY is now available as a payment method with Mangopay. This payment method is in private beta. Please contact support if you have any questions.
|
5
|
+
|
6
|
+
## [3.13.2] - 2023-05-18
|
7
|
+
### Fixes
|
8
|
+
|
9
|
+
- fixed GitHub Actions CD pipeline
|
10
|
+
|
11
|
+
## [3.13.1] - 2023-05-18
|
12
|
+
### Fixes
|
13
|
+
|
14
|
+
- typo fixed in test context name (@batistadasilva)
|
15
|
+
|
16
|
+
## [3.13.0] - 2023-05-17
|
17
|
+
### Added
|
18
|
+
|
19
|
+
- Possibility to configure HTTP `max_retries (http_max_retries)` (default value = 1) and `open_timeout (http_open_timeout)` (default value = 60 seconds)
|
20
|
+
- Increased default `read_timeout` to 30 seconds
|
21
|
+
|
22
|
+
|
1
23
|
## [3.12.0] - 2022-11-16
|
2
24
|
### New 30-day preauthorization feature
|
3
25
|
|
data/lib/mangopay/pay_in.rb
CHANGED
@@ -141,6 +141,16 @@ module MangoPay
|
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
|
+
module Mbway
|
145
|
+
class Direct < Resource
|
146
|
+
include HTTPCalls::Create
|
147
|
+
|
148
|
+
def self.url(*)
|
149
|
+
"#{MangoPay.api_path}/payins/payment-methods/mbway"
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
144
154
|
module RecurringPayments
|
145
155
|
class Recurring < Resource
|
146
156
|
include HTTPCalls::Create
|
data/lib/mangopay/version.rb
CHANGED
data/lib/mangopay.rb
CHANGED
@@ -52,6 +52,7 @@ module MangoPay
|
|
52
52
|
attr_accessor :preproduction, :root_url,
|
53
53
|
:client_id, :client_apiKey,
|
54
54
|
:temp_dir, :log_file, :http_timeout,
|
55
|
+
:http_max_retries, :http_open_timeout,
|
55
56
|
:logger
|
56
57
|
|
57
58
|
def preproduction
|
@@ -63,7 +64,15 @@ module MangoPay
|
|
63
64
|
end
|
64
65
|
|
65
66
|
def http_timeout
|
66
|
-
@http_timeout ||
|
67
|
+
@http_timeout || 30000
|
68
|
+
end
|
69
|
+
|
70
|
+
def http_max_retries
|
71
|
+
@http_max_retries || 1
|
72
|
+
end
|
73
|
+
|
74
|
+
def http_open_timeout
|
75
|
+
@http_open_timeout || 60000
|
67
76
|
end
|
68
77
|
end
|
69
78
|
|
@@ -141,7 +150,9 @@ module MangoPay
|
|
141
150
|
headers['Idempotency-Key'] = headers_or_idempotency_key if headers_or_idempotency_key != nil
|
142
151
|
end
|
143
152
|
|
144
|
-
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true, :read_timeout => configuration.http_timeout,
|
153
|
+
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true, :read_timeout => configuration.http_timeout,
|
154
|
+
:max_retries => configuration.http_max_retries,
|
155
|
+
:open_timeout => configuration.http_open_timeout, ssl_version: :TLSv1_2) do |http|
|
145
156
|
req = Net::HTTP::const_get(method.capitalize).new(uri.request_uri, headers)
|
146
157
|
req.body = JSON.dump(params)
|
147
158
|
before_request_proc.call(req) if before_request_proc
|
@@ -0,0 +1,32 @@
|
|
1
|
+
describe MangoPay::PayIn::Mbway::Direct, type: :feature do
|
2
|
+
include_context 'wallets'
|
3
|
+
include_context 'payins'
|
4
|
+
|
5
|
+
def check_type_and_status(payin)
|
6
|
+
expect(payin['Type']).to eq('PAYIN')
|
7
|
+
expect(payin['Nature']).to eq('REGULAR')
|
8
|
+
expect(payin['PaymentType']).to eq('MBWAY')
|
9
|
+
expect(payin['ExecutionType']).to eq('DIRECT')
|
10
|
+
expect(payin['Status']).to eq('CREATED')
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'CREATE' do
|
14
|
+
it 'creates a mbway direct payin' do
|
15
|
+
created = new_payin_mbway_direct
|
16
|
+
expect(created['Id']).not_to be_nil
|
17
|
+
expect(created['PhoneNumber']).not_to be_nil
|
18
|
+
check_type_and_status(created)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'FETCH' do
|
23
|
+
it 'fetches a payin' do
|
24
|
+
created = new_payin_mbway_direct
|
25
|
+
fetched = MangoPay::PayIn.fetch(created['Id'])
|
26
|
+
expect(fetched['Id']).to eq(created['Id'])
|
27
|
+
check_type_and_status(created)
|
28
|
+
check_type_and_status(fetched)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -417,6 +417,21 @@ shared_context 'payins' do
|
|
417
417
|
|
418
418
|
let(:new_payin_card_direct) { create_new_payin_card_direct(new_wallet) }
|
419
419
|
|
420
|
+
###############################################
|
421
|
+
# MBWAY/direct
|
422
|
+
###############################################
|
423
|
+
let(:new_payin_mbway_direct) do
|
424
|
+
MangoPay::PayIn::Mbway::Direct.create(
|
425
|
+
AuthorId: new_natural_user['Id'],
|
426
|
+
CreditedWalletId: new_wallet['Id'],
|
427
|
+
DebitedFunds: {Currency: 'EUR', Amount: 199},
|
428
|
+
Fees: {Currency: 'EUR', Amount: 1},
|
429
|
+
StatementDescriptor: "ruby",
|
430
|
+
Tag: 'Test PayIn/Mbway/Direct',
|
431
|
+
PhoneNumber: '351#269458236'
|
432
|
+
)
|
433
|
+
end
|
434
|
+
|
420
435
|
def create_new_payin_card_direct(to_wallet, amnt = 1000)
|
421
436
|
cardreg = new_card_registration_completed
|
422
437
|
MangoPay::PayIn::Card::Direct.create(
|
@@ -601,7 +616,7 @@ shared_context 'hooks' do
|
|
601
616
|
end
|
602
617
|
|
603
618
|
###############################################
|
604
|
-
shared_context '
|
619
|
+
shared_context 'bankingaliases' do
|
605
620
|
###############################################
|
606
621
|
include_context 'users'
|
607
622
|
include_context 'wallets'
|
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.14.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:
|
12
|
+
date: 2023-06-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -134,6 +134,7 @@ files:
|
|
134
134
|
- spec/mangopay/payin_card_web_spec.rb
|
135
135
|
- spec/mangopay/payin_directdebit_direct_spec.rb
|
136
136
|
- spec/mangopay/payin_directdebit_web_spec.rb
|
137
|
+
- spec/mangopay/payin_mbway_direct_spec.rb
|
137
138
|
- spec/mangopay/payin_payconiq_web_spec.rb
|
138
139
|
- spec/mangopay/payin_paypal_web_spec.rb
|
139
140
|
- spec/mangopay/payin_preauthorized_direct_spec.rb
|
@@ -202,6 +203,7 @@ test_files:
|
|
202
203
|
- spec/mangopay/payin_card_web_spec.rb
|
203
204
|
- spec/mangopay/payin_directdebit_direct_spec.rb
|
204
205
|
- spec/mangopay/payin_directdebit_web_spec.rb
|
206
|
+
- spec/mangopay/payin_mbway_direct_spec.rb
|
205
207
|
- spec/mangopay/payin_payconiq_web_spec.rb
|
206
208
|
- spec/mangopay/payin_paypal_web_spec.rb
|
207
209
|
- spec/mangopay/payin_preauthorized_direct_spec.rb
|