mangopay 3.18.0 → 3.19.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: 4bb8e0bce0fbb8b2a758340182c8be4b0d904ae358cf72637da7e7c63d2413b7
4
- data.tar.gz: ebeacb1b39d233d2ebec9326d61c69213111fa1dd945f4541068c73fdcbc5061
3
+ metadata.gz: 2459553bb0f22fb9230f0b13fa8068e6dccb7996c3436a669bea65e05af3e575
4
+ data.tar.gz: 1242453e9fd1f2d9fb943c737c0eef69e1caf26aed2aaae24ee2012803816ddc
5
5
  SHA512:
6
- metadata.gz: 3514922d67baa1a1f21fc2fe459fdeca27fd958c4214f0f66daddf3c29358f22cbbf16eb0ee95930c3f882b9e551340c2d59b6f40cf5578c0b5ab698e71e7ea8
7
- data.tar.gz: 2ee8d0c7015e18a84df5468c869dc328a808ef841da61b4ade65d2223d2eb4031de08e3a6628d26510b241d333d7116ada4881e9329bd0d243907773e5239abc
6
+ metadata.gz: f3478fdff62b888c86e3e38d1079cd467eb0e7860e16fc9977d9e6be49bec4c645e5a63b0a954c2f416577788abd125759d6b079e191b55a846af524044598e9
7
+ data.tar.gz: 11634f163a8d798787a4a1a200592b2387caf05df99df24a4089add703d6128f648aaa8c884c590bbaba2e53ab85ca45100e52fbb3ff89e218a6e0c9d7ddfedb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [3.19.0] - 2023-11-02
2
+ ### Updated
3
+
4
+ - Giropay and Ideal integrations with Mangopay have been improved.
5
+ - Klarna param "MerchantOrderId" has been renamed to "Reference"
6
+
1
7
  ## [3.18.0] - 2023-09-29
2
8
  ### Added
3
9
  - Instantly convert funds between 2 wallets of different currencies owned by the same user with the new SPOT FX endpoints
@@ -197,6 +197,26 @@ module MangoPay
197
197
  end
198
198
  end
199
199
 
200
+ module Ideal
201
+ class Web < Resource
202
+ include HTTPCalls::Create
203
+
204
+ def self.url(*)
205
+ "#{MangoPay.api_path}/payins/payment-methods/ideal"
206
+ end
207
+ end
208
+ end
209
+
210
+ module Giropay
211
+ class Web < Resource
212
+ include HTTPCalls::Create
213
+
214
+ def self.url(*)
215
+ "#{MangoPay.api_path}/payins/payment-methods/giropay"
216
+ end
217
+ end
218
+ end
219
+
200
220
  module RecurringPayments
201
221
  class Recurring < Resource
202
222
  include HTTPCalls::Create
@@ -1,3 +1,3 @@
1
1
  module MangoPay
2
- VERSION = '3.18.0'
2
+ VERSION = '3.19.0'
3
3
  end
@@ -0,0 +1,30 @@
1
+ describe MangoPay::PayIn::Giropay::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('GIROPAY')
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 giropay web payin' do
15
+ created = new_payin_giropay_web
16
+ expect(created['Id']).not_to be_nil
17
+ check_type_and_status(created)
18
+ end
19
+ end
20
+
21
+ describe 'FETCH' do
22
+ it 'fetches a payin' do
23
+ created = new_payin_giropay_web
24
+ fetched = MangoPay::PayIn.fetch(created['Id'])
25
+ expect(fetched['Id']).to eq(created['Id'])
26
+ check_type_and_status(created)
27
+ check_type_and_status(fetched)
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,30 @@
1
+ describe MangoPay::PayIn::Ideal::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('IDEAL')
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 ideal web payin' do
15
+ created = new_payin_ideal_web
16
+ expect(created['Id']).not_to be_nil
17
+ check_type_and_status(created)
18
+ end
19
+ end
20
+
21
+ describe 'FETCH' do
22
+ it 'fetches a payin' do
23
+ created = new_payin_ideal_web
24
+ fetched = MangoPay::PayIn.fetch(created['Id'])
25
+ expect(fetched['Id']).to eq(created['Id'])
26
+ check_type_and_status(created)
27
+ check_type_and_status(fetched)
28
+ end
29
+ end
30
+ end
@@ -562,11 +562,42 @@ shared_context 'payins' do
562
562
  FirstName: 'Joe',
563
563
  LastName: 'Blogs'
564
564
  },
565
- MerchantOrderId: 'afd48-879d-48fg',
565
+ Reference: 'afd48-879d-48fg',
566
566
  Tag: 'Test PayIn/Klarna/Web'
567
567
  )
568
568
  end
569
569
 
570
+ ###############################################
571
+ # IDEAL/web
572
+ ###############################################
573
+ let(:new_payin_ideal_web) do
574
+ MangoPay::PayIn::Ideal::Web.create(
575
+ AuthorId: new_natural_user['Id'],
576
+ CreditedWalletId: new_wallet['Id'],
577
+ DebitedFunds: {Currency: 'EUR', Amount: 400},
578
+ Fees: {Currency: 'EUR', Amount: 10},
579
+ ReturnURL: 'http://www.my-site.com/returnURL',
580
+ Bic: 'REVOLT21',
581
+ StatementDescriptor: "test",
582
+ Tag: 'Test PayIn/Ideal/Web'
583
+ )
584
+ end
585
+
586
+ ###############################################
587
+ # Giropay/web
588
+ ###############################################
589
+ let(:new_payin_giropay_web) do
590
+ MangoPay::PayIn::Giropay::Web.create(
591
+ AuthorId: new_natural_user['Id'],
592
+ CreditedWalletId: new_wallet['Id'],
593
+ DebitedFunds: {Currency: 'EUR', Amount: 400},
594
+ Fees: {Currency: 'EUR', Amount: 10},
595
+ ReturnURL: 'http://www.my-site.com/returnURL',
596
+ StatementDescriptor: "test",
597
+ Tag: 'Test PayIn/Giropay/Web'
598
+ )
599
+ end
600
+
570
601
  ###############################################
571
602
  # PAYPAL/web V2
572
603
  ###############################################
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.18.0
4
+ version: 3.19.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-09-29 00:00:00.000000000 Z
12
+ date: 2023-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -137,7 +137,9 @@ files:
137
137
  - spec/mangopay/payin_card_web_spec.rb
138
138
  - spec/mangopay/payin_directdebit_direct_spec.rb
139
139
  - spec/mangopay/payin_directdebit_web_spec.rb
140
+ - spec/mangopay/payin_giropay_web_spec.rb
140
141
  - spec/mangopay/payin_googlepay_direct_spec.rb
142
+ - spec/mangopay/payin_ideal_web_spec.rb
141
143
  - spec/mangopay/payin_klarna_web_spec.rb
142
144
  - spec/mangopay/payin_mbway_web_spec.rb
143
145
  - spec/mangopay/payin_multibanco_web_spec.rb
@@ -212,7 +214,9 @@ test_files:
212
214
  - spec/mangopay/payin_card_web_spec.rb
213
215
  - spec/mangopay/payin_directdebit_direct_spec.rb
214
216
  - spec/mangopay/payin_directdebit_web_spec.rb
217
+ - spec/mangopay/payin_giropay_web_spec.rb
215
218
  - spec/mangopay/payin_googlepay_direct_spec.rb
219
+ - spec/mangopay/payin_ideal_web_spec.rb
216
220
  - spec/mangopay/payin_klarna_web_spec.rb
217
221
  - spec/mangopay/payin_mbway_web_spec.rb
218
222
  - spec/mangopay/payin_multibanco_web_spec.rb