Sha256: be12331757745d73c77d95871ce6f3c0074054ed641cbc5811f89b13fa410e7b

Contents?: true

Size: 892 Bytes

Versions: 3

Compression:

Stored size: 892 Bytes

Contents

module SolidusPaypalBraintree
  module GatewayHelpers
    def new_gateway(opts = {})
      SolidusPaypalBraintree::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 SolidusPaypalBraintree::GatewayHelpers
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
solidus_paypal_braintree-1.2.0 spec/support/gateway_helpers.rb
solidus_paypal_braintree-1.1.0 spec/support/gateway_helpers.rb
solidus_paypal_braintree-1.0.0 spec/support/gateway_helpers.rb