Monday, 31 October 2011

HSBC API: PayerTxnId is not in a valid base64 encoding

That pesky HSBC API caused me a lot of grief when I first had to set it up on a client site. For various reasons I ended up using the XML method of performing the transaction.

Anyway...
Having recently implemented the 3D secure (Payer Authentication Specification (PAS)) I was getting a PayerTxnId 'LOADS_OF CHARS' is not in a valid  base64 encoding. The PayerTxnId is pulled from the posted data from HSBC. It comes from the XID field.

It took me a while to spot it and, to be honest, I thought I would have to contact HSBC technical support yet again (who , by the by, are very good). But I did spot it! There was a space in the string. I swapped that out for a + and hey presto, the HSBC API processed it just fine.

No comments:

Post a Comment