Addition 1. An example of signature forming for XML-interfaces

$SignAlg = 'sha256';

$SignKey = 'VerySecretKey';

$UnsignedXML = '<?xml version="1.0" encoding="UTF-8"?>

<Command>

<LMI_PAYMENT_NO>39702</LMI_PAYMENT_NO>

<LMI_MERCHANT_ID>100</LMI_MERCHANT_ID>

<LMI_HASH></LMI_HASH>

</Command>';

$Sign = hash($SignAlg, $UnsignedXML.$SignKey);

$RequestXML = str_replace('<LMI_HASH></LMI_HASH>', '<LMI_HASH>'.$Sign.'</LMI_HASH>', $UnsignedXML);

As a result of forming and substitution of the signature outcoming XML-request looks like this:

<?xml version="1.0" encoding="UTF-8"?>

<Command>

<LMI_PAYMENT_NO>39702</LMI_PAYMENT_NO>

<LMI_MERCHANT_ID>100</LMI_MERCHANT_ID>

<LMI_HASH>8aef7557df723c985ba0b5394024fef106216043293bda5b42d467dc3359030d</LMI_HASH>

</Command>

results matching ""

    No results matching ""