METEORJS:付款集成(Payumoney)校验和失败



我正在播放Meteorjs(Nodejs(。试图将Payumoney集成到Localhost上。我拥有现场证书,并将我的HTTP呼叫转发到:发布URL:https://secure.payu.in/_payment。在控制台上,我将状态代码称为200。我试图打包: 1.JPARKER:加密-SHA256 2. Johnschult:加密sha512

这是我的代码:

var string = key +'|' +txnid+ '|' +amount+'|'+productinfo+'|'+firstname+'|'+email+'|||||||||||'+salt;
var SHA    = CryptoJS.SHA256(string);

也尝试过这样的尝试:

var string = key +'|' +txnid+ '|' +amount+'|'+productinfo+'|'+firstname+'|'+email+'|'+'|'+'|'+'|'+'|'+'|'+'|'+'|'+'|'+'|'+'|'+salt;
    var SHA    = CryptoJS.SHA256(string);
    console.log("SHA :" + SHA);
    this.unblock();
    var payUMoneyInput = {
               "key"              :  key,
               "txnid"            :  txnid,
               "amount"           :  amount,
               "productinfo"      :  productinfo,
               "firstname"        :  firstname,
               "email"            :  email,
               "phone"            :  phone,
               "surl"            "http://localhost:3000/onlinePaymentSuccess",
               "furl"             :  "http://localhost:3000/onlinePaymentSuccess",
               "hash"             :  SHA,
               "service_provider" : "payu_paisa",
          };
    try {
      if (Meteor.isServer) {
        var result = HTTP.call("POST", "https://secure.payu.in/_payment",
                               {params: payUMoneyInput});
        console.log(result);
          return result;
         }else{
           return false;
         }
      }
    } catch (err) {
      console.log('range error');
      console.log(err)
      // Got a network error, time-out or HTTP error in the 400 or 500 range.
      return false;
    }

我的控制台看起来如下:

0427-12:52:44.069(5.5)? SHA :f071c643368745b38f8b41851d6500743190aa79426e931a28ccfd65135d94ed
I20170427-12:52:44.237(5.5)? { statusCode: 200,
I20170427-12:52:44.237(5.5)?   content: '<!DOCTYPE html>n<!--[if lt IE 7 ]> <html lang="en" class="no-js oldie ie6"> <![endif]-->n<!--[if IE 7 ]>    <html lang="en" class="no-js oldie ie7"> <![endif]-->n<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->n<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->nnn<!-- Custom Modernizr build (should always be on the top) -->n<script src="js/modernizr-2.0.6.min.js"></script>n    <script language="javascript">n      document.title = "Transaction Error";n    </script>nn<style>n    body {font-family: 'Arial'}n    .container {width: 960px; margin: 0 auto; padding: 15px 0;}nn    #header {border-bottom: 1px solid #ccc;}n    #content {padding: 100px;}n    #content h1 {font-size: 70px; color: #358DCB; margin-bottom: 0; margin-top: 0; text-align: center}n    #content h2 {font-size: 16px; margin-top: 0; text-align: center}n    #content p {font-size: 14px; margin-top: 30px; line-height: 24px; padding: 0 150px;}nn    #footer {border-top: 1px solid #ddd; font-size: 12px;}n    #footer p {margin-top: 0;}nn    #footer a {text-decoration: underline}n</style>nn<div id="header">n    <div class="container">n        <img src="https://static.payu.in/images/payu_logo.png">n    </div>n</div>n<div id="content" >n    <div class="container">n        <h1>SORRY!</h1>n        <h2>We were unable to process your payment</h2>n            <p style='text-align: center;font-size:13px;'><br>Checksum Failed</p>    </div>nn    </div>nn<div id="footer">n    <div class="container">n        <!--<p style="float:left">&copy; 2015 PayUBiz. All rights reserved.</p>n        <p style="float:right"><a target="_blank" href=https://www.payubiz.in/privacyPolicy >Privacy Policy</a></p>n        <p style="clear:both"></p>-->n        <p style="text-align: center">&copy; 2015 PayUBiz. All rights reserved.</p>n    </div>n</div>nn<script src="js/libs/jquery-custom.min.js"></script>n<!-- <script src="./_js/plugins.js"></script> -->n<script src="js/script.js?version=v2.0.10"></script>nn',
I20170427-12:52:44.237(5.5)?   headers: 
I20170427-12:52:44.238(5.5)?    { date: 'Thu, 27 Apr 2017 07:22:44 GMT',
I20170427-12:52:44.238(5.5)?      'content-type': 'text/html',
I20170427-12:52:44.238(5.5)?      'transfer-encoding': 'chunked',
I20170427-12:52:44.238(5.5)?      connection: 'close',
I20170427-12:52:44.239(5.5)?      vary: 'Accept-Encoding, Accept-Encoding',
I20170427-12:52:44.239(5.5)?      'set-cookie': [ 'PHPSESSID=bpgqhvng7blpk1fltvrohle0j0; path=/; secure' ],
I20170427-12:52:44.239(5.5)?      p3p: 'CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"',
I20170427-12:52:44.239(5.5)?      expires: 'Thu, 19 Nov 1981 08:52:00 GMT',
I20170427-12:52:44.240(5.5)?      'cache-control': 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0',
I20170427-12:52:44.241(5.5)?      pragma: 'no-cache',
I20170427-12:52:44.241(5.5)?      server: 'Payubiz',
I20170427-12:52:44.242(5.5)?      'x-xss-protection': '1; mode=block' },
I20170427-12:52:44.244(5.5)?   data: null }

无法跟踪问题。预先感谢!

根据Payu集成文档和公式,您的哈希应该是:

var sha=sha512(key +'|' +txnid+ '|' +amount+'|'+productinfo+'|'+firstname+'|'+email+'|||||||||||' + salt+'|');
var hash=CryptoJS.enc.Hex.stringify(sha);

最新更新