use the billing page

This commit is contained in:
Rimian Perkins 2019-10-25 13:55:57 +11:00
parent 948399662d
commit 570ef2fbb4
6 changed files with 1 additions and 52 deletions

View File

@ -17,18 +17,6 @@ module DiscoursePatrons
render json: result
end
def show
payment_intent = ::Stripe::PaymentIntent.retrieve(params[:pid])
if current_user && (current_user.admin || payment_intent[:customer] == current_user.id)
result = payment_intent
else
result = { error: 'Not found' }
end
render json: result
end
def create
begin

View File

@ -1,9 +0,0 @@
import DiscourseURL from "discourse/lib/url";
export default Ember.Controller.extend({
actions: {
goBack() {
return DiscourseURL.redirectTo("/patrons");
}
}
});

View File

@ -1,8 +1,5 @@
export default function() {
this.route("patrons", function() {
this.route("subscribe", function() {
this.route("product", { path: ":product_id" })
});
this.route("show", { path: ":pid" });
this.route("subscribe");
});
}

View File

@ -1,7 +0,0 @@
import { ajax } from "discourse/lib/ajax";
export default Discourse.Route.extend({
model(params) {
return ajax(`/patrons/${params.pid}`, { method: "get" });
}
});

View File

@ -1,19 +0,0 @@
{{#unless model.error}}
<h3>{{i18n 'discourse_patrons.heading.success' site_name=siteSettings.title}}</h3>
<p>
{{cook-text siteSettings.discourse_patrons_success_page}}
</p>
<table>
<tr>
<td>{{i18n 'discourse_patrons.payment_intent_id'}}</td>
<td>{{model.id}}</td>
</tr>
<tr>
<td>{{i18n 'discourse_patrons.amount'}}</td>
<td>{{model.amount}}</td>
</tr>
</table>
{{/unless}}

View File

@ -19,5 +19,4 @@ DiscoursePatrons::Engine.routes.draw do
resources :patrons, only: [:index, :create]
get '/' => 'patrons#index'
get '/:pid' => 'patrons#show'
end