A beta-tester reports a failure on using Stripe for checkout.
In the drupal logs I see this:
> Card processing error: Invalid token id: undefined
In the Stripe logs I see a successful v1/tokens request, which returns a good-looking token.
But the v1/charges request that comes next has these parameters:
amount: "1063"
currency: "USD"
card: "undefined"
description: "Order Number: 10"
And it fails because the card attribute contains "undefined", instead of the token
that was returned in the first step.
So the token is getting corrupted somewhere along the line as it passes from Stripe
to the javascript to php and back to Stripe.
This tester tried 4 times, with the same result.
BUT when I try it, it all works smoothly.
Any suggestions for how to trouble-shoot this?
Thanks!
Comments
Comment #1
hbochner commentedJust an update:
my trouble-shooting didn't yield anything.
I marked the user's order as "complete", so that she would get a fresh one
on the next attempt.
And it worked on the next attempt. Perhaps something was corrupted in
the "order" data structure?
Anyway, I can no longer reproduce the problem.
Will keep an eye out for a recurrence.
Comment #2
justingeeslin commentedThis sounds similar to what I am experiencing.
When I attempt to process a payment using Stripe. I receive the following messages:
stripeToken seems to be missing. Let's look in the module around line 148:
Looks like 'stripeToken' should be defined the $_POST array.
Let's see what is being POSTed.
'stripeToken' is no where to be found in the POST data.
What is stripeToken? What should it be?
Should it be the card number? That IS in POST data..
Comment #3
justingeeslin commentedI was able to resolve my issue by changing this module's JavaScript.
In my situation, I need to check if form element '#edit-commerce-payment-payment-method-commerce-striperules-stripe-payment' is checked.
Without this the JavaScript call to compute 'stripeToken' would never occur.
Hope this helps someone.
Maybe I can commit my changes if I have permission.
Comment #4
Anonymous (not verified) commentedI had this same issue OOTB. The module is checking for:
where in my case, it should have been:
Comment #5
avb commented@bryanlburkholder: Your fix worked like a charm.
This should be fixed.
Comment #6
aviindub commentedthis appears to be fixed.
Comment #7
tr33m4n commentedThis is not fixed,
Notice: Undefined index: stripeToken in commerce_stripe_submit_form_submit() (line 211still appears when attempting to submit the form and the followingWe received the following error processing your card. Please enter your information again or try a different card.
You must supply either a card or a customer id
Shows up as errors. I tried changing the id of javascript element needed to process however it would seem that my checkout uses the original '#edit-commerce-payment-payment-method-commerce-stripecommerce-payment-commerce-stripe' id, so does not need to change.
Anyone have any other pointers?
Cheers
Comment #8
tr33m4n commentedAh, figure it out. As I'm running a recent version of jQuery the .live function is deprecated, so I had to change it to the .on function. Please update the js with version checking/require a certain version of jQuery
Comment #9
aviindub commented