mangopay 3.34.0 → 3.35.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: 9a183b9490a45fa73745d864f9643d9afec4e4ea56b002784e2b888ae7886b7b
4
- data.tar.gz: 4079521fab8f807345c218e00510e5197d4cb05d8afc4cbd4a332e5231650100
3
+ metadata.gz: e11195066c9596106c5615e858bf1af13f20e4d6f6efa51675158e7d49a8348b
4
+ data.tar.gz: d789d50dfdb1cb320cc0b4dc0d3b8b7ef12aac1627da49b77abadaa502b855c4
5
5
  SHA512:
6
- metadata.gz: 1bb4ea160e1a0f9c93032320a1be553b669b7cc1f07c2b27d822ff7cc22e6015237666bc284f7304ad9d2302cfa9c963db75b81dfcae39645468efb717735c25
7
- data.tar.gz: 2ee8715ac0e1bc4a96f8773f5bef406fa229a8f7d980b9813e539a4aaa4735451600f130046ae0810921e11e1ae0549d0850c1f1d7b98354228f9fe7c7f6c160
6
+ metadata.gz: 3ed3eb963aa03ae1874ecab170480f6f0cae564adc7f98007724ce8f0049be680c9f013965f835e0300fcb6d46fa2497da27aa7faf310b24ca3702de72021609
7
+ data.tar.gz: 3f3e98a623f39a930ceaa2be9b747c72d7daa987bcb69a8e2a3a1883c0ca4ab93b51a98e69d383c13fc32fb17ec9dbbfb771a55698bfd47618bb15e59010ea08
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [3.35.0] - 2025-05-23
2
+ ### Added
3
+
4
+ Support for [30-day deposit preauthorization](https://docs.mangopay.com/guides/payment-methods/card/deposit-preauthorization) features:
5
+ - [POST Create a Deposit Preauthorized PayIn prior to complement](https://docs.mangopay.com/api-reference/deposit-preauthorizations/create-deposit-preauthorized-payin-prior-to-complement)
6
+ - [POST Create a Deposit Preauthorized PayIn complement](https://docs.mangopay.com/api-reference/deposit-preauthorizations/create-deposit-preauthorized-payin-complement)
7
+ - `NO_SHOW_REQUESTED` on `updateDeposit` method for [PUT Cancel a Deposit Preauthorization or request a no-show](https://docs.mangopay.com/api-reference/deposit-preauthorizations/cancel-deposit-preauthorization-request-no-show)
8
+ - [GET View a PayIn (Deposit Preauthorized Card](https://docs.mangopay.com/api-reference/deposit-preauthorizations/view-payin-deposit-preauthorized)
9
+ - [GET List Transactions for a Deposit Preauthorization](https://docs.mangopay.com/api-reference/transactions/list-transactions-deposit-preauthorization)
10
+
1
11
  ## [3.34.0] - 2025-05-14
2
12
  ### Added and refined
3
13
 
@@ -17,6 +17,10 @@ module MangoPay
17
17
  MangoPay.request(:put, "#{MangoPay.api_path}/deposit-preauthorizations/#{deposit_id}", params)
18
18
  end
19
19
 
20
+ def self.update(deposit_id, params)
21
+ MangoPay.request(:put, "#{MangoPay.api_path}/deposit-preauthorizations/#{deposit_id}", params)
22
+ end
23
+
20
24
  def self.get_all_for_user(user_id, filters = {})
21
25
  MangoPay.request(:get, "#{MangoPay.api_path}/users/#{user_id}/deposit-preauthorizations", {}, filters)
22
26
  end
@@ -24,5 +28,9 @@ module MangoPay
24
28
  def self.get_all_for_card(card_id, filters = {})
25
29
  MangoPay.request(:get, "#{MangoPay.api_path}/cards/#{card_id}/deposit-preauthorizations", {}, filters)
26
30
  end
31
+
32
+ def self.get_transactions(deposit_id, filters = {})
33
+ MangoPay.request(:get, "#{MangoPay.api_path}/deposit-preauthorizations/#{deposit_id}/transactions", {}, filters)
34
+ end
27
35
  end
28
36
  end
@@ -62,6 +62,14 @@ module MangoPay
62
62
  def self.create_pre_authorized_deposit_pay_in(params, idempotency_key = nil)
63
63
  MangoPay.request(:post, "#{MangoPay.api_path}/payins/deposit-preauthorized/direct/full-capture", params, {}, idempotency_key)
64
64
  end
65
+
66
+ def self.create_deposit_preauthorized_pay_in_prior_to_complement(params, idempotency_key = nil)
67
+ MangoPay.request(:post, "#{MangoPay.api_path}/payins/deposit-preauthorized/direct/capture-with-complement", params, {}, idempotency_key)
68
+ end
69
+
70
+ def self.create_deposit_preauthorized_pay_in_complement(params, idempotency_key = nil)
71
+ MangoPay.request(:post, "#{MangoPay.api_path}/payins/deposit-preauthorized/direct/complement", params, {}, idempotency_key)
72
+ end
65
73
  end
66
74
 
67
75
  end
@@ -1,3 +1,3 @@
1
1
  module MangoPay
2
- VERSION = '3.34.0'
2
+ VERSION = '3.35.0'
3
3
  end
@@ -44,6 +44,18 @@ describe MangoPay::Deposit do
44
44
  expect(result).to be_kind_of(Array)
45
45
  expect(result.count).to be > 0
46
46
  end
47
+
48
+ it 'fetches transactions for a deposit' do
49
+ author = new_natural_user
50
+ wallet = new_wallet
51
+ card_registration = new_card_registration_completed
52
+ deposit = create_new_deposit(card_registration['CardId'], author['Id'])
53
+ create_new_payin_pre_authorized_deposit_direct(deposit['Id'], author['Id'], wallet['Id'])
54
+
55
+ transactions = MangoPay::Deposit.get_transactions(deposit['Id'])
56
+ expect(transactions).to be_kind_of(Array)
57
+ expect(transactions.count).to be > 0
58
+ end
47
59
  end
48
60
 
49
61
  # the Cancel flow will be teste manually for now
@@ -45,7 +45,7 @@ describe MangoPay::PayIn::PreAuthorized::Direct, type: :feature do
45
45
  it 'refunds a payin' do
46
46
  payin = new_payin_preauthorized_direct
47
47
  sleep(2)
48
- refund = MangoPay::PayIn.refund(payin['Id'], {AuthorId: payin['AuthorId']})
48
+ refund = MangoPay::PayIn.refund(payin['Id'], { AuthorId: payin['AuthorId'] })
49
49
  expect(refund['Id']).not_to be_nil
50
50
  expect(refund['Status']).to eq('SUCCEEDED')
51
51
  expect(refund['Type']).to eq('PAYOUT')
@@ -66,26 +66,52 @@ describe MangoPay::PayIn::PreAuthorized::Direct, type: :feature do
66
66
  wallets_reload_and_check_amounts(wlt, 1000)
67
67
 
68
68
  # refund the payin
69
- refund = MangoPay::PayIn.refund(payin['Id'], {AuthorId: payin['AuthorId']})
69
+ refund = MangoPay::PayIn.refund(payin['Id'], { AuthorId: payin['AuthorId'] })
70
70
  wallets_reload_and_check_amounts(wlt, 0)
71
71
  end
72
72
  end
73
73
 
74
- # this flow is tested manually for the moment
75
- =begin
76
- describe 'CREATE AND VIEW PRE AUTHORIZED DEPOSIT' do
77
- it 'creates a card direct pre authorized deposit payin' do
78
- wallet = new_wallet
79
- author = new_natural_user
80
- card_registration = new_card_registration_completed
81
- deposit = create_new_deposit(card_registration['CardId'], author['Id'])
74
+ begin
75
+ describe 'CREATE AND VIEW PRE AUTHORIZED DEPOSIT' do
76
+ it 'creates a card direct pre authorized deposit payin' do
77
+ wallet = new_wallet
78
+ author = new_natural_user
79
+ card_registration = new_card_registration_completed
80
+ deposit = create_new_deposit(card_registration['CardId'], author['Id'])
82
81
 
83
- created = create_new_payin_pre_authorized_deposit_direct(deposit['Id'], author['Id'], wallet['Id'])
82
+ created = create_new_payin_pre_authorized_deposit_direct(deposit['Id'], author['Id'], wallet['Id'])
84
83
 
85
- expect(created['Id']).not_to be_nil
86
- check_type_and_status(created)
87
- expect(created['DepositId']).to eq(deposit['Id'])
84
+ expect(created['Id']).not_to be_nil
85
+ check_type_and_status(created)
86
+ expect(created['DepositId']).to eq(deposit['Id'])
87
+ end
88
+
89
+ it 'creates a card direct pre authorized deposit payin prior to complement' do
90
+ wallet = new_wallet
91
+ author = new_natural_user
92
+ card_registration = new_card_registration_completed
93
+ deposit = create_new_deposit(card_registration['CardId'], author['Id'])
94
+
95
+ created = create_new_deposit_pre_authorized_pay_in_prior_to_complement(deposit['Id'], author['Id'], wallet['Id'])
96
+
97
+ expect(created['Id']).not_to be_nil
98
+ check_type_and_status(created)
99
+ expect(created['DepositId']).to eq(deposit['Id'])
100
+ end
101
+
102
+ it 'creates a card direct pre authorized deposit payin complement' do
103
+ wallet = new_wallet
104
+ author = new_natural_user
105
+ card_registration = new_card_registration_completed
106
+ deposit = create_new_deposit(card_registration['CardId'], author['Id'])
107
+ MangoPay::Deposit.update(deposit['Id'], {PaymentStatus: 'NO_SHOW_REQUESTED'})
108
+
109
+ created = create_new_deposit_pre_authorized_pay_in_complement(deposit['Id'], author['Id'], wallet['Id'])
110
+
111
+ expect(created['Id']).not_to be_nil
112
+ check_type_and_status(created)
113
+ expect(created['DepositId']).to eq(deposit['Id'])
114
+ end
88
115
  end
89
116
  end
90
- =end
91
117
  end
@@ -936,6 +936,28 @@ shared_context 'payins' do
936
936
  )
937
937
  end
938
938
 
939
+ def create_new_deposit_pre_authorized_pay_in_prior_to_complement(deposit_id, author_id, credited_wallet_id)
940
+ MangoPay::PayIn::PreAuthorized::Direct.create_deposit_preauthorized_pay_in_prior_to_complement(
941
+ AuthorId: author_id,
942
+ CreditedWalletId: credited_wallet_id,
943
+ DebitedFunds: { Currency: 'EUR', Amount: 1000 },
944
+ Fees: { Currency: 'EUR', Amount: 0 },
945
+ DepositId: deposit_id,
946
+ Tag: 'lorem ipsum'
947
+ )
948
+ end
949
+
950
+ def create_new_deposit_pre_authorized_pay_in_complement(deposit_id, author_id, credited_wallet_id)
951
+ MangoPay::PayIn::PreAuthorized::Direct.create_deposit_preauthorized_pay_in_complement(
952
+ AuthorId: author_id,
953
+ CreditedWalletId: credited_wallet_id,
954
+ DebitedFunds: { Currency: 'EUR', Amount: 1000 },
955
+ Fees: { Currency: 'EUR', Amount: 0 },
956
+ DepositId: deposit_id,
957
+ Tag: 'lorem ipsum'
958
+ )
959
+ end
960
+
939
961
  ###############################################
940
962
  # bankwire/direct
941
963
  ###############################################
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.34.0
4
+ version: 3.35.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: 2025-05-14 00:00:00.000000000 Z
12
+ date: 2025-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json