update routes and version
This commit is contained in:
parent
3a56584a98
commit
c39c6fa7ba
@ -17,7 +17,7 @@ async function register({
|
|||||||
if (params.path.startsWith("/my-account")) {
|
if (params.path.startsWith("/my-account")) {
|
||||||
if (document.getElementById("subscription-link")) return;
|
if (document.getElementById("subscription-link")) return;
|
||||||
|
|
||||||
let href = "/p/my-subscription";
|
let href = "/p/ncd-my-subscription";
|
||||||
|
|
||||||
// Get menu container
|
// Get menu container
|
||||||
const menuContainer = document.getElementsByClassName("sub-menu")[0];
|
const menuContainer = document.getElementsByClassName("sub-menu")[0];
|
||||||
@ -25,7 +25,7 @@ async function register({
|
|||||||
// Create link
|
// Create link
|
||||||
const content = `
|
const content = `
|
||||||
<a _ngcontent-dke-c79="" id="subscription-link" routerlinkactive="active" class="sub-menu-entry ng-star-inserted" href="${href}">
|
<a _ngcontent-dke-c79="" id="subscription-link" routerlinkactive="active" class="sub-menu-entry ng-star-inserted" href="${href}">
|
||||||
${await peertubeHelpers.translate("Storage")}
|
${await peertubeHelpers.translate("NCD Storage")}
|
||||||
</a>
|
</a>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@ -41,21 +41,21 @@ async function register({
|
|||||||
|
|
||||||
// Register routes
|
// Register routes
|
||||||
registerClientRoute({
|
registerClientRoute({
|
||||||
route: "my-subscription",
|
route: "ncd-my-subscription",
|
||||||
onMount: ({ rootEl }) => {
|
onMount: ({ rootEl }) => {
|
||||||
subPage.showPage({rootEl, peertubeHelpers});
|
subPage.showPage({rootEl, peertubeHelpers});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
registerClientRoute({
|
registerClientRoute({
|
||||||
route: "subscription-success",
|
route: "ncd-subscription-success",
|
||||||
onMount: ({ rootEl }) => {
|
onMount: ({ rootEl }) => {
|
||||||
successPage.showPage({rootEl, peertubeHelpers});
|
successPage.showPage({rootEl, peertubeHelpers});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
registerClientRoute({
|
registerClientRoute({
|
||||||
route: "subscription-cancel",
|
route: "ncd-subscription-cancel",
|
||||||
onMount: ({ rootEl }) => {
|
onMount: ({ rootEl }) => {
|
||||||
cancelPage.showPage({rootEl, peertubeHelpers});
|
cancelPage.showPage({rootEl, peertubeHelpers});
|
||||||
},
|
},
|
||||||
|
@ -10,5 +10,5 @@
|
|||||||
"Subscription canceled.": "Souscription annulée.",
|
"Subscription canceled.": "Souscription annulée.",
|
||||||
"Secure payment with Stripe": "Paiement sécurisé via Stripe",
|
"Secure payment with Stripe": "Paiement sécurisé via Stripe",
|
||||||
"Your current plan": "Votre offre actuelle",
|
"Your current plan": "Votre offre actuelle",
|
||||||
"Storage": "Stockage"
|
"NCD Storage": "NCD Stockage"
|
||||||
}
|
}
|
||||||
|
6
main.js
6
main.js
@ -121,8 +121,8 @@ async function register({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mode: 'subscription',
|
mode: 'subscription',
|
||||||
success_url: `${INSTANCE_URL}/p/subscription-success?session_id={CHECKOUT_SESSION_ID}`,
|
success_url: `${INSTANCE_URL}/p/ncd-subscription-success?session_id={CHECKOUT_SESSION_ID}`,
|
||||||
cancel_url: `${INSTANCE_URL}/p/subscription-cancel`,
|
cancel_url: `${INSTANCE_URL}/p/ncd-subscription-cancel`,
|
||||||
});
|
});
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
@ -157,7 +157,7 @@ async function register({
|
|||||||
|
|
||||||
// This is the url to which the customer will be redirected when they are done
|
// This is the url to which the customer will be redirected when they are done
|
||||||
// managing their billing with the portal.
|
// managing their billing with the portal.
|
||||||
const returnUrl = INSTANCE_URL + "/p/my-subscription";
|
const returnUrl = INSTANCE_URL + "/p/ncd-my-subscription";
|
||||||
|
|
||||||
const portalSession = await stripe.billingPortal.sessions.create({
|
const portalSession = await stripe.billingPortal.sessions.create({
|
||||||
customer: checkoutSession.customer,
|
customer: checkoutSession.customer,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "peertube-plugin-ncd-sell-storage",
|
"name": "peertube-plugin-ncd-sell-storage",
|
||||||
"description": "NCD fork of the peertube-plugin-orion-sell-storage to sell storage to users using Stripe",
|
"description": "NCD fork of the peertube-plugin-orion-sell-storage to sell storage to users using Stripe",
|
||||||
"version": "1.0.6",
|
"version": "1.0.8",
|
||||||
"author": "matty",
|
"author": "matty",
|
||||||
"clientScripts": [
|
"clientScripts": [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user