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');
|
||||
|
||||
function stripeKey() {
|
||||
if (window.location.host === 'mnml.gg') return 'pk_live_fQGrL1uWww2ot8W1G7vTySAv004ygmnMXq';
|
||||
return 'pk_test_Cb49tTqTXpzk7nEmlGzRrNJg00AU0aNZDj';
|
||||
}
|
||||
|
||||
// Redux Store
|
||||
const store = createStore(
|
||||
combineReducers(reducers),
|
||||
@ -30,7 +35,7 @@ document.fonts.load('16pt "Jura"').then(() => {
|
||||
|
||||
const App = () => (
|
||||
<Provider store={store}>
|
||||
<StripeProvider apiKey="pk_live_fQGrL1uWww2ot8W1G7vTySAv004ygmnMXq">
|
||||
<StripeProvider apiKey={stripeKey()}>
|
||||
<Mnml />
|
||||
</StripeProvider>
|
||||
</Provider>
|
||||
|
||||
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user