mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-10 23:07:47 +00:00
Adds condition to set Stripe.api key
Updates spec accordingly
This commit is contained in:
@@ -12,6 +12,7 @@ end
|
||||
|
||||
Rails.application.reloader.to_prepare do
|
||||
Stripe.api_key = ENV['STRIPE_INSTANCE_SECRET_KEY']
|
||||
Stripe.api_key = ENV['STRIPE_SECRET_TEST_API_KEY'] if Rails.env.test? || ENV["CI"]
|
||||
Stripe.publishable_key = ENV['STRIPE_INSTANCE_PUBLISHABLE_KEY']
|
||||
Stripe.client_id = ENV['STRIPE_CLIENT_ID']
|
||||
Stripe.endpoint_secret = ENV['STRIPE_ENDPOINT_SECRET']
|
||||
|
||||
@@ -4,16 +4,12 @@ require 'spec_helper'
|
||||
require 'stripe/credit_card_remover'
|
||||
|
||||
describe Stripe::CreditCardRemover do
|
||||
let!(:secret) { ENV.fetch('STRIPE_SECRET_TEST_API_KEY', nil) }
|
||||
|
||||
let(:credit_card) { create(:credit_card, gateway_payment_profile_id: pm_card.id, user:) }
|
||||
|
||||
let!(:user) { create(:user, email: "apple.customer@example.com") }
|
||||
let!(:enterprise) { create(:enterprise) }
|
||||
|
||||
describe "#remove", :vcr, :stripe_version do
|
||||
before { Stripe.api_key = secret }
|
||||
|
||||
let(:stripe_account_id) { ENV.fetch('STRIPE_ACCOUNT', nil) }
|
||||
|
||||
let(:stripe_account) {
|
||||
|
||||
Reference in New Issue
Block a user