Add empty webhook url and upgrade stripe gem
This commit is contained in:
parent
7f4fb2a503
commit
431279a4f7
|
@ -52,6 +52,12 @@ In the admin, add a new Product. Once you have a product saved, you can add plan
|
|||
|
||||
If you take a look at your [Stripe Dashboard](https://dashboard.stripe.com), you'll see all those products and plans are listed. Discourse Subscriptions does not create them locally. They are created in Stripe.
|
||||
|
||||
## Enable Webhooks
|
||||
|
||||
You'll need to tell Stripe where your end points are. You can enter this in your Stripe dashboard.
|
||||
|
||||
The address for webhooks is: `/s/hooks`
|
||||
|
||||
## Testing
|
||||
|
||||
Test with these credit card numbers:
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiscourseSubscriptions
|
||||
class HooksController < ::ApplicationController
|
||||
def create
|
||||
head 200
|
||||
end
|
||||
end
|
||||
end
|
|
@ -18,6 +18,7 @@ DiscourseSubscriptions::Engine.routes.draw do
|
|||
end
|
||||
|
||||
resources :customers, only: [:create]
|
||||
resources :hooks, only: [:create]
|
||||
resources :invoices, only: [:index]
|
||||
resources :payments, only: [:create]
|
||||
resources :plans, only: [:index]
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# name: discourse-subscriptions
|
||||
# about: Integrates Stripe into Discourse to allow visitors to subscribe
|
||||
# version: 2.7.0
|
||||
# version: 2.7.1
|
||||
# url: https://github.com/rimian/discourse-subscriptions
|
||||
# authors: Rimian Perkins
|
||||
|
||||
|
@ -44,7 +44,7 @@ after_initialize do
|
|||
|
||||
::Stripe.set_app_info(
|
||||
'Discourse Subscriptions',
|
||||
version: '2.7.0',
|
||||
version: '2.7.1',
|
||||
url: 'https://github.com/rimian/discourse-subscriptions'
|
||||
)
|
||||
|
||||
|
@ -60,6 +60,7 @@ after_initialize do
|
|||
"../app/controllers/user/payments_controller",
|
||||
"../app/controllers/user/subscriptions_controller",
|
||||
"../app/controllers/customers_controller",
|
||||
"../app/controllers/hooks_controller",
|
||||
"../app/controllers/invoices_controller",
|
||||
"../app/controllers/plans_controller",
|
||||
"../app/controllers/payments_controller",
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
module DiscourseSubscriptions
|
||||
RSpec.describe HooksController do
|
||||
it "responds ok" do
|
||||
post "/s/hooks.json"
|
||||
expect(response.status).to eq 200
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue