Sha256: 0af824ba45ff56c2382ff25329810dbe0345fdd9d0dd16dd4ad3ce94e45d5c9f

Contents?: true

Size: 513 Bytes

Versions: 5

Compression:

Stored size: 513 Bytes

Contents

# frozen_string_literal: true

require 'active_merchant/network_connection_retries'

module SolidusBraintree
  module RequestProtection
    include ActiveMerchant::NetworkConnectionRetries

    def protected_request(&block)
      raise ArgumentError unless block_given?

      options = {
        connection_exceptions: {
          Braintree::BraintreeError => 'Error while connecting to Braintree gateway'
        },
        logger: Rails.logger
      }
      retry_exceptions(options, &block)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_braintree-3.2.0 lib/solidus_braintree/request_protection.rb
solidus_braintree-3.1.0 lib/solidus_braintree/request_protection.rb
solidus_braintree-3.0.1 lib/solidus_braintree/request_protection.rb
solidus_braintree-3.0.0 lib/solidus_braintree/request_protection.rb
solidus_braintree-2.0.0 lib/solidus_braintree/request_protection.rb