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 customer closes the browser before returning to the webshop and the payment cannot be confirmed as paid with payment status query services provided by the payment method provider.
Table 4.12. 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 AUTHCODE. The calculation of the AUTHCODE 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 4.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>
AUTHCODE is calculated from a string which combines Merchant secret, 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 4.16. Example of calculation
Table 4.13. Example of calculation
Combine previous fields:
Lower case letters to upper case: