File diff abed88031396 → c40b8cc02ddc
pinaxcon/templates/registrasion/stripe/credit_card_payment.html
Show inline comments
...
 
@@ -35,13 +35,14 @@
 
    function stripeResponseHandler(status, response) {
 
      // Grab the form:
 
      var $form = $('#payment-form');
 
      var $submit = $form.find('input[type=submit]')
 
      if (response.error) { // Problem!
 
        console.log(response.error.message);
 

	
 
        // Show the errors on the form:
 
        $form.find('#payment-errors').text(response.error.message);
 
        $form.find('#payment-errors-outer').show();
 
        $form.find('input[type=submit]').prop('disabled', false); // Re-enable submission
 
        $submit.prop('disabled', false); // Re-enable submission
 

	
 
      } else { // Token was created!
 
        console.log(response);
...
 
@@ -53,8 +54,11 @@
 
        $form = $form.append($('<input type="hidden" name="stripe_token" />').val(token));
 

	
 
        // Submit the form:
 
        $form.find('input[type=submit]').prop('disabled', false);
 
        $form.find('input[type=submit]').click();
 

	
 
        $submit.prop('disabled', false);
 
        $submit.click();
 
        $submit.prop('disabled', true);
 
        $form.append($('<p>').text("Processing your payment. Please do not refresh."));
 
      }
 
    };
 
  </script>