No such token error

1,469 views
Skip to first unread message

Thomas Young

unread,
Nov 22, 2016, 11:51:21 AM11/22/16
to Stripe API Discussion
So I had this stripe api working just fine; credit card charges were going through as the should be.  
Without making any changes to the code, this morning I began getting this "No such token: tok_jdjdjdjdj" error.

public function createSubscription($id)
$user = Organization::findOrFail($id);
$token = Input::get('stripeToken');
   $user->subscription(1)->quantity(1)->create($token);
   Session::flash('successMessage', 'Subscription Successful! You are now a premium user');
   return Redirect::back();
}


The token shows up in the logs in my stripe dash board.

I am using both secret test and secret publishable keys. 

Any one else had any experience with this?

Thanks!

I'm on laravel 4.2

Thomas Young

unread,
Nov 22, 2016, 12:03:55 PM11/22/16
to Stripe API Discussion
EDIT: I am using both secret test key and publishable test key. 

Remi J.

unread,
Nov 22, 2016, 1:27:59 PM11/22/16
to api-d...@lists.stripe.com
Hey Thomas,

Whenever you get that error, it's almost always an API key issue. Something in your code is creating the card token with the Publishable API key (pk_test_XXXX) from one account and then trying to charge that same token with the Secret API key (sk_test_XXXX) from a different account.

I'd recommend to double check your integration first and make 100% sure that you're using the exact API keys you're seeing in your dashboard [1]. You should also try and search the codebase for pk_ and sk_ to make sure there isn't a key hardcoded somewhere.

Hope this helps,
Remi


On Tue, Nov 22, 2016 at 12:00 PM, Thomas Young <tom.you...@gmail.com> wrote:
EDIT: I am using both secret test key and publishable test key. 

--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.
To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at https://groups.google.com/a/lists.stripe.com/group/api-discuss/.

Thomas Young

unread,
Nov 22, 2016, 2:59:41 PM11/22/16
to Stripe API Discussion
Remi, 

Thanks! i had a conflicting pk in there somewhere. I appreciate the help!


On Tuesday, November 22, 2016 at 12:27:59 PM UTC-6, Remi J. wrote:
Hey Thomas,

Whenever you get that error, it's almost always an API key issue. Something in your code is creating the card token with the Publishable API key (pk_test_XXXX) from one account and then trying to charge that same token with the Secret API key (sk_test_XXXX) from a different account.

I'd recommend to double check your integration first and make 100% sure that you're using the exact API keys you're seeing in your dashboard [1]. You should also try and search the codebase for pk_ and sk_ to make sure there isn't a key hardcoded somewhere.

Hope this helps,
Remi

On Tue, Nov 22, 2016 at 12:00 PM, Thomas Young <tom.you...@gmail.com> wrote:
EDIT: I am using both secret test key and publishable test key. 

--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.

Remi J.

unread,
Nov 22, 2016, 3:01:44 PM11/22/16
to api-d...@lists.stripe.com
Hey Thomas!

I'm glad it helped! I did see your other message but I had to reject it unfortunately. This is not a viable topic for the api-discuss thread and you should instead talk to our support team directly about this here: https://support.stripe.com/email

Since it seems to be a TLS error though, you'll want to read the articles linked below and talk to the host provider:

Cheers,
Remi

To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.
Reply all
Reply to author
Forward
0 new messages