dev stripe checks
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
const preact = require('preact');
|
||||
const { injectStripe } = require('react-stripe-elements');
|
||||
|
||||
function subPlan() {
|
||||
if (window.location.host === 'mnml.gg') return 'plan_Fjdtsd4i7aVLe1';
|
||||
return 'prod_FWSA8RoyMMV3st';
|
||||
}
|
||||
|
||||
function bitsSku() {
|
||||
if (window.location.host === 'mnml.gg') return 'sku_Fjdu7zOy3sLGc5';
|
||||
return 'sku_FjuNxONdWewjH2';
|
||||
}
|
||||
|
||||
function BitsBtn(args) {
|
||||
const {
|
||||
stripe,
|
||||
@@ -8,18 +18,18 @@ function BitsBtn(args) {
|
||||
} = args;
|
||||
function subscribeClick() {
|
||||
stripe.redirectToCheckout({
|
||||
items: [{ plan: 'plan_Fjdtsd4i7aVLe1', quantity: 1 }],
|
||||
successUrl: 'https://mnml.gg',
|
||||
cancelUrl: 'https://mnml.gg',
|
||||
items: [{ plan: subPlan(), quantity: 1 }],
|
||||
successUrl: window.location.origin,
|
||||
cancelUrl: window.location.origin,
|
||||
clientReferenceId: account.id,
|
||||
});
|
||||
}
|
||||
|
||||
function bitsClick() {
|
||||
stripe.redirectToCheckout({
|
||||
items: [{ sku: 'sku_Fjdu7zOy3sLGc5', quantity: 1 }],
|
||||
successUrl: 'https://mnml.gg',
|
||||
cancelUrl: 'https://mnml.gg',
|
||||
items: [{ sku: bitsSku(), quantity: 1 }],
|
||||
successUrl: window.location.origin,
|
||||
cancelUrl: window.location.origin,
|
||||
clientReferenceId: account.id,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user