Skip to content
This repository was archived by the owner on Oct 5, 2023. It is now read-only.

Always getting TKN_NOT_FOUND error on payment requests. #18

Open
simonpearson-vs opened this issue Oct 19, 2017 · 2 comments
Open

Always getting TKN_NOT_FOUND error on payment requests. #18

simonpearson-vs opened this issue Oct 19, 2017 · 2 comments

Comments

@simonpearson-vs
Copy link

Hi

When making payment requests, I am always getting the following response:

[httpStatusCode] => 404
[customCode] => TKN_NOT_FOUND
[message] => EXT_1: Token does not exist
[description] => Token used with request does not exist, please create a new token
[errorHelpUrl] =>
[originalRequest] =>

We are submitting the customer payment details using the template form, which is successfully returning a token. Our Worldpay template form settings are as follows:

        Worldpay.useTemplateForm({
          'clientKey':'<?=$data['client_key']?>',
          'form':'payment_method',
          'paymentSection':'payment_section',
          'display':'inline',
          'reusable':true,
          'callback': function(obj) {
            if (obj && obj.token) {
              var _el = document.createElement('input');
              _el.value = obj.token;
              _el.type = 'hidden';
              _el.name = 'token';
              document.getElementById('payment_method').appendChild(_el);
              document.getElementById('payment_method').submit();
            }
          }
        });

This token is then being posted to the next stage of our checkout, which then then makes the payment request shown below (sensitive information omitted for security):

{
    "amount":1699,
    "billingAddress":
    {
        "address1":"",
        "city":"",
        "postalCode":"",
        "countryCode":"GB"
    },
    "currencyCode":"GBP",
    "deliveryAddress":
    {
        "firstName":"",
        "lastName":"",
        "address1":"",
        "address2":"",
        "city":"",
        "postalCode":"",
        "countryCode":"GB",
        "telephoneNumber":"01234567890"
    },
    "is3DSOrder":true,
    "name":"",
    "orderDescription":"",
    "orderType":"ECOM",
    "shopperAcceptHeader":"text\/html,application\/xhtml+xml,application\/xml;q=0.9, image\/webp,image\/apng,*\/*;q=0.8",
    "shopperEmailAddress":"",
    "shopperIpAddress":"",
    "shopperSessionId":"WEB77-648",
    "shopperUserAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/61.0.3163.100 Safari\/537.36",
    "token":"TESTRU44bea883-bd8b-4b5b-8643-298787978cdc"
}

Our WorldPay account is currently in test mode, so we are using the test client and service keys.

When the worldpay.js creates and returns the token, does it automatically save the token on Worldpay, or is there something else that we must do to save the token?

Thanks

@shalinijeevanigi
Copy link

shalinijeevanigi commented Mar 15, 2018

Hi Simon,

Did you get answer for your question? I am experiencing the same issue while I integrate my application using json api and Java. After passing the card details to worldpay, I got token back, but while I send this token to createOrder, it throws below exception

com.worldpay.gateway.clearwater.client.core.exception.WorldpayException: API error: EXT_1: Token 'token=TEST_RU_1484d732-5275-401f-84c6-e8c9059e6444' does not exist.

@scott-lsi
Copy link

scott-lsi commented Apr 5, 2018

I came across this and solved what was going on with mine, although it may be different in other cases. I was retrieving _token rather than token from my request. Removed the underscore and all's well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants