Authorization header HMAC Example

 All HTTP MobilePay PoS method requests must comply following MobilePay authorization header with HMAC method:POS authorization

 This example is a calculation of the Authorization header based on the ApiKey "1234567890".

Resulting HTTP Authorization header:
Authorization: isGAb6zjnrOmHEj/d7ZE6VTEggY5zQqX7bnJ1/Y0gjc= 1413794400

Request URL: https://localhost:9003/API/V07/PaymentCancel
Content Body: {"POSId":"a123456-b123-c123-d123-e12345678901","LocationId":"88888","MerchantId":"POSDK99999"}
TimeStampUtc: 1413794400

Input to HMAC:
https://localhost:9003/API/V07/PaymentCancel {"POSId":"a123456-b123-c123-d123-e12345678901","LocationId":"88888","MerchantId":"POSDK99999"} 1413794400

You can use this online tool to test how to calculate HMAC:
https://sandprod-posappmock.mobilepay.dk/pos-legacy-appmock-website/hmac

For the textbox on the above test webpage, use:
https://localhost:9003/API/V07/PaymentCancel {"POSId":"a123456-b123-c123-d123-e12345678901","LocationId":"88888","MerchantId":"POSDK99999"} 1413794400

For the Key field (ApiKey), use:
1234567890

Use the button: "Calculate Header HMAC"

The calculation steps are explained in more detail if “Explain calculation” is expanded