Test Opaque Token

Status: Under Review
by mlunn01 on ‎02-15-2017 12:55 PM

It would be great if there was a test token that could be used to test the server side code that transmits the AcceptJs token to the Gateway, similiar to the way one uses test credit card numbers.

Status: Under Review
by BrandonSurowiec
on ‎06-01-2017 06:33 PM

Agreed. I'm writing tests for my code and it would be so much easier if I could have some set tokens that always works or fails. An API call to generate a test token would work too. Stripe has this and it's awesome.

by Mirimon
on ‎06-15-2017 12:02 AM

Yes, it will be very useful for unit tests, because in other case I cannot write tests for my method, which creates customers in your service. In fact I cannot write tests for the whole my service, which works with your SDK, because all actions with recurring billing require payment info, but in my case this info can be created only via opaque tokens.

by Administrator Administrator
on ‎06-15-2017 10:42 AM

If you step through the Accept.js script and what it calls, you'll eventually run into the API method that's called to generaten the token/nonce. If you call that API method yourself, you can get tokens returned independent of Accept.js, which would then enable your test processing.


It's not officially documented, so I can't promise it will always work, but at least for now that's an option. I detailed more info including the actual API method in this thread.


We'll continue to look at ways to best serve your needs here, perhaps by documenting and supporting the current API method used, or providing a test token.

by Administrator Administrator
on ‎06-15-2017 02:33 PM
Status changed to: Under Review