mangopay 3.41.0 → 3.42.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 +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/mangopay/client.rb +2 -0
- data/lib/mangopay/user.rb +6 -2
- data/lib/mangopay/version.rb +1 -1
- data/lib/mangopay.rb +10 -2
- data/spec/mangopay/user_spec.rb +12 -0
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 75e70fb3e6f0127887de7a15963f3d6da46eba5ae5e442e020cb68464540f3d9
         | 
| 4 | 
            +
              data.tar.gz: 2925a4605e33e3c0325522cdd3657db592b87675172ceabeb749f321ce1af2e9
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: '016839ec01d68ffeeff441b0f144758b911febc7ad559808f65ef57baab454f21798cc9c52ff664b4fdcb6ed3bc54fea8d3b38e3c3e2801767d9fd793eb1f915'
         | 
| 7 | 
            +
              data.tar.gz: 055ae925c27dc1aed17a0f41fa2585854f156b1b206d3661d990a8bf91dbfc83ca63199f3992e83604883466bb23c972547d3364fc1d1cb78a795efdeeceb076
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,3 +1,14 @@ | |
| 1 | 
            +
            ## [3.42.0] - 2025-10-27
         | 
| 2 | 
            +
            ### Added
         | 
| 3 | 
            +
            - New [POST Manage proxy consent for a User](https://docs.mangopay.com/api-reference/users/manage-proxy-consent) endpoint to obtain and manage user consent via the hosted SCA experience (if proxy is activated). A proxy and user consent are now required to use the `USER_NOT_PRESENT` value for `ScaContext` ([API release note](https://docs.mangopay.com/release-notes/api/2025-10-23), #310)
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            ### Changed
         | 
| 6 | 
            +
            - `x-tenant-id` deprecated as no longer necessary for UK platforms; the parameter is ignored by Mangopay (#309 )
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            ## [3.41.1] - 2025-10-10
         | 
| 9 | 
            +
            ### Added
         | 
| 10 | 
            +
            - Configuration for `after_request_proc` to be able to check rate limits post-request (#301 - thank you @matteeyah and @robertfall for the contribution 🙏)
         | 
| 11 | 
            +
             | 
| 1 12 | 
             
            ## [3.41.0] - 2025-10-01
         | 
| 2 13 | 
             
            ### Added
         | 
| 3 14 | 
             
            - Support for the [POST Cancel an Intent](https://docs.mangopay.com/api-reference/intents/cancel-intent) endpoint for [Echo](https://docs.mangopay.com/guides/echo), Mangopay's solution for platforms working with another third-party PSP for funds acquisition (#435)
         | 
    
        data/lib/mangopay/client.rb
    CHANGED
    
    | @@ -83,6 +83,8 @@ module MangoPay | |
| 83 83 | 
             
                    MangoPay.request(method, path, params)
         | 
| 84 84 | 
             
                  end
         | 
| 85 85 |  | 
| 86 | 
            +
                  # Create a Bank Wire PayIn to the Repudiation Wallet
         | 
| 87 | 
            +
                  # see https://docs.mangopay.com/api-reference/dispute-settlement/create-bank-wire-payin-to-repudiation-wallet
         | 
| 86 88 | 
             
                  def create_bank_wire_direct_pay_in(params, idempotency_key = nil)
         | 
| 87 89 | 
             
                    MangoPay.request(:post, url() + "/payins/bankwire/direct", params, {}, idempotency_key)
         | 
| 88 90 | 
             
                  end
         | 
    
        data/lib/mangopay/user.rb
    CHANGED
    
    | @@ -11,11 +11,15 @@ module MangoPay | |
| 11 11 | 
             
                include HTTPCalls::Update
         | 
| 12 12 | 
             
                include HTTPCalls::Fetch
         | 
| 13 13 | 
             
                class << self
         | 
| 14 | 
            -
                  def enroll_sca(user_id)
         | 
| 14 | 
            +
                  def enroll_sca(user_id, idempotency_key = nil)
         | 
| 15 15 | 
             
                    url = "#{MangoPay.api_path}/sca/users/#{user_id}/enrollment"
         | 
| 16 | 
            -
                    MangoPay.request(:post, url, {}, {})
         | 
| 16 | 
            +
                    MangoPay.request(:post, url, {}, {}, idempotency_key)
         | 
| 17 17 | 
             
                  end
         | 
| 18 18 |  | 
| 19 | 
            +
                  def manage_consent(user_id, idempotency_key = nil)
         | 
| 20 | 
            +
                    url = "#{MangoPay.api_path}/sca/users/#{user_id}/consent"
         | 
| 21 | 
            +
                    MangoPay.request(:post, url, {}, {}, idempotency_key)
         | 
| 22 | 
            +
                  end
         | 
| 19 23 |  | 
| 20 24 | 
             
                  # Fetches list of wallets belonging to the given +user_id+.
         | 
| 21 25 | 
             
                  # Optional +filters+ is a hash accepting following keys:
         | 
    
        data/lib/mangopay/version.rb
    CHANGED
    
    
    
        data/lib/mangopay.rb
    CHANGED
    
    | @@ -65,7 +65,8 @@ module MangoPay | |
| 65 65 | 
             
                              :client_id, :client_apiKey,
         | 
| 66 66 | 
             
                              :temp_dir, :log_file, :log_trace_headers, :http_timeout,
         | 
| 67 67 | 
             
                              :http_max_retries, :http_open_timeout,
         | 
| 68 | 
            -
                              :logger, :use_ssl, :uk_header_flag
         | 
| 68 | 
            +
                              :logger, :use_ssl, :uk_header_flag,
         | 
| 69 | 
            +
                              :after_request_proc
         | 
| 69 70 |  | 
| 70 71 | 
             
                def apply_configuration
         | 
| 71 72 | 
             
                  MangoPay.configure do |config|
         | 
| @@ -80,6 +81,7 @@ module MangoPay | |
| 80 81 | 
             
                    config.use_ssl = @use_ssl
         | 
| 81 82 | 
             
                    config.logger = @logger
         | 
| 82 83 | 
             
                    config.uk_header_flag = @uk_header_flag
         | 
| 84 | 
            +
                    config.after_request_proc = @after_request_proc
         | 
| 83 85 | 
             
                  end
         | 
| 84 86 | 
             
                end
         | 
| 85 87 |  | 
| @@ -110,12 +112,14 @@ module MangoPay | |
| 110 112 |  | 
| 111 113 | 
             
                  true
         | 
| 112 114 | 
             
                end
         | 
| 113 | 
            -
             | 
| 115 | 
            +
             | 
| 114 116 | 
             
                def log_trace_headers
         | 
| 115 117 | 
             
                  @log_trace_headers || false
         | 
| 116 118 | 
             
                end
         | 
| 117 119 |  | 
| 118 120 | 
             
                def uk_header_flag
         | 
| 121 | 
            +
                  warn "[DEPRECATION] `uk_header_flag` is deprecated and will be removed in a future version. " \
         | 
| 122 | 
            +
                         "Please update your configuration accordingly."
         | 
| 119 123 | 
             
                  @uk_header_flag || false
         | 
| 120 124 | 
             
                end
         | 
| 121 125 | 
             
              end
         | 
| @@ -266,6 +270,8 @@ module MangoPay | |
| 266 270 | 
             
                    }
         | 
| 267 271 | 
             
                  end
         | 
| 268 272 |  | 
| 273 | 
            +
                  configuration.after_request_proc&.call(data)
         | 
| 274 | 
            +
             | 
| 269 275 | 
             
                  data
         | 
| 270 276 | 
             
                end
         | 
| 271 277 |  | 
| @@ -328,6 +334,8 @@ module MangoPay | |
| 328 334 | 
             
                    }
         | 
| 329 335 | 
             
                  end
         | 
| 330 336 |  | 
| 337 | 
            +
                  configuration.after_request_proc&.call(data)
         | 
| 338 | 
            +
             | 
| 331 339 | 
             
                  data
         | 
| 332 340 | 
             
                end
         | 
| 333 341 |  | 
    
        data/spec/mangopay/user_spec.rb
    CHANGED
    
    | @@ -161,6 +161,18 @@ describe MangoPay::User do | |
| 161 161 | 
             
                end
         | 
| 162 162 | 
             
              end
         | 
| 163 163 |  | 
| 164 | 
            +
              describe 'MANAGE CONSENT' do
         | 
| 165 | 
            +
                it 'manages consent' do
         | 
| 166 | 
            +
                  user = new_natural_user
         | 
| 167 | 
            +
             | 
| 168 | 
            +
                  enrollment_result = MangoPay::User.enroll_sca(user['Id'])
         | 
| 169 | 
            +
                  expect(enrollment_result["PendingUserAction"]["RedirectUrl"]).not_to be_nil
         | 
| 170 | 
            +
             | 
| 171 | 
            +
                  consent_result = MangoPay::User.manage_consent(user['Id'])
         | 
| 172 | 
            +
                  expect(consent_result["PendingUserAction"]["RedirectUrl"]).not_to be_nil
         | 
| 173 | 
            +
                end
         | 
| 174 | 
            +
              end
         | 
| 175 | 
            +
             | 
| 164 176 | 
             
              describe 'FETCH' do
         | 
| 165 177 | 
             
                it 'fetches all the users' do
         | 
| 166 178 | 
             
                  users = MangoPay::User.fetch()
         | 
    
        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.42.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-10- | 
| 12 | 
            +
            date: 2025-10-27 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: multi_json
         |