mangopay 3.7.0 → 3.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 508461f85b104c5fc4670347ca07dd80fceaa1783a46339d26d98332f00b7030
4
- data.tar.gz: 32d29746e95fb843ed856cb3a7cbe2513bf62e3f5f3145eebff249f8c756934a
3
+ metadata.gz: 27372664cdb5c2c9155a08ab3b9a5ebddd31f261f86c154d0b64ae2d346c4e9f
4
+ data.tar.gz: ba496e8fff4adb93001b20b69081d7edfb5cb95c80722f1e9cc155bfc342af98
5
5
  SHA512:
6
- metadata.gz: 6258fcdfec472aaf69a5a1107e68dbdef041bb4f0dc1dc0ed5e09cc8e211d47e5d79c8ca21ab3a2560cb02c969478081d221a27cb4b0be2fcfb0fb68b3361ef1
7
- data.tar.gz: 3083417ce359cbe42ce2be77a2051c5f4b8cae8fd0ae8d386b3899581b812ded7e6318508dd16d2f1d8ed103cac2dd6fe748953c9429b09d9b5ae006d9803696
6
+ metadata.gz: 7663a69824b9b188227c1a78a9bec1589f368bd84893cb3915b856c53e3df4453416d0593060a49d74a2132bdcf4e624430704619f9189396ebe660ed6d845f4
7
+ data.tar.gz: 6e48f2457c2ac4ce3b32a8814b93ccd8e10bb91d689b5d2d5508398ab8c7bb3596500eb104d250a6c1f84dec2f48667c8249774a791bebf4021976ee5a56c861
data/CHANGELOG.md CHANGED
@@ -1,3 +1,37 @@
1
+ ## [3.10.0] - 2022-06-29
2
+ ##Added
3
+ **Recurring: €0 deadlines for CIT**
4
+
5
+ Setting free recurring payment deadlines is now possible for CIT (customer-initiated transactions) with the **FreeCycles** parameter.
6
+
7
+ The **FreeCycles** parameter allows platforms to define the number of consecutive deadlines that will be free. The following endpoints have been updated to take into account this new parameter:
8
+
9
+ <a href="https://docs.mangopay.com/endpoints/v2.01/payins#e1051_create-a-recurring-payin-registration">Create a Recurring PayIn Registration</a><br>
10
+ <a href="https://docs.mangopay.com/endpoints/v2.01/payins#e1056_view-a-recurring-payin-registration">View a Recurring PayIn Registration</a><br>
11
+
12
+ This feature provides new automation capabilities for platforms with offers such as “Get the first month free” or “free trial” subscriptions.
13
+
14
+ Please refer to the <a href="https://docs.mangopay.com/guide/recurring-payments-introduction">Recurring payments overview</a> documentation for more information.
15
+
16
+ ## [3.9.0] - 2022.03.31
17
+ ### Added
18
+
19
+ #### Instant payment eligibility check
20
+
21
+ With the function
22
+ `PayOut::InstantPayoutEligibility::Reachability.create(params)`
23
+ the destination bank reachability can now be verified prior to making an instant payout. This results in a better user experience, as this preliminary check will allow the platform to propose the instant payout option only to end users whose bank is eligible.
24
+
25
+ ## [3.8.0] - 2021.10.20
26
+ ## Added
27
+
28
+ You can now change the status to "ENDED" for a recurring payment.
29
+
30
+ ## Fixed
31
+
32
+ - "Status" is now available in the response when you request a recurring payment registration.
33
+
34
+
1
35
  ## [3.7.0] - 2021.10.11
2
36
  ## Added
3
37
 
@@ -140,6 +140,8 @@ module MangoPay
140
140
  module RecurringPayments
141
141
  class Recurring < Resource
142
142
  include HTTPCalls::Create
143
+ include HTTPCalls::Fetch
144
+ include HTTPCalls::Update
143
145
 
144
146
  def self.url(*args)
145
147
  if args.any?
@@ -26,5 +26,16 @@ module MangoPay
26
26
  MangoPay.request(:get, url);
27
27
  end
28
28
  end
29
+
30
+ # See https://docs.mangopay.com/endpoints/v2.01/payouts#e1058_check-instant-payout-eligibility
31
+ module InstantPayoutEligibility
32
+ class Reachability < Resource
33
+ include HTTPCalls::Create
34
+
35
+ def self.url(*)
36
+ "#{MangoPay.api_path}/payouts/reachability"
37
+ end
38
+ end
39
+ end
29
40
  end
30
41
  end
@@ -1,3 +1,3 @@
1
1
  module MangoPay
2
- VERSION = '3.7.0'
2
+ VERSION = '3.10.0'
3
3
  end
@@ -126,18 +126,18 @@ describe MangoPay::Client do
126
126
  end
127
127
  end
128
128
 
129
- describe 'validate' do
130
- it 'validates card' do
131
- client = MangoPay::Client.fetch
132
- completed = new_card_registration_completed
133
- card_id = completed['CardId']
134
- client_id = client['ClientId']
135
-
136
- card = MangoPay::Client.validate(client_id, card_id)
137
- expect(client).not_to be_nil
138
- expect(card).not_to be_nil
139
- end
140
- end
129
+ # describe 'validate' do
130
+ # it 'validates card' do
131
+ # client = MangoPay::Client.fetch
132
+ # completed = new_card_registration_completed
133
+ # card_id = completed['CardId']
134
+ # client_id = client['ClientId']
135
+ #
136
+ # card = MangoPay::Client.validate(client_id, card_id)
137
+ # expect(client).not_to be_nil
138
+ # expect(card).not_to be_nil
139
+ # end
140
+ # end
141
141
 
142
142
  describe 'create_bank_account' do
143
143
  it 'creates a new bank account' do
@@ -11,7 +11,7 @@ describe MangoPay::PayIn::ApplePay::Direct, type: :feature do
11
11
 
12
12
  describe 'CREATE' do
13
13
  it 'creates a applepay direct payin' do
14
- #pending("no cards to test for")
14
+ pending("no cards to test for")
15
15
  created = new_payin_applepay_direct
16
16
  expect(created['Id']).not_to be_nil
17
17
  check_type_and_status(created)
@@ -49,6 +49,26 @@ describe MangoPay::PayOut::BankWire, type: :feature do
49
49
  end
50
50
  end
51
51
 
52
+ describe 'Check Eligibility' do
53
+ it 'checks the eligibility of a payout' do
54
+ created = new_payout_bankwire
55
+
56
+ eligibility = MangoPay::PayOut::InstantPayoutEligibility::Reachability.create(
57
+ AuthorId: created['AuthorId'],
58
+ DebitedFunds: {
59
+ Amount: 10,
60
+ Currency: 'EUR'
61
+ },
62
+ PayoutModeRequested: 'INSTANT_PAYMENT',
63
+ BankAccountId: created['BankAccountId'],
64
+ DebitedWalletId: created['DebitedWalletId']
65
+ )
66
+
67
+ expect(created).not_to be_nil
68
+ expect(eligibility).not_to be_nil
69
+ end
70
+ end
71
+
52
72
  describe 'FETCH' do
53
73
  it 'fetches a payout' do
54
74
  created = new_payout_bankwire
@@ -37,9 +37,19 @@ describe MangoPay::PayIn::RecurringPayments, type: :feature do
37
37
  },
38
38
  FirstName: 'Joe',
39
39
  LastName: 'Blogs'
40
- }
40
+ },
41
+ FreeCycles: 0
41
42
  )
42
43
  expect(recurring).not_to be_nil
44
+ expect(recurring['Status']).not_to be_nil
45
+ expect(recurring['Id']).not_to be_nil
46
+ expect(recurring['FreeCycles']).not_to be_nil
47
+
48
+ id = recurring['Id']
49
+
50
+ get = MangoPay::PayIn::RecurringPayments::Recurring.fetch(id)
51
+ expect(get).not_to be_nil
52
+ expect(get['FreeCycles']).not_to be_nil
43
53
 
44
54
  cit = MangoPay::PayIn::RecurringPayments::CIT.create(
45
55
  RecurringPayinRegistrationId: recurring['Id'],
@@ -61,6 +71,12 @@ describe MangoPay::PayIn::RecurringPayments, type: :feature do
61
71
  )
62
72
 
63
73
  expect(cit).not_to be_nil
74
+
75
+ update = MangoPay::PayIn::RecurringPayments::Recurring.update(id, {
76
+ Status: 'Ended'
77
+ })
78
+
79
+ expect(update).not_to be_nil
64
80
  end
65
81
  end
66
82
  end
@@ -33,6 +33,20 @@ describe MangoPay::User do
33
33
  })
34
34
  expect(updated_user['LegalRepresentativeFirstName']).to eq('Jack')
35
35
  end
36
+
37
+ it 'updates a natural user terms and conditions accepted' do
38
+ updated_user = MangoPay::NaturalUser.update(new_natural_user['Id'] ,{
39
+ TermsAndConditionsAccepted: true
40
+ })
41
+ expect(updated_user['TermsAndConditionsAccepted']).to eq(true)
42
+ end
43
+
44
+ it 'updates a legal user terms and conditions accepted' do
45
+ updated_user = MangoPay::LegalUser.update(new_legal_user['Id'], {
46
+ TermsAndConditionsAccepted: true
47
+ })
48
+ expect(updated_user['TermsAndConditionsAccepted']).to eq(true)
49
+ end
36
50
  end
37
51
 
38
52
  describe 'FETCH' do
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.7.0
4
+ version: 3.10.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-10-11 00:00:00.000000000 Z
12
+ date: 2022-06-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json