Last active
November 27, 2016 02:49
-
-
Save andyfleming/e248de196c14a134e518cdd6482dd2ab to your computer and use it in GitHub Desktop.
Revisions
-
andyfleming revised this gist
Nov 27, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ <form action="/-api/stripe/checkout" method="POST" id="donation-form"> <!-- Input field for user --> <input type="number" name="donation_amount" value="5"> <!-- Values for Zesty --> <input type="hidden" name="amount" value="500"> <input type="hidden" name="success_redirect" value="/thank-you-for-your-donation/"> <input type="hidden" name="failure_redirect" value="/an-error-occurred-with-your-donation/"> <input type="hidden" name="charge_description" value="Donation on example.com"> -
andyfleming created this gist
Nov 27, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ <form action="/-api/stripe/checkout" method="POST" id="donation-form"> <!-- Input field for user --> <input type="number" name="donation_amount"> <!-- Values for Zesty --> <input type="hidden" name="amount" value="1199"><!-- should match data-amount below (in cents) --> <input type="hidden" name="success_redirect" value="/thank-you-for-your-donation/"> <input type="hidden" name="failure_redirect" value="/an-error-occurred-with-your-donation/"> <input type="hidden" name="charge_description" value="Donation on example.com"> <!-- 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-description="Donation" data-image="https://stripe.com/img/documentation/checkout/marketplace.png" data-locale="auto" data-zip-code="true"> </script> <script> // Every time the donation amount is changed, change the hidden amount field (and convert from dollars to cents) jQuery('#donation-form [name="donation_amount"]').on('keyup', function() { jQuery('#donation-form [name="amount"]').val(jQuery(this).val() * 100) }); </script> </form>