" dynamic="no"} Language Libraries | Developer Documentation | 2Checkout

2Checkout Documentation


2Checkout returns both the buyer and a set of sale parameters including any custom parameters to the approved URL when the sale has been completed. The request method in the TwocheckoutReturn class provides a binding to validate the MD5 hash.



Use to validate the MD5 hash.


  • hash Parameters

    • Hash of sale params listed in the example below passed to your Approved URL.
  • string String

    • Your 2Checkout secret word.


  • boolean Boolean
    • Returns result of validating MD5 Hash.

Example Usage:

  post(new Route("/") {
     public Object handle(Request request, Response response) {
         HashMap params = new HashMap();
         params.put("sid", request.queryParams("sid"));
         params.put("total", request.queryParams("total"));
         params.put("order_number", request.queryParams("order_number"));
         params.put("key", request.queryParams("key"));
         Boolean result = TwocheckoutReturn.check(params, "tango");
         if (result == true) {
             return "Success";
         } else {
             return "Fail";