SHA-256
to generate a nonce from the secret, and a deterministic string nonce:{timestamp}
. As this needs to be done in a particular way, you can use the following snippets in your client as a reference:
nonce
from each of these snippets to your backend.
It will then reserve the original clientSecret
and clientTimestamp
it used to generate the nonce, as it will need to be used validate the ephemeral key in step 4 below. The client must not store or reuse the secret or timestamp.
POST
ing to /v0/customers/{customerId}/card_accounts/{cardAccountId}/ephemeral_keys
. The request should contain just the client nonce itself, like so:
client_nonce
is actually from. The responsibility is on your backend to authenticate that the nonce was sent from the right customer to access the right card account.
/v0/customers/{customerId}/card_accounts/{cardAccountId}/ephemeral_keys
will contain just one field, ephemeral_key
, which contains a token that can be used once to reveal the card details. This token expires in 5 minutes.
Here is an example of the response:
Authorization
header as the credential, like so:
clientSecret
and clientTimestamp
used to generate the nonce as query parameters in the requested URL, like so:
ephemeralKey
is associated with the nonce
derived from the same clientSecret
and clientTimestamp
. It will also validate that the ephemeral key has not already been used, and that the key hasn’t expired yet.
This endpoint will return a response similar to the following: