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
+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>