0

I have to charge from Stripe payment gateway, and code also available on website, but it only take hard code value. I want to apply data-amount attribute value at runtime which came from session from another page which is taken from enduser from textbox from another page.

<div>
    <form action="Default.aspx" method="post">
        <script
         src="https://checkout.stripe.com/checkout.js" class="stripe-button" class="stripe-button"
         data-key="pk_test_6pRNASCoBOKtIshFeQd4XMUh"
         data-amount="2000"
         data-name="Demo Site"
         data-description="2 widgets ($20.00)"
         data-image="/128x128.png"
         data-locale="auto">
        </script>
    </form>
</div>

Just replace data-amount attributes which value is 2000 with run time value from session or query string.

Tolga Evcimen
  • 7,112
  • 11
  • 58
  • 91
Khatri
  • 11
  • 4
  • If you are using razor check this: http://stackoverflow.com/questions/23538834/get-current-session-value-in-javascript if not maybe try jquery session: http://stackoverflow.com/questions/11580172/session-handling-in-jquery – emilpytka Nov 26 '15 at 13:09
  • 1
    A recomendation, if you can, use a custom form, do the payment process on the server side and use the Stripe library directly, it's safer and you will have full control of the process – Gusman Nov 26 '15 at 13:14

0 Answers0