The state of an unique payment can be checked with a HTML-form.
Webshop developers can implement a button next to an order to allow checking of the state of the payment for any order directly from Paytrail's service. This way the merchant can be sure whether the payment was successfully completed in case the information has not reached the webshop otherwise. This kind of situation can occur for example when the customer's browser crashes before returning to the webshop.
Table 5.17. Form field description
|Variable name||Description||Format||Max length||Required/Optional|
|MERCHANT_ID||Merchant ID is sent to the merchant after registration.||N||11||R|
|ORDER_NUMBER||This is the same order number that was generated in the webshop and sent to the Payment Gateway.||AN||50||R|
|AUTHCODE||The request fingerprint. The calculation of the fingerprint is described later.||AN||32||R|
|VERSION||The current version value is "2".||N||1||R|
|CULTURE||The service is available in Finnish, Swedish and English. The valid values for this field are "fi_FI", "sv_SE" and "en_US".||AN||8||O|
Example 5.15. The state query HTML form
<form action="https://payment.paytrail.com/check-payment" method="post"> <input name="MERCHANT_ID" type="hidden" value="..." /> <input name="ORDER_NUMBER" type="hidden" value="..." /> <input name="AUTHCODE" type="hidden" value="..." /> <input name="VERSION" type="hidden" value="..." /> <input name="CULTURE" type="hidden" value="..." /> <input name="submit" type="submit" value="Check payment state" /> </form>
Hash is calculated from a string which combines Merchant Authentication Code, Merchant ID and order number. All variables are separated by "&". Hash is calculated from this string using MD5, and the result is then transformed to a 32 character hexadecimal string and converted to upper case letters.
Example 5.16. Example of calculation
Table 5.18. Example of calculation
|Merchant Authentication Code||6pKF4jkv97zmqBJ3ZL8gUw5DfT2NMQ|
Combine previous fields:
Lower case letters to upper case: