$key=""; $salt=""; $action = 'https://test.payu.in/_payment'; $html=''; if(strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') == 0){ /* Request Hash ---------------- For hash calculation, you need to generate a string using certain parameters and apply the sha512 algorithm on this string. Please note that you have to use pipe (|) character as delimeter. The parameter order is mentioned below: sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT) Description of each parameter available on html page as well as in PDF. Case 1: If all the udf parameters (udf1-udf5) are posted by the merchant. Then, hash=sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT) Case 2: If only some of the udf parameters are posted and others are not. For example, if udf2 and udf4 are posted and udf1, udf3, udf5 are not. Then, hash=sha512(key|txnid|amount|productinfo|firstname|email||udf2||udf4|||||||SALT) Case 3: If NONE of the udf parameters (udf1-udf5) are posted. Then, hash=sha512(key|txnid|amount|productinfo|firstname|email|||||||||||SALT) In present kit and available PayU plugins UDF5 is used. So the order is - hash=sha512(key|txnid|amount|productinfo|firstname|email|||||udf5||||||SALT) */ //generate hash with mandatory parameters and udf5 $hash=hash('sha512', $key.'|'.$_POST['txnid'].'|'.$_POST['amount'].'|'.$_POST['productinfo'].'|'.$_POST['firstname'].'|'.$_POST['email'].'|||||'.$_POST['udf5'].'||||||'.$salt); $_SESSION['salt'] = $salt; //save salt in session to use during Hash validation in response $html = '
'; } //This function is for dynamically generating callback url to be postd to payment gateway. Payment response will be //posted back to this url. function getCallbackUrl() { $protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; $uri = str_replace('/index.php','/',$_SERVER['REQUEST_URI']); return $protocol . $_SERVER['HTTP_HOST'] . $uri . 'response.php'; } ?> PayUBiz PHP7 Kit

PayUBiz PHP7 Kit

" />