Stripe Checkout Tokens missing from Safari on osx and ios

219 views
Skip to first unread message

David Barrington

unread,
Mar 15, 2015, 6:14:28 PM3/15/15
to api-d...@lists.stripe.com

I'm receiving a strange intermittent error that I can't seem to reproduce to correct. 

The form gets submitted with the following code, but no token is present. I've attempted to test this on many safari variants including the specific agents that are experiencing the issue. This only occurs on osx and ios, with the Safari browser. Most orders process without issue. The token is not transmitted back with the token callback. I believe the token callback is not even executing.

<div class="well stripe-well"><form id="stripe-form" action="processurl" method="post">
<script src="https://checkout.stripe.com/checkout.js"></script>
   
<div class="row"><div class="col-md-12 col-lg-10 col-lg-offset-1">
       
<button id="placeYourOrder" class="btn btn-lg btn-warning btn-block">
           
<span>Place your order<br/><small>Click to Finalize your Order</small></span>
       
</button>
   
</div></div>

<script>
 
var handler = StripeCheckout.configure({
    key
: 'ashinykey',
    image
: 'stripe-logo.png',
    token
: function(token) {
       
var $input = $('<input type="hidden" name="stripeToken" />').val(token.id);
        $
("#stripe-form").append($input);
        $
("#stripe-form").submit();
   
}
 
});

  $
('#placeYourOrder').on('click', function(e) {
    handler
.open({
      name
: 'Name',
      description
: 'Order Description',
      zipCode
: true,
      allowRememberMe
:'false',
      email
:'ane...@email.com',
      panelLabel
:  'Checkout',
      amount
: 1234
   
});
    e
.preventDefault();
 
});

 
// Close Checkout on page navigation
  $
(window).on('popstate', function() {
    handler
.close();
 
});
   
 
</script>

Any help, greatly appreciated, thank you.

Reply all
Reply to author
Forward
0 new messages