我试图整合payumoney支付网关 . 我有一个页面cart.php,我已经完成了相同的代码:

if(isset($_POST['image-pay']){
 $MERCHANT_KEY = "rjQUPktU";
 $SALT = "e5iIg1jwi8";
 $PAYU_BASE_URL = "https://test.payu.in";

 $action = '';
 $key = $MERCHANT_KEY;
 $txnid = substr(hash('sha256', mt_rand() . microtime()), 0, 20);

 $productinfo = 'photos';
 $firstname = $_POST['firstname'];
 $email = $_POST['email'];
 $phone = $_POST['phone'];
 $success_url = 'http://example.com/checkout/final-success.php';
 $failure_url = 'http://example.com/checkout/failure.php';
 $cancel_url = 'http://example.com/checkout/cancel.php';
 $service_provider = "payu_paisa";
 $hash = '';
 $hasTemp = $key."|".$txnid."|".$amount."|".$productinfo."|".$firstname."|".$email."|||||||||||".$SALT;
 $hash = strtolower(hash('sha512', $hasTemp));

 $action = $PAYU_BASE_URL . '/_payment';
}

<form action="<?php echo $action; ?>" method="post" name="payuForm" id="jps_payuform">
 <input type="hidden" name="key" value="<?php echo $MERCHANT_KEY; ?>" />
 <input type="hidden" name="hash" value="<?php echo $hash; ?>"/>
 <input type="hidden" name="hash_temp" value="<?php echo $hasTemp; ?>"/>
 <input type="hidden" name="txnid" value="<?php echo $txnid; ?>" />
 <input type="hidden" name="amount" value="<?php echo $amount; ?>" />
 <input type="hidden" name="surl" value="<?php echo $success_url; ?>" size="64" />
 <input type="hidden" name="furl" value="<?php echo $failure_url; ?>" size="64" />
 <input type ="hidden" name="curl" value="<?php echo $cancel_url; ?>" />
 <input type="hidden" name="service_provider" value="<?php echo $service_provider; ?>" size="64" />
 <input type="hidden" name="productinfo" value="<?php echo $productinfo; ?>" />
 <input type="hidden" name="udf1" value="<?php echo $numberPics; ?>" />
 <h3 class="att_heading" style="text-align: center;">Your Personal Details</h3>
 <label><span class="required_jps_field">*</span> Mandatory Parameters</b></label>
 <label><span class="required_jps_field">*</span> Name: </label>
 <input name="firstname" class="form-control" value="<?php echo $firstname; ?>" required />
 <label><span class="required_jps_field">*</span> Email:</label>
 <input name="email" id="email" class="form-control" value="<?php echo $email; ?>" required />
 <label><span class="required_jps_field">*</span> Phone: </label>
 <input name="phone" class="form-control" value="<?php echo $phone; ?>" required />
 <input type="submit" class="btn btn-info" name="image-pay" value="Process" />
</form>

它工作正常,但问题是当我使用isset($ _ POST ['image-pay'])函数然后我必须在提交按钮上单击两次然后它重定向payumoney页面,如果我删除此(isset($ _ POST ['图像-pay'])函数然后提交按钮单击工作,但它没有将名称,电子邮件和电话传递给payumoney .

请帮忙告诉我我在哪里做错了?