mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-02 02:11:33 +00:00
Removes unnecessary Stripe api key / secret declaration
This commit is contained in:
@@ -5,10 +5,8 @@ require 'spec_helper'
|
||||
describe Spree::CreditCardsController, type: :controller do
|
||||
describe "using VCR", :vcr, :stripe_version do
|
||||
let(:user) { create(:user) }
|
||||
let(:secret) { ENV.fetch('STRIPE_SECRET_TEST_API_KEY', nil) }
|
||||
|
||||
before do
|
||||
Stripe.api_key = secret
|
||||
allow(controller).to receive(:spree_current_user) { user }
|
||||
end
|
||||
|
||||
|
||||
@@ -8,11 +8,7 @@ module Stripe
|
||||
let!(:user) { create(:user, email: "apple.customer@example.com") }
|
||||
let!(:enterprise) { create(:enterprise) }
|
||||
|
||||
let(:secret) { ENV.fetch('STRIPE_SECRET_TEST_API_KEY', nil) }
|
||||
|
||||
describe "#find_or_clone", :vcr, :stripe_version do
|
||||
before { Stripe.api_key = secret }
|
||||
|
||||
let(:customer) do
|
||||
Stripe::Customer.create({
|
||||
name: 'Apple Customer',
|
||||
|
||||
@@ -4,7 +4,6 @@ require 'spec_helper'
|
||||
require 'stripe/payment_intent_validator'
|
||||
|
||||
describe Stripe::PaymentIntentValidator do
|
||||
let(:secret) { ENV.fetch('STRIPE_SECRET_TEST_API_KEY', nil) }
|
||||
|
||||
let(:payment_method) {
|
||||
create(:stripe_sca_payment_method, distributor_ids: [create(:distributor_enterprise).id],
|
||||
@@ -13,10 +12,6 @@ describe Stripe::PaymentIntentValidator do
|
||||
|
||||
let(:year_valid) { Time.zone.now.year.next }
|
||||
|
||||
before {
|
||||
Stripe.api_key = secret
|
||||
}
|
||||
|
||||
describe "#call", :vcr, :stripe_version do
|
||||
let(:payment) {
|
||||
create(:payment, amount: payment_intent.amount, payment_method:,
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Spree::Gateway::StripeSCA, type: :model do
|
||||
let(:secret) { ENV.fetch('STRIPE_SECRET_TEST_API_KEY', nil) }
|
||||
|
||||
let(:order) { create(:order_ready_for_payment) }
|
||||
|
||||
@@ -26,8 +25,6 @@ describe Spree::Gateway::StripeSCA, type: :model do
|
||||
{ order_id: order.number }
|
||||
}
|
||||
|
||||
before { Stripe.api_key = secret }
|
||||
|
||||
let(:pm_card) do
|
||||
Stripe::PaymentMethod.create({
|
||||
type: 'card',
|
||||
|
||||
@@ -10,16 +10,11 @@ describe StripeAccount do
|
||||
let(:client_id) { ENV.fetch('STRIPE_CLIENT_ID', nil) }
|
||||
let(:stripe_user_id) { ENV.fetch('STRIPE_ACCOUNT', nil) }
|
||||
let(:stripe_publishable_key) { ENV.fetch('STRIPE_PUBLIC_TEST_API_KEY', nil) }
|
||||
let(:secret) { ENV.fetch('STRIPE_SECRET_TEST_API_KEY', nil) }
|
||||
|
||||
let!(:stripe_account) {
|
||||
create(:stripe_account, enterprise:, stripe_user_id:)
|
||||
}
|
||||
|
||||
before do
|
||||
Stripe.api_key = secret
|
||||
end
|
||||
|
||||
context "when the Stripe API disconnect fails" do
|
||||
before { Stripe.client_id = "bogus_client_id" }
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ require 'spec_helper'
|
||||
describe StripePaymentStatus, :vcr, :stripe_version do
|
||||
subject { StripePaymentStatus.new(payment) }
|
||||
|
||||
let(:secret) { ENV.fetch('STRIPE_SECRET_TEST_API_KEY', nil) }
|
||||
|
||||
let(:credit_card) { create(:credit_card, gateway_payment_profile_id: pm_card.id) }
|
||||
|
||||
let(:payment_method) {
|
||||
@@ -14,8 +12,6 @@ describe StripePaymentStatus, :vcr, :stripe_version do
|
||||
preferred_enterprise_id: create(:enterprise).id)
|
||||
}
|
||||
|
||||
before { Stripe.api_key = secret }
|
||||
|
||||
let(:pm_card) do
|
||||
Stripe::PaymentMethod.create({
|
||||
type: 'card',
|
||||
@@ -46,10 +42,6 @@ describe StripePaymentStatus, :vcr, :stripe_version do
|
||||
)
|
||||
}
|
||||
|
||||
before {
|
||||
Stripe.api_key = secret
|
||||
}
|
||||
|
||||
describe '#stripe_status' do
|
||||
context "when the payment is not a Stripe payment or does not have a payment intent" do
|
||||
before { payment.update!(response_code: nil) }
|
||||
|
||||
Reference in New Issue
Block a user