1
0
Fork 0
forked from OpenNeo/impress

stripe checkout image; breaks in development because dev copy of image is not public :P

This commit is contained in:
Emi Matchu 2014-09-09 20:41:58 -05:00
parent 0afc8ddb2b
commit 2a1a3c61fa
2 changed files with 7 additions and 5 deletions

View file

@ -1,13 +1,14 @@
(function() { (function() {
var donationForm = document.getElementById('donation-form'); var donationForm = document.getElementById('donation-form');
var amountField = donationForm.amount; var amountField = donationForm.amount;
var tokenField = donationForm.stripe_token; var tokenField = donationForm.querySelector(
'[name=donation\\[stripe_token\\]]');
var checkout = StripeCheckout.configure({ var checkout = StripeCheckout.configure({
key: 'pk_test_wEvgn4baD9W5ld5C9JCS9Ahf', // TODO key: 'pk_test_wEvgn4baD9W5ld5C9JCS9Ahf', // TODO
//image: '/square-image.png', // TODO image: donationForm.getAttribute('data-checkout-image'),
token: function(token) { token: function(token) {
stripe_token.value = token.id; tokenField.value = token.id;
donationForm.submit(); donationForm.submit();
} }
}); });

View file

@ -6,8 +6,9 @@
%span.campaign-raised %span.campaign-raised
toward our hosting costs this year. Thanks so much! toward our hosting costs this year. Thanks so much!
= form_tag 'TODO', id: 'donation-form' do = form_tag donations_path, method: 'POST', id: 'donation-form',
= hidden_field_tag 'stripe_token' 'data-checkout-image' => image_path('default-preview.png') do
= hidden_field_tag 'donation[stripe_token]'
%header %header
%p#donation-form-title %p#donation-form-title
Thanks for supporting Dress to Impress! Thanks for supporting Dress to Impress!