mangopay 3.14.0 → 3.16.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: beedb37b5e5b4381ee58a8ed47575aa8f4b1df22a033387fa3cdda2d2b65062a
4
- data.tar.gz: df0350f49877a9c4121f1d2e37dcb4d015f57061622c3e915d1e1e99f28b27da
3
+ metadata.gz: ee564c11b6f6937ee8e1736000f571f999effa0e65946cbbdf73a7fd2671c4ef
4
+ data.tar.gz: 004c55f7857d52c18dedff47a44777d1f311739f6e039cd8953fa2ac49340cbc
5
5
  SHA512:
6
- metadata.gz: 130b77d46dd296fa3434295c12c914783e1e9ce64f62f32ca8469eb78978c4be27f96d5d2c703c453ca22bad192a07cff32c80f68b5fc6c7c74bd4bab5ac2abd
7
- data.tar.gz: ee23071676d425d0d50e719dc346349ff139eaec66fb5a0d59c166a3f547e4cb784cadb3e9b5a9cf64beb2b39814c41e149a1c1c6a040ff28167b72f2dcc2dea
6
+ metadata.gz: d3bbdd4eb6cef6ca0093da5f10a84e9250272118725ffa9f99cc45959807ba38b441ec0799904d33787ef0a9769df9a08099a452748a4aba36e85dded23ab663
7
+ data.tar.gz: 8bbb4cbca2206df01fc7a02687bbed28b531a1fa469e74b763318d36a95a40ebed000667bd7e1873626245c96483cffa4577be231e5275570b323828443d6998
data/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## [3.16.0] - 2023-09-04
2
+ ### Added
3
+
4
+ - Card validation endpoint management (Private beta)
5
+ - New MOPs added : Multibanco, Blik, Satispay (Private beta)
6
+
7
+ ### Fixed
8
+
9
+ - Execution Type of MB Way and PayPal has been changed from Direct to Web
10
+
11
+ ## [3.15.0] - 2023-07-07
12
+ ### Added
13
+
14
+ - Google Pay is now available as a payment method with Mangopay. This payment method is in private beta. Please contact support if you have any questions.
15
+ - Paypal integration with Mangopay has been improved. This payment method is in private beta. Please contact support if you have any questions.
16
+
17
+ ### Fixed
18
+
19
+ - `Phone` parameter instead of `PhoneNumber` for MBWay
20
+ - Timeout should be in secondes instead of milliseconds in the configuration
1
21
  ## [3.14.0] - 2023-06-21
2
22
  ### Added
3
23
 
data/lib/mangopay/card.rb CHANGED
@@ -35,6 +35,11 @@ module MangoPay
35
35
  def get_pre_authorizations(card_id, filters = {})
36
36
  MangoPay.request(:get, "#{MangoPay.api_path}/cards/#{card_id}/preauthorizations")
37
37
  end
38
+
39
+ def validate(card_id, params)
40
+ url = "#{MangoPay.api_path}/cards/#{card_id}/validation"
41
+ MangoPay.request(:post, url, params)
42
+ end
38
43
  end
39
44
  end
40
45
  end
@@ -72,11 +72,6 @@ module MangoPay
72
72
  MangoPay.request(:get, url() + "/wallets/#{funds_type}/#{currency_iso_code}/transactions", {}, filters)
73
73
  end
74
74
 
75
- def validate(client_id, card_id)
76
- url = "#{MangoPay.api_path}/cards/#{card_id}/validate"
77
- MangoPay.request(:post, url)
78
- end
79
-
80
75
  def create_bank_account(params)
81
76
  MangoPay.request(:post, url() + "/bankaccounts/iban", params)
82
77
  end
@@ -48,7 +48,7 @@ module MangoPay
48
48
  super(message) if message
49
49
  end
50
50
 
51
- def type; @details['Type']; end
51
+ def type; @details['Type'] || @details['type']; end
52
52
  def error; @details['error']; end
53
53
  def errors; @details['errors'] || error; end
54
54
 
@@ -56,7 +56,7 @@ module MangoPay
56
56
  if error
57
57
  msg = error
58
58
  else
59
- msg = @details['Message']
59
+ msg = @details['Message'] || @details['message']
60
60
  msg += errors.sort.map {|k,v| " #{k}: #{v}"}.join if (errors && errors.is_a?(Hash))
61
61
  msg
62
62
  end
@@ -101,11 +101,17 @@ module MangoPay
101
101
  module PayPal
102
102
 
103
103
  # See https://docs.mangopay.com/api-references/payins/paypal-payin/
104
+ # # <b>DEPRECATED</b>: 'create' function is now deprecated.
105
+ # Please use the 'create_v2' function - MangoPay::PayIn::PayPal::Web.create_new(params)
104
106
  class Web < Resource
105
107
  include HTTPCalls::Create
106
108
  def self.url(*)
107
109
  "#{MangoPay.api_path}/payins/paypal/#{CGI.escape(class_name.downcase)}"
108
110
  end
111
+
112
+ def self.create_v2(params, idempotency_key = nil)
113
+ MangoPay.request(:post, "#{MangoPay.api_path}/payins/payment-methods/paypal", params, {}, idempotency_key)
114
+ end
109
115
  end
110
116
 
111
117
  end
@@ -136,13 +142,13 @@ module MangoPay
136
142
  include HTTPCalls::Create
137
143
 
138
144
  def self.url(*)
139
- "#{MangoPay.api_path}/payins/googlepay/#{CGI.escape(class_name.downcase)}"
145
+ "#{MangoPay.api_path}/payins/payment-methods/googlepay"
140
146
  end
141
147
  end
142
148
  end
143
149
 
144
150
  module Mbway
145
- class Direct < Resource
151
+ class Web < Resource
146
152
  include HTTPCalls::Create
147
153
 
148
154
  def self.url(*)
@@ -151,6 +157,36 @@ module MangoPay
151
157
  end
152
158
  end
153
159
 
160
+ module Multibanco
161
+ class Web < Resource
162
+ include HTTPCalls::Create
163
+
164
+ def self.url(*)
165
+ "#{MangoPay.api_path}/payins/payment-methods/multibanco"
166
+ end
167
+ end
168
+ end
169
+
170
+ module Blik
171
+ class Web < Resource
172
+ include HTTPCalls::Create
173
+
174
+ def self.url(*)
175
+ "#{MangoPay.api_path}/payins/payment-methods/blik"
176
+ end
177
+ end
178
+ end
179
+
180
+ module Satispay
181
+ class Web < Resource
182
+ include HTTPCalls::Create
183
+
184
+ def self.url(*)
185
+ "#{MangoPay.api_path}/payins/payment-methods/satispay"
186
+ end
187
+ end
188
+ end
189
+
154
190
  module RecurringPayments
155
191
  class Recurring < Resource
156
192
  include HTTPCalls::Create
@@ -1,3 +1,3 @@
1
1
  module MangoPay
2
- VERSION = '3.14.0'
2
+ VERSION = '3.16.0'
3
3
  end
data/lib/mangopay.rb CHANGED
@@ -64,7 +64,7 @@ module MangoPay
64
64
  end
65
65
 
66
66
  def http_timeout
67
- @http_timeout || 30000
67
+ @http_timeout || 30
68
68
  end
69
69
 
70
70
  def http_max_retries
@@ -72,7 +72,7 @@ module MangoPay
72
72
  end
73
73
 
74
74
  def http_open_timeout
75
- @http_open_timeout || 60000
75
+ @http_open_timeout || 30
76
76
  end
77
77
  end
78
78
 
@@ -92,4 +92,13 @@ describe MangoPay::CardRegistration do
92
92
  expect(transactions).to be_an(Array)
93
93
  end
94
94
  end
95
+
96
+ describe 'VALIDATE CARD' do
97
+ it "validates a card" do
98
+ created = new_card_registration_completed
99
+ validated = create_card_validation(created['UserId'], created['CardId'])
100
+
101
+ expect(validated).to_not be_nil
102
+ end
103
+ end
95
104
  end
@@ -0,0 +1,32 @@
1
+ describe MangoPay::PayIn::Blik::Web, 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('BLIK')
9
+ expect(payin['ExecutionType']).to eq('WEB')
10
+ expect(payin['Status']).to eq('CREATED')
11
+ end
12
+
13
+ describe 'CREATE' do
14
+ it 'creates a blik web payin' do
15
+ created = new_payin_blik_web
16
+ expect(created['Id']).not_to be_nil
17
+ expect(created['ReturnURL']).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_blik_web
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
@@ -0,0 +1,21 @@
1
+ describe MangoPay::PayIn::GooglePay::Direct, 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('GOOGLE_PAY')
8
+ expect(payin['ExecutionType']).to eq('DIRECT')
9
+ expect(payin['Status']).to eq('CREATED')
10
+ end
11
+
12
+ describe 'CREATE' do
13
+ it 'creates a googlepay direct payin' do
14
+ pending("Cannot be tested due to impossibility to generate payment_data in test")
15
+ created = new_payin_googlepay_direct
16
+ expect(created['Id']).not_to be_nil
17
+ check_type_and_status(created)
18
+ end
19
+ end
20
+ end
21
+
@@ -1,4 +1,4 @@
1
- describe MangoPay::PayIn::Mbway::Direct, type: :feature do
1
+ describe MangoPay::PayIn::Mbway::Web, type: :feature do
2
2
  include_context 'wallets'
3
3
  include_context 'payins'
4
4
 
@@ -6,22 +6,22 @@ describe MangoPay::PayIn::Mbway::Direct, type: :feature do
6
6
  expect(payin['Type']).to eq('PAYIN')
7
7
  expect(payin['Nature']).to eq('REGULAR')
8
8
  expect(payin['PaymentType']).to eq('MBWAY')
9
- expect(payin['ExecutionType']).to eq('DIRECT')
9
+ expect(payin['ExecutionType']).to eq('WEB')
10
10
  expect(payin['Status']).to eq('CREATED')
11
11
  end
12
12
 
13
13
  describe 'CREATE' do
14
- it 'creates a mbway direct payin' do
15
- created = new_payin_mbway_direct
14
+ it 'creates a mbway web payin' do
15
+ created = new_payin_mbway_web
16
16
  expect(created['Id']).not_to be_nil
17
- expect(created['PhoneNumber']).not_to be_nil
17
+ expect(created['Phone']).not_to be_nil
18
18
  check_type_and_status(created)
19
19
  end
20
20
  end
21
21
 
22
22
  describe 'FETCH' do
23
23
  it 'fetches a payin' do
24
- created = new_payin_mbway_direct
24
+ created = new_payin_mbway_web
25
25
  fetched = MangoPay::PayIn.fetch(created['Id'])
26
26
  expect(fetched['Id']).to eq(created['Id'])
27
27
  check_type_and_status(created)
@@ -0,0 +1,32 @@
1
+ describe MangoPay::PayIn::Multibanco::Web, 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('MULTIBANCO')
9
+ expect(payin['ExecutionType']).to eq('WEB')
10
+ expect(payin['Status']).to eq('CREATED')
11
+ end
12
+
13
+ describe 'CREATE' do
14
+ it 'creates a multibanco web payin' do
15
+ created = new_payin_multibanco_web
16
+ expect(created['Id']).not_to be_nil
17
+ expect(created['ReturnURL']).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_multibanco_web
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
@@ -22,6 +22,14 @@ describe MangoPay::PayIn::PayPal::Web, type: :feature do
22
22
  end
23
23
  end
24
24
 
25
+ describe 'CREATE V2' do
26
+ it 'creates a paypal web v2 payin' do
27
+ created = new_payin_paypal_web_v2
28
+ expect(created['Id']).not_to be_nil
29
+ check_type_and_status(created)
30
+ end
31
+ end
32
+
25
33
  describe "FETCH" do
26
34
  it 'FETCHES a payIn with PayPal account email' do
27
35
  payin_id = "54088959"
@@ -47,4 +55,17 @@ describe MangoPay::PayIn::PayPal::Web, type: :feature do
47
55
  end
48
56
  end
49
57
 
58
+ describe 'FETCH V2' do
59
+ it 'fetches a payin' do
60
+ created = new_payin_paypal_web_v2
61
+ fetched = MangoPay::PayIn.fetch(created['Id'])
62
+ expect(fetched['Id']).to eq(created['Id'])
63
+ expect(fetched['CreationDate']).to eq(created['CreationDate'])
64
+ expect(fetched['CreditedFunds']).to eq(created['CreditedFunds'])
65
+ expect(fetched['CreditedWalletId']).to eq(created['CreditedWalletId'])
66
+ check_type_and_status(created)
67
+ check_type_and_status(fetched)
68
+ end
69
+ end
70
+
50
71
  end
@@ -0,0 +1,32 @@
1
+ describe MangoPay::PayIn::Satispay::Web, 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('SATISPAY')
9
+ expect(payin['ExecutionType']).to eq('WEB')
10
+ expect(payin['Status']).to eq('CREATED')
11
+ end
12
+
13
+ describe 'CREATE' do
14
+ it 'creates a satispay web payin' do
15
+ created = new_payin_satispay_web
16
+ expect(created['Id']).not_to be_nil
17
+ expect(created['Country']).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_satispay_web
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
@@ -261,27 +261,50 @@ shared_context 'payins' do
261
261
  let(:new_payin_googlepay_direct) do
262
262
  MangoPay::PayIn::GooglePay::Direct.create(
263
263
  AuthorId: new_natural_user['Id'],
264
- CreditedUserId: new_wallet['Owners'][0],
265
264
  CreditedWalletId: new_wallet['Id'],
266
265
  DebitedFunds: {Currency: 'EUR', Amount: 199},
267
266
  Fees: {Currency: 'EUR', Amount: 1},
268
- PaymentData: {
269
- TransactionId: '061EB32181A2D9CA42AD16031B476EEBAA62A9A095AD660E2759FBA52B51A61',
270
- Network: 'VISA',
271
- TokenData: "tokenData"
272
- },
273
267
  StatementDescriptor: "ruby",
274
- ReturnURL: MangoPay.configuration.root_url,
275
268
  Tag: 'Test PayIn/GooglePay/Direct',
269
+ IpAddress: "2001:0620:0000:0000:0211:24FF:FE80:C12C",
270
+ SecureModeReturnURL: 'http://test.com',
271
+ SecureMode: 'DEFAULT',
272
+ ReturnURL: 'https://mangopay.com/docs/please-ignore',
273
+ BrowserInfo: {
274
+ AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
275
+ JavaEnabled: true,
276
+ Language: "fr-FR",
277
+ ColorDepth: 4,
278
+ ScreenHeight: 1800,
279
+ ScreenWidth: 400,
280
+ JavascriptEnabled: true,
281
+ TimeZoneOffset: "+60",
282
+ UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
283
+ },
284
+ PaymentData: "{\"signature\":\"MEUCIQCLXOan2Y9DobLVSOeD5V64Peayvz0ZAWisdz/1iTdthAIgVFb4Hve4EhtW81k46SiMlnXLIiCn1h2+vVQGjHe+sSo\\u003d\",\"intermediateSigningKey\":{\"signedKey\":\"{\\\"keyValue\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEDGRER6R6PH6K39YTIYX+CpDNej6gQgvi/Wx19SOPtiDnkjAl4/LF9pXlvZYe+aJH0Dy095I6BlfY8bNBB5gjPg\\\\u003d\\\\u003d\\\",\\\"keyExpiration\\\":\\\"1688521049102\\\"}\",\"signatures\":[\"MEYCIQDup1B+rkiPAWmpg7RmqY0NfgdGhmdyL8wvAX+6C1aOU2QIhAIZACSDQ/ZexIyEia5KrRlG2B+y3AnKNlhRzumRcnNOR\"]},\"protocolVersion\":\"ECv2\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"YSSGK9yFdKP+mJB5+wAjnOujnThPM1E/KbbJxd3MDzPVI66ip1DBESldvQXYjjeLq6Rf1tKE9oLwwaj6u0/gU7Z9t3g1MoW+9YoEE1bs1IxImif7IQGAosfYjjbBBfDkOaqEs2JJC5qt6xjKO9lQ/E6JPkPFGqF7+OJ1vzmD83Pi3sHWkVge5MhxXQ3yBNhrjus3kV7zUoYA+uqNrciWcWypc1NndF/tiwSkvUTzM6n4dS8X84fkJiSO7PZ65C0yw0mdybRRnyL2fFdWGssve1zZFAvYfzcpNamyuZGGlu/SCoayitojmMsqe5Cu0efD9+WvvDr9PA+Vo1gzuz7LmiZe81SGvdFhRoq62FBAUiwSsi2A3pWinZxM2XbYNph+HJ5FCNspWhz4ur9JG4ZMLemCXuaybvL++W6PWywAtoiE0mQcBIX3vhOq5itv0RkaKVe6nbcAS2UryRz2u/nDCJLKpIv2Wi11NtCUT2mgD8F6qfcXhvVZHyeLqZ1OLgCudTTSdKirzezbgPTg4tQpW++KufeD7bgG+01XhCWt+7/ftqcSf8n//gSRINne8j2G6w+2\\\",\\\"ephemeralPublicKey\\\":\\\"BLY2+R8C0T+BSf/W3HEq305qH63IGmJxMVmbfJ6+x1V7GQg9W9v7eHc3j+8TeypVn+nRlPu98tivuMXECg+rWZs\\\\u003d\\\",\\\"tag\\\":\\\"MmEjNdLfsDNfYd/FRUjoJ4/IfLypNRqx8zgHfa6Ftmo\\\\u003d\\\"}\"}",
276
285
  Billing: {
277
- Address: {
278
- AddressLine1: 'AddressLine1',
279
- AddressLine2: 'AddressLine2',
280
- City: 'City',
281
- Region: 'Region',
282
- PostalCode: 'PostalCode',
283
- CountryIso: 'FR'
284
- }
286
+ FirstName: 'FName',
287
+ LastName: 'LName',
288
+ Address: {
289
+ AddressLine1: 'AddressLine1',
290
+ AddressLine2: 'AddressLine2',
291
+ City: 'City',
292
+ Region: 'Region',
293
+ PostalCode: 'PostalCode',
294
+ Country: 'FR'
295
+ }
296
+ },
297
+ Shipping: {
298
+ FirstName: 'FName',
299
+ LastName: 'LName',
300
+ Address: {
301
+ AddressLine1: 'AddressLine1',
302
+ AddressLine2: 'AddressLine2',
303
+ City: 'City',
304
+ Region: 'Region',
305
+ PostalCode: 'PostalCode',
306
+ Country: 'FR'
307
+ }
285
308
  }
286
309
  )
287
310
  end
@@ -418,17 +441,114 @@ shared_context 'payins' do
418
441
  let(:new_payin_card_direct) { create_new_payin_card_direct(new_wallet) }
419
442
 
420
443
  ###############################################
421
- # MBWAY/direct
444
+ # MBWAY/web
445
+ ###############################################
446
+ let(:new_payin_mbway_web) do
447
+ MangoPay::PayIn::Mbway::Web.create(
448
+ AuthorId: new_natural_user['Id'],
449
+ CreditedWalletId: new_wallet['Id'],
450
+ DebitedFunds: {Currency: 'EUR', Amount: 199},
451
+ Fees: {Currency: 'EUR', Amount: 1},
452
+ StatementDescriptor: "ruby",
453
+ Tag: 'Test PayIn/Mbway/Web',
454
+ Phone: '351#269458236'
455
+ )
456
+ end
457
+
458
+ ###############################################
459
+ # MULTIBANCO/web
460
+ ###############################################
461
+ let(:new_payin_multibanco_web) do
462
+ MangoPay::PayIn::Multibanco::Web.create(
463
+ AuthorId: new_natural_user['Id'],
464
+ DebitedFunds: {Currency: 'EUR', Amount: 199},
465
+ Fees: {Currency: 'EUR', Amount: 1},
466
+ CreditedWalletId: new_wallet['Id'],
467
+ StatementDescriptor: "ruby",
468
+ Tag: 'Test PayIn/Multibanco/Web',
469
+ ReturnURL: 'http://www.my-site.com/returnURL'
470
+ )
471
+ end
472
+
473
+ ###############################################
474
+ # BLIK/web
422
475
  ###############################################
423
- let(:new_payin_mbway_direct) do
424
- MangoPay::PayIn::Mbway::Direct.create(
476
+ let(:new_payin_blik_web) do
477
+ user = new_natural_user
478
+ wallet = MangoPay::Wallet.create(
479
+ Owners: [user['Id']],
480
+ Description: 'A test wallet',
481
+ Currency: 'PLN',
482
+ Tag: 'Test wallet'
483
+ )
484
+ MangoPay::PayIn::Blik::Web.create(
485
+ AuthorId: user['Id'],
486
+ CreditedWalletId: wallet['Id'],
487
+ DebitedFunds: {Currency: 'PLN', Amount: 199},
488
+ Fees: {Currency: 'PLN', Amount: 1},
489
+ StatementDescriptor: "ruby",
490
+ Tag: 'Test PayIn/Blik/Web',
491
+ ReturnURL: 'https://example.com'
492
+ )
493
+ end
494
+
495
+ ###############################################
496
+ # SATISPAY/web
497
+ ###############################################
498
+ let(:new_payin_satispay_web) do
499
+ MangoPay::PayIn::Satispay::Web.create(
425
500
  AuthorId: new_natural_user['Id'],
426
501
  CreditedWalletId: new_wallet['Id'],
427
502
  DebitedFunds: {Currency: 'EUR', Amount: 199},
428
503
  Fees: {Currency: 'EUR', Amount: 1},
429
504
  StatementDescriptor: "ruby",
430
- Tag: 'Test PayIn/Mbway/Direct',
431
- PhoneNumber: '351#269458236'
505
+ Tag: 'Test PayIn/Mbway/Web',
506
+ Country: 'IT',
507
+ ReturnURL: 'http://www.my-site.com/returnURL'
508
+ )
509
+ end
510
+
511
+ ###############################################
512
+ # PAYPAL/direct
513
+ ###############################################
514
+ let(:new_payin_paypal_web_v2) do
515
+ MangoPay::PayIn::PayPal::Web.create_v2(
516
+ AuthorId: new_natural_user['Id'],
517
+ DebitedFunds: { Currency: 'EUR', Amount: 400 },
518
+ Fees: { Currency: 'EUR', Amount: 0 },
519
+ CreditedWalletId: new_wallet['Id'],
520
+ ReturnUrl: "http://example.com",
521
+ LineItems: [
522
+ {
523
+ Name: "running shoes",
524
+ Quantity: 1,
525
+ UnitAmount: 200,
526
+ TaxAmount: 0,
527
+ Description: "seller1 ID"
528
+ },
529
+ {
530
+ Name: "running shoes",
531
+ Quantity: 1,
532
+ UnitAmount: 200,
533
+ TaxAmount: 0,
534
+ Description: "seller2 ID"
535
+ }
536
+ ],
537
+ Shipping: {
538
+ Address: {
539
+ AddressLine1: 'AddressLine1',
540
+ AddressLine2: 'AddressLine2',
541
+ City: 'City',
542
+ Region: 'Region',
543
+ PostalCode: 'PostalCode',
544
+ Country: 'FR'
545
+ },
546
+ FirstName: 'Joe',
547
+ LastName: 'Blogs'
548
+ },
549
+ StatementDescriptor: "ruby",
550
+ Tag: 'Test',
551
+ # Culture: 'FR'
432
552
  )
433
553
  end
434
554
 
@@ -517,6 +637,27 @@ shared_context 'payins' do
517
637
  )
518
638
  end
519
639
 
640
+ def create_card_validation(author_id, card_id)
641
+ params = {
642
+ AuthorId: author_id,
643
+ SecureModeReturnURL: "https://mangopay.com",
644
+ IpAddress: "2001:0620:0000:0000:0211:24FF:FE80:C12C",
645
+ Tag: "custom meta",
646
+ BrowserInfo: {
647
+ AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
648
+ JavaEnabled: true,
649
+ Language: "FR-FR",
650
+ ColorDepth: 4,
651
+ ScreenHeight: 1800,
652
+ ScreenWidth: 400,
653
+ JavascriptEnabled: true,
654
+ TimeZoneOffset: "+60",
655
+ UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
656
+ }
657
+ }
658
+ MangoPay::Card.validate(card_id, params)
659
+ end
660
+
520
661
  ###############################################
521
662
  # pre-authorized direct deposit
522
663
  ###############################################
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.14.0
4
+ version: 3.16.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: 2023-06-21 00:00:00.000000000 Z
12
+ date: 2023-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -130,14 +130,18 @@ files:
130
130
  - spec/mangopay/payin_applepay_direct_spec.rb
131
131
  - spec/mangopay/payin_bankwire_direct_spec.rb
132
132
  - spec/mangopay/payin_bankwire_external_instruction_spec.rb
133
+ - spec/mangopay/payin_blik_web_spec.rb
133
134
  - spec/mangopay/payin_card_direct_spec.rb
134
135
  - spec/mangopay/payin_card_web_spec.rb
135
136
  - spec/mangopay/payin_directdebit_direct_spec.rb
136
137
  - spec/mangopay/payin_directdebit_web_spec.rb
137
- - spec/mangopay/payin_mbway_direct_spec.rb
138
+ - spec/mangopay/payin_googlepay_direct_spec.rb
139
+ - spec/mangopay/payin_mbway_web_spec.rb
140
+ - spec/mangopay/payin_multibanco_web_spec.rb
138
141
  - spec/mangopay/payin_payconiq_web_spec.rb
139
142
  - spec/mangopay/payin_paypal_web_spec.rb
140
143
  - spec/mangopay/payin_preauthorized_direct_spec.rb
144
+ - spec/mangopay/payin_satispay_web_spec.rb
141
145
  - spec/mangopay/payout_bankwire_spec.rb
142
146
  - spec/mangopay/preauthorization_spec.rb
143
147
  - spec/mangopay/recurring_payin_spec.rb
@@ -199,14 +203,18 @@ test_files:
199
203
  - spec/mangopay/payin_applepay_direct_spec.rb
200
204
  - spec/mangopay/payin_bankwire_direct_spec.rb
201
205
  - spec/mangopay/payin_bankwire_external_instruction_spec.rb
206
+ - spec/mangopay/payin_blik_web_spec.rb
202
207
  - spec/mangopay/payin_card_direct_spec.rb
203
208
  - spec/mangopay/payin_card_web_spec.rb
204
209
  - spec/mangopay/payin_directdebit_direct_spec.rb
205
210
  - spec/mangopay/payin_directdebit_web_spec.rb
206
- - spec/mangopay/payin_mbway_direct_spec.rb
211
+ - spec/mangopay/payin_googlepay_direct_spec.rb
212
+ - spec/mangopay/payin_mbway_web_spec.rb
213
+ - spec/mangopay/payin_multibanco_web_spec.rb
207
214
  - spec/mangopay/payin_payconiq_web_spec.rb
208
215
  - spec/mangopay/payin_paypal_web_spec.rb
209
216
  - spec/mangopay/payin_preauthorized_direct_spec.rb
217
+ - spec/mangopay/payin_satispay_web_spec.rb
210
218
  - spec/mangopay/payout_bankwire_spec.rb
211
219
  - spec/mangopay/preauthorization_spec.rb
212
220
  - spec/mangopay/recurring_payin_spec.rb