0

她我想付款,我得到值debosit,姓名,电子邮件,电话号码,之后我集成了 payumoney 支付网关,但它不起作用,我尝试测试MERCHANT_KEY 和 SALT 但我收到这样的错误


抱歉,出现了一些问题。

<div class="row">

<h4>Advance : <i class="fa fa-inr" aria-hidden="true"></i> <?php echo $deposit// 200;?></h4>
<h4>Bed Price : <i class="fa fa-inr" aria-hidden="true"></i> <?php echo $prize;// 500?></h4>
<!-- My convience-->
<h4>MERCHANT_KEY  : <?php echo 'Provide By Payumony like this:'.'U6kiG9D6';?></h4>
<h4>SALT  : <?php echo 'Provide By Payumony like this:'.'j1M89AnRLp';?></h4>
<h4>First Name : <?php echo $name;//raju?></h4>
<h4>Email  :  <?php echo $email;//raju@gmail.com?></h4>
<h4>Mobile  :<?php echo $phonenumber;//9986111122?></h4>
<h4>Product Info  : <?php echo $bed;//bed2?></h4>

<?php
// Merchant key here as provided by Payu
   
$MERCHANT_KEY = "JBZaLc";

// Merchant Salt as provided by Payu

$SALT = "GQs7yium";

// End point - change to https://secure.payu.in for LIVE mode
$PAYU_BASE_URL = "https://test.payu.in";

$action = '';							

$posted = array();
if(!empty($_POST)) {
	//print_r($_POST);
  foreach($_POST as $key => $value) {    
	$posted[$key] = $value; 
	
  }
}

$formError = 0;

if(empty($posted['txnid'])) {
  // Generate random transaction id
  $txnid = substr(hash('sha256', mt_rand() . microtime()), 0, 20);
} else {
  $txnid = $posted['txnid'];
}

/*$email = $_SESSION['login_customer']; 
foreach($_SESSION['ahil_products'] as $val){
	$code = $val['code'];
	$price = $val['price'];
	$qty = $val['qty'];
}*/

$service_provider = 'payu_paisa';
//$amount = $total;
$amount = $deposit;
//$productinfo = 'productinfo';
$productinfo = $bed;
$firstname = $name;

//print_r($amount); exit;

$hash = '';
// Hash Sequence
$hashSequence = "key|txnid|amount|productinfo|firstname|email||||||||||";

if(empty($posted['hash']) && sizeof($posted) > 0) {
  if(
		  empty($posted['key'])
		  || empty($posted['txnid'])
		  || empty($posted['amount'])
		  || empty($posted['phone'])
		  || empty($posted['productinfo'])
		  || empty($posted['firstname'])
		  || empty($posted['email'])
		  || empty($posted['address'])
		  || empty($posted['city'])
		  || empty($posted['state'])
		  || empty($posted['country'])
		  || empty($posted['surl'])
		  || empty($posted['furl'])	
		  || empty($posted['service_provider'])										  
  ) {
	$formError = 1;
  } else {
	//$posted['productinfo'] = json_encode(json_decode('[{"name":"tutionfee","description":"","value":"500","isRequired":"false"},{"name":"developmentfee","description":"monthly tution fee","value":"1500","isRequired":"false"}]'));
	$hashVarsSeq = explode('|', $hashSequence);
	$hash_string = '';	
	foreach($hashVarsSeq as $hash_var) {
	  $hash_string .= isset($posted[$hash_var]) ? $posted[$hash_var] : '';
	  $hash_string .= '|';
	}

	$hash_string .= $SALT;


	$hash = strtolower(hash('sha512', $hash_string));
	$action = $PAYU_BASE_URL . '/_payment';
  }
} elseif(!empty($posted['hash'])) {
  $hash = $posted['hash'];
  $action = $PAYU_BASE_URL . '/_payment';
}
$surl = "http://saipg/success.php";
$furl = "http://saipg/failure.php";
$val = $MERCHANT_KEY."|".$txnid."|".$amount."|".$productinfo."|".$firstname."|".$email."|||||||||||".$SALT;
$hash = strtolower(hash('sha512',$val));
?>
<!--<form role="form" style="margin-top:30px;" method="POST" action="#" >-->		
<form action="https://secure.payu.in/_payment" method="post" name="payuForm">
<input type="hidden" name="key" value="<?php echo $MERCHANT_KEY; ?>" />
<input type="hidden" name="hash" value="<?php echo $hash; ?>"/>
<input type="hidden" name="abc" value="<?php echo $val; ?>"/>
<input type="hidden" name="txnid" value="<?php echo $txnid;?>" />

<input type="hidden" name="amount" value="<?php echo $amount; ?>"/>
<input type="hidden" name="productinfo" value="productinfo"/>
<input type="hidden" name="phone" value="<?php echo $phonenumber; ?>"/>

<input type="hidden" name="firstname" value="<?php echo $name; ?>"/>
<input type="hidden" name="email" value="<?php echo $email; ?>"/>

<input type="hidden" name="service_provider" value="<?php echo $service_provider; ?>">
<input type="hidden" name="surl" value="<?php echo $surl; ?>"/>
<input type="hidden" name="furl" value="<?php echo $furl; ?>"/>				

<!--<span id="finalplace"><img src="images/preloader.GIF" /></span>		-->

<div class="col-md-4">
<button type="submit" class="btn btn-primary">Make Payment</button>
</div>
<br>
<br>
<br>
</form>


</div>

4

1 回答 1

1

将您的商家密钥和盐替换为以下测试帐户:-

商家密钥 - gtKFFx

盐 - eCwWELxi

另外,请注释 $service_provider,因为当您使用 TEST 帐户时,您不需要提供 service_provider。我希望这有帮助。

于 2016-10-21T14:45:20.327 回答