dev stripe checks
This commit is contained in:
parent
fbb7e58f3c
commit
7603497372
@ -13,6 +13,11 @@ const registerEvents = require('./events');
|
|||||||
|
|
||||||
const Mnml = require('./components/mnml');
|
const Mnml = require('./components/mnml');
|
||||||
|
|
||||||
|
function stripeKey() {
|
||||||
|
if (window.location.host === 'mnml.gg') return 'pk_live_fQGrL1uWww2ot8W1G7vTySAv004ygmnMXq';
|
||||||
|
return 'pk_test_Cb49tTqTXpzk7nEmlGzRrNJg00AU0aNZDj';
|
||||||
|
}
|
||||||
|
|
||||||
// Redux Store
|
// Redux Store
|
||||||
const store = createStore(
|
const store = createStore(
|
||||||
combineReducers(reducers),
|
combineReducers(reducers),
|
||||||
@ -30,7 +35,7 @@ document.fonts.load('16pt "Jura"').then(() => {
|
|||||||
|
|
||||||
const App = () => (
|
const App = () => (
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<StripeProvider apiKey="pk_live_fQGrL1uWww2ot8W1G7vTySAv004ygmnMXq">
|
<StripeProvider apiKey={stripeKey()}>
|
||||||
<Mnml />
|
<Mnml />
|
||||||
</StripeProvider>
|
</StripeProvider>
|
||||||
</Provider>
|
</Provider>
|
||||||
|
|||||||
@ -1,6 +1,16 @@
|
|||||||
const preact = require('preact');
|
const preact = require('preact');
|
||||||
const { injectStripe } = require('react-stripe-elements');
|
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) {
|
function BitsBtn(args) {
|
||||||
const {
|
const {
|
||||||
stripe,
|
stripe,
|
||||||
@ -8,18 +18,18 @@ function BitsBtn(args) {
|
|||||||
} = args;
|
} = args;
|
||||||
function subscribeClick() {
|
function subscribeClick() {
|
||||||
stripe.redirectToCheckout({
|
stripe.redirectToCheckout({
|
||||||
items: [{ plan: 'plan_Fjdtsd4i7aVLe1', quantity: 1 }],
|
items: [{ plan: subPlan(), quantity: 1 }],
|
||||||
successUrl: 'https://mnml.gg',
|
successUrl: window.location.origin,
|
||||||
cancelUrl: 'https://mnml.gg',
|
cancelUrl: window.location.origin,
|
||||||
clientReferenceId: account.id,
|
clientReferenceId: account.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function bitsClick() {
|
function bitsClick() {
|
||||||
stripe.redirectToCheckout({
|
stripe.redirectToCheckout({
|
||||||
items: [{ sku: 'sku_Fjdu7zOy3sLGc5', quantity: 1 }],
|
items: [{ sku: bitsSku(), quantity: 1 }],
|
||||||
successUrl: 'https://mnml.gg',
|
successUrl: window.location.origin,
|
||||||
cancelUrl: 'https://mnml.gg',
|
cancelUrl: window.location.origin,
|
||||||
clientReferenceId: account.id,
|
clientReferenceId: account.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user