akkdio / sales

just trying the api for stripe out
0 stars 0 forks source link

page 48 #1

Closed akkdio closed 10 years ago

akkdio commented 10 years ago

The js should read like this:

 <script type="text/javascript">
 $(function(){
Stripe.setPublishableKey('<%=Rails.configuration.stripe[:publishable_key]%>');
 });

   $('#payment-form').submit(function(event) {
   var form = $(this);
   form.find('button').prop('disabled', true);
   Stripe.createToken(form, stripeResponseHandler);
   return false;
   });

   </script>

The book has $(function({... which leaves out a ")"