integrate stripe

This commit is contained in:
2019-07-24 21:05:28 +02:00
parent a8a6039d8d
commit 3ec859e32b
6 changed files with 81 additions and 10 deletions
+25 -6
View File
@@ -8,13 +8,13 @@
{{range .LastMetrics}}
<div class="columns is-vcentered is-marginless">
<div class="column is-full has-background-primary">
<span id="alias_{{.Deveui}}" class="is-size-5">{{.Alias}}</span>
<div class="select is-pulled-right is-vcentered">
<span id="alias_{{.Deveui}}" class="is-size-7-mobile is-size-4-tablet">{{.Alias}} (bis 01.01.2099)</span>
<div class="select is-pulled-right is-vcentered is-size-7-mobile">
<select class="has-background-light">
<option>keine Verl&auml;ngerung</option>
<option>1 Jahr verl&auml;ngern</option>
<option>2 Jahre verl&auml;ngern</option>
<option>3 Jahre verl&auml;ngern</option>
<option>keine</option>
<option>1 Jahr</option>
<option>2 Jahre</option>
<option>3 Jahre</option>
</select>
</div>
</div>
@@ -23,8 +23,27 @@
<div class="column is-full"></div>
</div>
{{end}}
<div>
<button id="pay-button" class="button is-success">Pay</button>
</div>
<script src="https://js.stripe.com/v3/"></script>
<script>
var stripe = Stripe('pk_test_YkSGqH3Tk9WKK9HrlY63GhAg');
$("#pay-button").click(function() {
stripe.redirectToCheckout({
sessionId: '{{.CheckoutSessionID}}'
}).then(function (result) {
// If `redirectToCheckout` fails due to a browser or network
// error, display the localized error message to your customer
// using `result.error.message`.
});
});
</script>
{{ else }}
<h4>Bitte zuerst <a href="login.html">einloggen</a></h4>
{{end}}