2

I am trying to implement 3ds to an existing worldpay payment to my system. Although this works with test environment requests, I am facing problem with the live on the final authorize call, Worldpay returns invalid payment details. Here is the response I get back from worldpay on authorize call: Api :https://api.worldpay.com/v1/

{
  "httpStatusCode": 400,
  "customCode": "INVALID_PAYMENT_DETAILS",
  "message": "EXT_67: Verification of threeDSResponseCode failed",
  "description": "Server is refusing to fulfill the request.",
  "errorHelpUrl": null,
  "originalRequest": "{'threeDSResponseCode':'base64code','threeDSecureInfo':{'shopperIpAddress':'ipadress','shopperSessionId':'guid','shopperAcceptHeader':'application/json','shopperUserAgent':'userAgent'},'shopperIpAddress':'ipaddress','shopperSessionId':'guid','shopperUserAgent':'userAgent','shopperAcceptHeader':'application/json'}"
}

I did check with worldpay support team and I was told the threedsResponseCode(token) which I sent was not in valid with the token which the bank send to worldpay. Worldpay support team send me the token which was send by the bank and there is some kind of encoding mismatch in the token which I couldn't get around. Token send from bank to worldpay and to us is similar but few character have a mismatch.

For Example, Please find some of the mismatch characters in the long token below,

Token what i send :MzuxC%2FX

What worldpay expects: MzuxC%2FX

Worldpay mentions that they used base64 encoding in the documents but we tried all possible encodings but its in vain.

Worldpay support team is not been helpful, so if someone help me with the expected format, it'll be much appreciated.

Worlpay Support Docs:

Sam
  • 21
  • 3

1 Answers1

0

This is not base 64 encoding, rather html encoding - https://en.m.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

Start with this method: https://learn.microsoft.com/en-us/dotnet/api/system.web.httputility.htmlencode?view=net-6.0

However, I'm not certain it will encode the percent symbol as that's not one of the reserved characters in html.

Jaybird
  • 541
  • 4
  • 13