use the billing page
This commit is contained in:
parent
948399662d
commit
570ef2fbb4
|
@ -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
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
import DiscourseURL from "discourse/lib/url";
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
actions: {
|
||||
goBack() {
|
||||
return DiscourseURL.redirectTo("/patrons");
|
||||
}
|
||||
}
|
||||
});
|
|
@ -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");
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
import { ajax } from "discourse/lib/ajax";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
model(params) {
|
||||
return ajax(`/patrons/${params.pid}`, { method: "get" });
|
||||
}
|
||||
});
|
|
@ -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}}
|
|
@ -19,5 +19,4 @@ DiscoursePatrons::Engine.routes.draw do
|
|||
resources :patrons, only: [:index, :create]
|
||||
|
||||
get '/' => 'patrons#index'
|
||||
get '/:pid' => 'patrons#show'
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue