Sha256: 70b1f2284d8a2e2ea63e1102b4b877bda3ece49ff69e1c41a0a6f0691540127e

Contents?: true

Size: 874 Bytes

Versions: 7

Compression:

Stored size: 874 Bytes

Contents

module SolidusBraintree
  module GatewayHelpers
    def new_gateway(opts = {})
      SolidusBraintree::Gateway.new({
        name: "Braintree",
        preferences: {
          environment: 'sandbox',
          public_key: ENV.fetch('BRAINTREE_PUBLIC_KEY', 'dummy_public_key'),
          private_key: ENV.fetch('BRAINTREE_PRIVATE_KEY', 'dummy_private_key'),
          merchant_id: ENV.fetch('BRAINTREE_MERCHANT_ID', 'dummy_merchant_id'),
          merchant_currency_map: {
            'EUR' => 'stembolt_EUR'
          },
          paypal_payee_email_map: {
            'EUR' => ENV.fetch('BRAINTREE_PAYPAL_PAYEE_EMAIL', 'paypal+europe@example.com')
          }
        }
      }.merge(opts))
    end

    def create_gateway(opts = {})
      new_gateway(opts).tap(&:save!)
    end
  end
end

RSpec.configure do |config|
  config.include SolidusBraintree::GatewayHelpers
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
solidus_braintree-3.3.0 spec/support/solidus_braintree/gateway_helpers.rb
solidus_braintree-3.2.0 spec/support/solidus_braintree/gateway_helpers.rb
solidus_braintree-3.1.0 spec/support/solidus_braintree/gateway_helpers.rb
solidus_braintree-3.0.1 spec/support/solidus_braintree/gateway_helpers.rb
solidus_braintree-3.0.0 spec/support/solidus_braintree/gateway_helpers.rb
solidus_paypal_braintree-2.0.0 spec/support/gateway_helpers.rb
solidus_braintree-2.0.0 spec/support/gateway_helpers.rb