-
Notifications
You must be signed in to change notification settings - Fork 31
Always getting TKN_NOT_FOUND error on payment requests. #18
Description
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