This commit is contained in:
ntr
2019-06-17 19:46:35 +10:00
parent 6f7c2cf571
commit e74c820ce4
13 changed files with 339 additions and 163 deletions
+1
View File
@@ -463,6 +463,7 @@ header {
}
.stripe-btn {
width: 100%;
padding: 0 0.5em;
background: whitesmoke;
color: black;
+8 -4
View File
@@ -11,12 +11,16 @@ function pingColour(ping) {
}
function BitsBtn(args) {
const { stripe } = args;
const {
stripe,
account,
} = args;
function onClick(e) {
stripe.redirectToCheckout({
items: [{sku: 'sku_FGjPl1YKoT241P', quantity: 1}],
items: [{plan: 'plan_FGmRwawcOJJ7Nv', quantity: 1}],
successUrl: 'http://localhost:40080/payments/success',
cancelUrl: 'http://localhost:40080/payments/cancel',
clientReferenceId: account.id
});
}
return (
@@ -27,7 +31,7 @@ function BitsBtn(args) {
class="stripe-btn"
id="checkout-button-sku_FGjPl1YKoT241P"
role="link">
Buy Bits
Subscribe
</button>
</div>
);
@@ -72,7 +76,7 @@ function AccountStatus(args) {
<div class="ping-text">{ping}ms</div>
</div>
<Elements>
<StripeBitsBtn />
<StripeBitsBtn account={account} />
</Elements>
<button onClick={() => logout()}>Logout</button>
</div>
+1 -1
View File
@@ -1,7 +1,7 @@
const toast = require('izitoast');
const cbor = require('borc');
const SOCKET_URL = process.env.NODE_ENV === 'production' ? 'wss://mnml.gg/ws' : 'ws://localhost:40000/ws/';
const SOCKET_URL = process.env.NODE_ENV === 'production' ? 'wss://mnml.gg/ws' : 'ws://localhost:40000/api/ws';
function errorToast(err) {
console.error(err);