Module: SolidusBraintree::RequestProtection

Includes:
ActiveMerchant::NetworkConnectionRetries
Included in:
Gateway, Source
Defined in:
lib/solidus_braintree/request_protection.rb

Instance Method Summary collapse

Instance Method Details

#protected_request(&block) ⇒ Object

Raises:

  • (ArgumentError)


9
10
11
12
13
14
15
16
17
18
19
# File 'lib/solidus_braintree/request_protection.rb', line 9

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