onlywork1211
Registered Member
- Mar 30, 2016
- 96
- 3
Hello ,
I'm trying to use stripe on my website , what the problame with this code ?
I'm trying to use stripe on my website , what the problame with this code ?
Code:
<form action="/your-server-side-code" method="POST">
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="sk_test_vsjE9A67uXrtx4BHq5hdDA50"
data-amount="3000"
data-name="**************"
data-description="Widget"
data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
data-locale="auto"
data-zip-code="true"
data-currency="usd">
</script>
</form>
Stripe.api_key = "**********************"
token = params[:stripeToken]
begin
charge = Stripe::Charge.create(
:amount => 3000,
:currency => "usd",
:source => token,
:description => "Example charge ($30.00) "
)
rescue Stripe::CardError => e
end