I'm writing some integration tests for the server part of my BlueSnap integration. I need to find a way to associate a Hosted Payment Fields (HPF) token with credit card details.
In my calls to POST vaulted-shoppers
I pass in a HPF token (obtained from payment-fields-tokens
). However, this fails with multiple errors such as Field 'Card Number' is required.
The message is misleading: the Card Number is not required. What's actually happening at BlueSnap's end is that the lookup from the HPF token to card details has failed.
In production code, this association between the token and the card details is made from the client using their HPF bluesnap.js. But in the context of a test of server-side code, is there a way to associate the token with some card details?