Skip to main content
Tweeted twitter.com/#!/StackExpression/status/457447330862886913
deleted 1 character in body
Source Link
$( document ).ready(function() {

 $(function() {
  $.getScript('https://js.stripe.com/v2/', function() {
      Stripe.setPublishableKey('pk_live_7yKPQhIqyrfYa54Q4YIZVxqK''pk_live_xxxxxxxxxxxxxxxxxxxxxxx');
  });

  
  $checkout_submit = $("#checkout_submit").click(function() {

      
      if ($("[name='payment_method']").val() == "Stripe") {

          
          $checkout_submit.attr('disabled', true);

          
          Stripe.card.createToken(${(this.form), stripeResponseHandler);
          
          
          return false;
      }
  
   });
  
  function stripeResponseHandler(status, response) {
      /* Re-enable the checkout submit button */
      $checkout_submit.attr('disabled', false);
      

      /* Check whether we have a valid credit card */
      if (response.error) {
          alert(response.error.message);
      } else {
          /* Set the card token and submit the checkout form */
          $("#payment_token").val(response.id);
          $checkout_submit.off("click").click();
      }
    }
});
$( document ).ready(function() {

 $(function() {
  $.getScript('https://js.stripe.com/v2/', function() {
      Stripe.setPublishableKey('pk_live_7yKPQhIqyrfYa54Q4YIZVxqK');
  });

  
  $checkout_submit = $("#checkout_submit").click(function() {

      
      if ($("[name='payment_method']").val() == "Stripe") {

          
          $checkout_submit.attr('disabled', true);

          
          Stripe.card.createToken(${(this.form), stripeResponseHandler);
          
          
          return false;
      }
  
   });
  
  function stripeResponseHandler(status, response) {
      /* Re-enable the checkout submit button */
      $checkout_submit.attr('disabled', false);
      

      /* Check whether we have a valid credit card */
      if (response.error) {
          alert(response.error.message);
      } else {
          /* Set the card token and submit the checkout form */
          $("#payment_token").val(response.id);
          $checkout_submit.off("click").click();
      }
    }
});
$( document ).ready(function() {

 $(function() {
  $.getScript('https://js.stripe.com/v2/', function() {
      Stripe.setPublishableKey('pk_live_xxxxxxxxxxxxxxxxxxxxxxx');
  });

  
  $checkout_submit = $("#checkout_submit").click(function() {

      
      if ($("[name='payment_method']").val() == "Stripe") {

          
          $checkout_submit.attr('disabled', true);

          
          Stripe.card.createToken(${(this.form), stripeResponseHandler);
          
          
          return false;
      }
  
   });
  
  function stripeResponseHandler(status, response) {
      /* Re-enable the checkout submit button */
      $checkout_submit.attr('disabled', false);
      

      /* Check whether we have a valid credit card */
      if (response.error) {
          alert(response.error.message);
      } else {
          /* Set the card token and submit the checkout form */
          $("#payment_token").val(response.id);
          $checkout_submit.off("click").click();
      }
    }
});
added 1 character in body
Source Link
$( document ).ready(function() {

 $(function() {
  $.getScript('https://js.stripe.com/v2/', function() {
      Stripe.setPublishableKey('pk_live_7yKPQhIqyrfYa54Q4YIZVxqK');
  });

  
  $checkout_submit = $("#checkout_submit").click(function() {

      
      if ($("[name='payment_method']").val() == "Stripe") {

          
          $checkout_submit.attr('disabled', true);

          
          Stripe.card.createToken(${(this.form), stripeResponseHandler);
          
          
          return false;
      }
  
   });
  
  function stripeResponseHandler(status, response) {
      /* Re-enable the checkout submit button */
      $checkout_submit.attr('disabled', false);
      

      /* Check whether we have a valid credit card */
      if (response.error) {
          alert(response.error.message);
      } else {
          /* Set the card token and submit the checkout form */
          $("#payment_token").val(response.id);
          $checkout_submit.off("click").click();
      }
    }
});
$( document ).ready(function() {

 $(function() {
  $.getScript('https://js.stripe.com/v2/', function() {
      Stripe.setPublishableKey('pk_live_7yKPQhIqyrfYa54Q4YIZVxqK');
  });

  
  $checkout_submit = $("#checkout_submit").click(function() {

      
      if ($("[name='payment_method']").val() == "Stripe") {

          
          $checkout_submit.attr('disabled', true);

          
          Stripe.card.createToken({(this.form), stripeResponseHandler);
          
          
          return false;
      }
  
   });
  
  function stripeResponseHandler(status, response) {
      /* Re-enable the checkout submit button */
      $checkout_submit.attr('disabled', false);
      

      /* Check whether we have a valid credit card */
      if (response.error) {
          alert(response.error.message);
      } else {
          /* Set the card token and submit the checkout form */
          $("#payment_token").val(response.id);
          $checkout_submit.off("click").click();
      }
    }
});
$( document ).ready(function() {

 $(function() {
  $.getScript('https://js.stripe.com/v2/', function() {
      Stripe.setPublishableKey('pk_live_7yKPQhIqyrfYa54Q4YIZVxqK');
  });

  
  $checkout_submit = $("#checkout_submit").click(function() {

      
      if ($("[name='payment_method']").val() == "Stripe") {

          
          $checkout_submit.attr('disabled', true);

          
          Stripe.card.createToken(${(this.form), stripeResponseHandler);
          
          
          return false;
      }
  
   });
  
  function stripeResponseHandler(status, response) {
      /* Re-enable the checkout submit button */
      $checkout_submit.attr('disabled', false);
      

      /* Check whether we have a valid credit card */
      if (response.error) {
          alert(response.error.message);
      } else {
          /* Set the card token and submit the checkout form */
          $("#payment_token").val(response.id);
          $checkout_submit.off("click").click();
      }
    }
});
added 1220 characters in body
Source Link

Javascript:

$( document ).ready(function() {

 $(function() {
  $.getScript('https://js.stripe.com/v2/', function() {
      Stripe.setPublishableKey('pk_live_7yKPQhIqyrfYa54Q4YIZVxqK');
  });

  
  $checkout_submit = $("#checkout_submit").click(function() {

      
      if ($("[name='payment_method']").val() == "Stripe") {

          
          $checkout_submit.attr('disabled', true);

          
          Stripe.card.createToken({(this.form), stripeResponseHandler);
          
          
          return false;
      }
  
   });
  
  function stripeResponseHandler(status, response) {
      /* Re-enable the checkout submit button */
      $checkout_submit.attr('disabled', false);
      

      /* Check whether we have a valid credit card */
      if (response.error) {
          alert(response.error.message);
      } else {
          /* Set the card token and submit the checkout form */
          $("#payment_token").val(response.id);
          $checkout_submit.off("click").click();
      }
    }
});

});

Javascript:

$( document ).ready(function() {

 $(function() {
  $.getScript('https://js.stripe.com/v2/', function() {
      Stripe.setPublishableKey('pk_live_7yKPQhIqyrfYa54Q4YIZVxqK');
  });

  
  $checkout_submit = $("#checkout_submit").click(function() {

      
      if ($("[name='payment_method']").val() == "Stripe") {

          
          $checkout_submit.attr('disabled', true);

          
          Stripe.card.createToken({(this.form), stripeResponseHandler);
          
          
          return false;
      }
  
   });
  
  function stripeResponseHandler(status, response) {
      /* Re-enable the checkout submit button */
      $checkout_submit.attr('disabled', false);
      

      /* Check whether we have a valid credit card */
      if (response.error) {
          alert(response.error.message);
      } else {
          /* Set the card token and submit the checkout form */
          $("#payment_token").val(response.id);
          $checkout_submit.off("click").click();
      }
    }
});

});

Source Link
Loading