remove subscribe index
This commit is contained in:
parent
57fb508514
commit
4b334a69b5
|
@ -1,24 +1 @@
|
|||
import { ajax } from "discourse/lib/ajax";
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
actions: {
|
||||
stripePaymentHandler(data) {
|
||||
return ajax("/s/patrons", {
|
||||
data,
|
||||
method: "post"
|
||||
}).catch(() => {
|
||||
return { error: "An error occured while submitting the form." };
|
||||
});
|
||||
},
|
||||
|
||||
paymentSuccessHandler(/* paymentIntentId */) {
|
||||
bootbox.alert(
|
||||
I18n.t("discourse_subscriptions.transactions.payment.success")
|
||||
);
|
||||
this.transitionToRoute(
|
||||
"user.billing",
|
||||
Discourse.User.current().username.toLowerCase()
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
export default Ember.Controller.extend({});
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default Route.extend({
|
||||
queryParams: {
|
||||
order: {
|
||||
refreshModel: true
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import AdminPlan from "discourse/plugins/discourse-subscriptions/discourse/models/admin-plan";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return AdminPlan.findAll();
|
||||
}
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
export default Discourse.Route.extend({});
|
||||
import Route from "@ember/routing/route";
|
||||
|
||||
export default Route.extend({});
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import AdminProduct from "discourse/plugins/discourse-subscriptions/discourse/models/admin-product";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return AdminProduct.findAll();
|
||||
},
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import AdminPlan from "discourse/plugins/discourse-subscriptions/discourse/models/admin-plan";
|
||||
import Group from "discourse/models/group";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default Route.extend({
|
||||
model(params) {
|
||||
const id = params["plan-id"];
|
||||
const product = this.modelFor(
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import AdminProduct from "discourse/plugins/discourse-subscriptions/discourse/models/admin-product";
|
||||
import AdminPlan from "discourse/plugins/discourse-subscriptions/discourse/models/admin-plan";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default Route.extend({
|
||||
model(params) {
|
||||
const product_id = params["product-id"];
|
||||
let product;
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
export default Discourse.Route.extend({});
|
||||
import Route from "@ember/routing/route";
|
||||
|
||||
export default Route.extend({});
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import AdminSubscription from "discourse/plugins/discourse-subscriptions/discourse/models/admin-subscription";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return AdminSubscription.find();
|
||||
},
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
export default Discourse.Route.extend({});
|
||||
import Route from "@ember/routing/route";
|
||||
|
||||
export default Route.extend({});
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import Product from "discourse/plugins/discourse-subscriptions/discourse/models/product";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return Product.findAll();
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import Product from "discourse/plugins/discourse-subscriptions/discourse/models/product";
|
||||
import Plan from "discourse/plugins/discourse-subscriptions/discourse/models/plan";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default Route.extend({
|
||||
model(params) {
|
||||
const product_id = params["subscription-id"];
|
||||
|
|
@ -1,22 +1,3 @@
|
|||
import { ajax } from "discourse/lib/ajax";
|
||||
import Route from "@ember/routing/route";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
model() {
|
||||
const user = Ember.Object.create({
|
||||
name: "",
|
||||
email: "",
|
||||
phone: ""
|
||||
});
|
||||
|
||||
return ajax("/s", {
|
||||
method: "get"
|
||||
})
|
||||
.then(result => {
|
||||
user.set("email", result.email);
|
||||
return user;
|
||||
})
|
||||
.catch(() => {
|
||||
return user;
|
||||
});
|
||||
}
|
||||
});
|
||||
export default Route.extend();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import Invoice from "discourse/plugins/discourse-subscriptions/discourse/models/invoice";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return Invoice.findAll();
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Route from "@ember/routing/route";
|
||||
import UserSubscription from "discourse/plugins/discourse-subscriptions/discourse/models/user-subscription";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return UserSubscription.findAll();
|
||||
},
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
export default function() {
|
||||
this.route("s", function() {
|
||||
this.route("subscribe", function() {
|
||||
this.route("show", { path: "/:subscription-id" });
|
||||
});
|
||||
this.route("show", { path: "/:subscription-id" });
|
||||
});
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
{{#if currentUser}}
|
||||
<div class="pull-right">
|
||||
{{#link-to "s.subscribe.show" product.id disabled=product.subscribed class="btn btn-primary"}}
|
||||
{{#link-to "s.show" product.id disabled=product.subscribed class="btn btn-primary"}}
|
||||
{{i18n 'discourse_subscriptions.subscribe.title'}}
|
||||
{{/link-to}}
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{#if (show-extra-nav)}}
|
||||
{{#link-to 's.subscribe' class='discourse-patrons-subscribe'}}
|
||||
{{#link-to 's' class='discourse-patrons-subscribe'}}
|
||||
{{i18n 'discourse_subscriptions.navigation.subscribe'}}
|
||||
{{/link-to}}
|
||||
{{/if}}
|
||||
|
|
|
@ -1,14 +1,4 @@
|
|||
|
||||
<h3>{{i18n 'discourse_subscriptions.one_time.heading.payment' site_name=siteSettings.title}}</h3>
|
||||
|
||||
<p>
|
||||
{{cook-text siteSettings.discourse_subscriptions_payment_page}}
|
||||
</p>
|
||||
|
||||
<div class="donations-page-payment">
|
||||
{{donation-form
|
||||
billing=model
|
||||
paymentSuccessHandler=(action "paymentSuccessHandler")
|
||||
stripePaymentHandler=(action "stripePaymentHandler")
|
||||
}}
|
||||
<div id="product-list">
|
||||
{{product-list products=model}}
|
||||
</div>
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
|
||||
<div id="product-list">
|
||||
{{product-list products=model}}
|
||||
</div>
|
|
@ -7,7 +7,12 @@ module DiscourseSubscriptions
|
|||
context "not authenticated" do
|
||||
it "does not create a payment intent" do
|
||||
::Stripe::PaymentIntent.expects(:create).never
|
||||
post "/s/payments.json", params: { }
|
||||
|
||||
post "/s/payments.json", params: {
|
||||
payment_method: 'pm_123',
|
||||
amount: 999,
|
||||
currency: 'gdp'
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue