As a partner, in order to request the de-tokenization of a token created by another partner you need:
The authentication is very similar to the merchant one, the header matches the following pattern:
X-Wsse: AuthToken PartnerAPILogin="{partnerLogin}", PasswordDigest="{digest}", Nonce="{b64nonce}", Created="{timestamp}"
Where:
BASE64(BINARY_SHA1(NONCE + TIMESTAMP + PASSPHRASE))
This header can only be used once and must be re-generated on each request.
<?php
function generateHeaders($partnerLogin, $passphrase, $nonce = null, $timestamp = null) {
$nonce = null === $nonce ? md5(rand(), true) : $nonce;
$timestamp = null === $timestamp ? time() : $timestamp;
$digest = base64_encode(sha1($nonce . $timestamp . $passphrase, true));
$b64nonce = base64_encode($nonce);
$header = sprintf('X-Wsse: AuthToken PartnerAPILogin="%s", PasswordDigest="%s", Nonce="%s", Created="%d"',
$partnerLogin, $digest, $b64nonce, $timestamp);
return $header;
}
If called with the following parameters:
<?php
generateHeaders("myPartnerLogin", "myPartnerPassphrase", "my random nonce", 1400000000)
You would expect the following output::
X-Wsse: AuthToken PartnerAPILogin="myPartnerLogin", PasswordDigest="yxag0yx38DPpCDx1Pl8UZnmXANE=", Nonce="bXkgcmFuZG9tIG5vbmNl", Created="1400000000"
This method allows a partner to detokenize a token that was created by a merchant and which he was authorizated to de-tokenize. The response includes a one-time-use redirect URL, to which the user has to be redirected to in order to view the payment method details.
Notes:
URL syntax: | /api/{version}/partner/token/{token.id}/detokenize |
---|---|
Method: | POST |
Name | Type | Details | Mandatory | Description |
---|---|---|---|---|
type | string | TEXT|IMAGE | Y | The returned detokenization type. IMAGE refers to payment method details returned as an image. TEXT is payment method details shown as pure text. Please check which type you are allowed to use. |
viewer | string | max length 100 | Y | Details of the user that will be viewing the detokenized data. |
company_reference | string | max length 100 | Y | The merchant/hotel registration reference (in your system) for whom you are going to detokenize the token. |
{
"type": "IMAGE",
"viewer": "John Doe",
"company_reference": "4242"
}
Name | Type | Mandatory | Description |
---|---|---|---|
class | string | Y | The type of object which is being returned. In this case it will be detokenize. |
redirect_url | string | Y | The url from where to access the detokenized card details. |
{
"class":"detokenize",
"redirect_url":"http:\/\/www.syspay.com\/redirect\/detokenize\/a448bc2a-9d97-11e4-a460-1ed32635ba79"
}