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() {
var donationForm = document.getElementById('donation-form');
var amountField = donationForm.amount;
var tokenField = donationForm.stripe_token;
var tokenField = donationForm.querySelector(
'[name=donation\\[stripe_token\\]]');
var checkout = StripeCheckout.configure({
key: 'pk_test_wEvgn4baD9W5ld5C9JCS9Ahf', // TODO
//image: '/square-image.png', // TODO
image: donationForm.getAttribute('data-checkout-image'),
token: function(token) {
stripe_token.value = token.id;
tokenField.value = token.id;
donationForm.submit();
}
});

View file

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