Sha256: 3ea06d317a58de3bfd887542f00353c3e5c05d7a902899ee89a80e0839ead1b3

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

solidus_bolt_configuration = SolidusBolt::BoltConfiguration.fetch

solidus_bolt_configuration.environment = ENV.fetch('BOLT_ENVIRONMENT', 'sandbox')
solidus_bolt_configuration.merchant_public_id = ENV['BOLT_MERCHANT_PUBLIC_ID']
solidus_bolt_configuration.division_public_id = ENV['BOLT_DIVISION_PUBLIC_ID']
solidus_bolt_configuration.api_key = ENV['BOLT_API_KEY']
solidus_bolt_configuration.signing_secret = ENV['BOLT_SIGNING_SECRET']
solidus_bolt_configuration.publishable_key = ENV['BOLT_PUBLISHABLE_KEY']

solidus_bolt_configuration.save

Spree::AuthenticationMethod.find_or_create_by(provider: :bolt) do |authentication_method|
  authentication_method.environment = "development"
  authentication_method.provider = "bolt"
  authentication_method.api_key = SolidusBolt::BoltConfiguration.fetch.publishable_key
  authentication_method.api_secret = SolidusBolt::BoltConfiguration.fetch.api_key
  authentication_method.active = true
end

if ENV['BOLT_API_KEY'] && ENV['BOLT_SIGNING_SECRET'] && ENV['BOLT_PUBLISHABLE_KEY']
  SolidusBolt::PaymentMethod.create!(
    type: 'SolidusBolt::PaymentMethod',
    name: 'Bolt',
    preference_source: 'bolt_credentials',
    active: true
  )
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_bolt-0.2.0 db/seeds.rb