Skip to content

Instantly share code, notes, and snippets.

@andyfleming
Created November 27, 2016 04:32
Show Gist options
  • Save andyfleming/17c37de3c8344240b1c4fe6a77fbaec0 to your computer and use it in GitHub Desktop.
Save andyfleming/17c37de3c8344240b1c4fe6a77fbaec0 to your computer and use it in GitHub Desktop.
Stripe Checkout Subscription with Zesty
<form action="/-api/stripe/subscribe" method="POST">
<!-- Plan to subscribe to -->
<!-- "value" must match plan ID in Stripe -->
<select name="plan_id">
<option value="plan1">Plan 1</option>
<option value="plan2">Plan 2</option>
<option value="plan3">Plan 3</option>
</select>
<!-- Pages to redirect to on success/failure -->
<input type="hidden" name="success_redirect" value="/thank-you/">
<input type="hidden" name="failure_redirect" value="/payment-error/">
<!-- Stripe Checkout button settings -->
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="{{ setting.stripe.key }}"
data-name="{{ clippings.site_name }}"
data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
data-locale="auto"
data-zip-code="true">
</script>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment