Last active
June 25, 2019 13:25
-
-
Save azcoov/4956135 to your computer and use it in GitHub Desktop.
Stripe Checkout Form in HAML
This file contains 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 characters
= form_tag charges_path do | |
%article | |
%label{:class => "amount"} | |
%span Amount: $5.00 | |
= javascript_include_tag "https://checkout.stripe.com/v2/checkout.js", | |
:class => "stripe-button", | |
:"data-key" => "#{Rails.configuration.stripe[:publishable_key]}", | |
:"data-description" => "30-day free trial", | |
:"data-amount" => "500", | |
:"data-image" => "/app-128x128.png" |
This file contains 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 characters
#another example with all the available data attributes | |
= form_tag charges_path do | |
%article | |
%label{:class => "amount"} | |
%span Amount: $5.00 | |
= javascript_include_tag "https://checkout.stripe.com/v2/checkout.js", | |
:class => "stripe-button", | |
:"data-key" => "#{Rails.configuration.stripe[:publishable_key]}", | |
:"data-label" => "Pay Now", | |
:"data-panel-label" => "Submit payment for", | |
:"data-name" => "ABC Company", | |
:"data-address" => "true", | |
:"data-description" => "30-day free trial", | |
:"data-amount" => "500", | |
:"data-image" => "/app-128x128.png" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment