diff --git a/app/controllers/patrons_controller.rb b/app/controllers/patrons_controller.rb index d6db769..0d38440 100644 --- a/app/controllers/patrons_controller.rb +++ b/app/controllers/patrons_controller.rb @@ -31,15 +31,6 @@ module DiscoursePatrons metadata: { user_id: user_id } ) - # Payment.create( - # user_id: response[:metadata][:user_id], - # payment_intent_id: response[:id], - # receipt_email: response[:receipt_email], - # url: response[:charges][:url], - # amount: response[:amount], - # currency: response[:currency] - # ) - rescue ::Stripe::InvalidRequestError => e response = { error: e } rescue ::Stripe::CardError => e diff --git a/app/models/payment.rb b/app/models/payment.rb deleted file mode 100644 index d0e90dd..0000000 --- a/app/models/payment.rb +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true - -class Payment < ActiveRecord::Base -end diff --git a/db/migrate/20190913010928_create_payments_table.rb b/db/migrate/20190913010928_create_payments_table.rb deleted file mode 100644 index bcc5a52..0000000 --- a/db/migrate/20190913010928_create_payments_table.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CreatePaymentsTable < ActiveRecord::Migration[5.2] - def change - create_table :payments do |t| - t.string :payment_intent_id, null: false - t.string :receipt_email, null: false - t.string :currency, null: false - t.string :url, null: false - t.integer :amount, null: false - t.references :user, foreign_key: true - t.timestamps - end - - add_index :payments, :payment_intent_id, unique: true - end -end diff --git a/spec/controllers/discourse_patrons/patrons_controller_spec.rb b/spec/controllers/discourse_patrons/patrons_controller_spec.rb index 88e0173..a1e734c 100644 --- a/spec/controllers/discourse_patrons/patrons_controller_spec.rb +++ b/spec/controllers/discourse_patrons/patrons_controller_spec.rb @@ -53,14 +53,6 @@ module DiscoursePatrons expect(response).to have_http_status(200) end - xit 'creates a payment' do - ::Stripe::PaymentIntent.expects(:create).returns(payment) - - expect { - post :create, params: { receipt_email: 'hello@example.com', amount: '20.00' }, format: :json - }.to change { Payment.count } - end - it 'has no user' do controller.stubs(:current_user).returns(nil) ::Stripe::PaymentIntent.expects(:create).returns(payment)