Интеграция PHP PayuMoney

Это мой почтовый запрос:

address1
address2
amount => 5000
city
country
email => [email protected]
firstname = ankit
furl = http://<SITE_NAME>/respHandler.php
hash = 21673423ca4e2ef5648420c440cf9222f1080dc3c54d19e51286b49459ce0cd29f4f36df6434666f4a2a7951569c57385c7c
e78a93da780ca3210cafb1b3bc61
key =<KEY>
lastname
pg
phone=9999999999
productinfo=Event Ticket Booking
service_provider=payu_paisa
state
surl=http://<SITE_NAME>/respHandler.php
txnid=adc7a7bdfd50478c4fdf
udf1=1
udf2=12
udf3=2
udf4
udf5
zipcode

При отправке этого URL: https://secure.payu.in/_payment

Я получаю эту ошибку:

«Ошибка сети: 500 hphp_invoke — https://secure.payu.in/_payment«

Проблема в том, что он работает, когда сумма равна 10, но выдает ошибку, когда сумма равна 5000.

0

Решение

У меня та же проблема. ниже 5000 это работает. но если сумма больше или равна 5

0

Другие решения

$paymentData['key']=MERCHANT_KEY;
$paymentData['txnid']=$txnid;
$paymentData['amount']=$totalAmount;
$paymentData['firstname']=$this->objSess->userName;
$paymentData['email']=$userEmail;
$paymentData['phone']=$this->objSess->userMobile;
$paymentData['productinfo']=json_encode($productInfo);
$paymentData['surl']=SUCCESS_URL;
$paymentData['furl']=FAIL_URL;
$paymentData['service_provider']='payu_paisa';
$paymentData['lastname']='';
$paymentData['curl']='';
$paymentData['address1']='';
$paymentData['address2']='';
$paymentData['city']='';
$paymentData['state']='';
$paymentData['country']='';
$paymentData['zipcode']='';
$paymentData['udf1']='';
$paymentData['udf2']='';
$paymentData['udf3']='';
$paymentData['udf4']='';

$paymentData['udf5']='';

$paymentData['pg']='';

$hashSequence = 'key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|udf6|udf7|udf8|udf9|udf10';

$hashVarsSeq = explode('|', $hashSequence);
$hash_string = '';
foreach($hashVarsSeq as $hash_var) {
$hash_string .= isset($paymentData[$hash_var]) ? $paymentData[$hash_var] : '';
$hash_string .= '|';
}

$hash_string .= SALT;

$hash = strtolower(hash('sha512', $hash_string));

$code = '
<script>
var hash = "'.$hash.'";
function submitPayuForm() {
if(hash == "") {
return;
}
var payuForm = document.forms.payuForm;
payuForm.submit();
}
</script>
<form action="'.PAYU_BASE_URL.'" method="post" name="payuForm"  >
<input type="hidden" name="key" value="'.MERCHANT_KEY.'" />
<input type="hidden" name="hash" value="'.$hash.'"/>
<input type="hidden" name="txnid" value="'.$txnid.'" />
<input type="hidden" name="amount" value="'.$paymentData['amount'].'" />
<input type="hidden" name="firstname" value="'.$paymentData['firstname'].'" />
<input type="hidden" name="email" value="'.$paymentData['email'].'" />
<input type="hidden" name="phone" value="'.$paymentData['phone'].'" />
<input type="hidden" name="productinfo" value="'. htmlspecialchars($paymentData['productinfo'], ENT_QUOTES, 'UTF-8').'" />
<input type="hidden" name="surl" value="'.$paymentData['surl'].'" />
<input type="hidden" name="furl" value="'.$paymentData['furl'].'" />
<input type="hidden" name="service_provider" value="'.$paymentData['service_provider'].'" />

</form>
';
echo $code;
echo "<script>submitPayuForm();</script>";

Попробуйте этот код

0

//this is how payumoney payment gateway is  implemented in cakephp3

$MERCHANT_KEY = "merhcant key"; //merchant key provided by payumoney

$SALT = "salt"; //salt provided by payumoney

$PAYU_BASE_URL = "test.payu.in";

$txnid = '';

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

$hash = '';

$firstname = $sessionUserInfo['first_name'];

$email = $sessionUserInfo['email'];

$contact_no = $sessionUserInfo['contact_no'];$hashSequence = ($MERCHANT_KEY . "|" . $txnid . "|" . $totalAmount . "|" . $productInfo . "|" . $firstname . "|" . $email . "|||||||||||" . $SALT);
$hash = strtolower(hash("sha512", $hashSequence));//hash Sequence generation formula

$this->set(compact('PAYU_BASE_URL', 'MERCHANT_KEY', 'SALT', 'PAYU_BASE_URL', 'txnid', 'hash', 'productInfo', 'totalAmount'));//write above code in your controller

<form action="<?php echo $PAYU_BASE_URL; ?>/_payment" method="post" name="payuForm">

<?php echo $this->Form->hidden('key', ['name' => 'key', 'value' => $MERCHANT_KEY]); ?>
<?php echo $this->Form->hidden('hash', ['name' => 'hash', 'value' => $hash]); ?>
<?php echo $this->Form->hidden('txnid', ['name' => 'txnid', 'value' => $txnid]); ?>
<?php echo $this->Form->hidden('amount', ['name' => 'amount', 'value' => $totalAmount]); ?>
<?php echo $this->Form->hidden('firstname', ['name' => 'firstname', 'value' => $authUser['first_name']]); ?>
<?php echo $this->Form->hidden('address', ['name' => 'address', 'value' => $authUser['address']]); ?>
<?php echo $this->Form->hidden('email', ['name' => 'email', 'value' => $authUser['email']]); ?>
<?php echo $this->Form->hidden('phone', ['name' => 'phone', 'value' => $authUser['contact_no']]); ?>
<?php echo $this->Form->hidden('productinfo', ['name' => 'productinfo', 'value' => $productInfo]); ?>
<?php echo $this->Form->hidden('surl', ['name' => 'surl', 'value' => SITE_PATH . "Payments/successPayment/"]); ?>
<?php echo $this->Form->hidden('furl', ['name' => 'furl', 'value' => SITE_PATH . "Payments/failUrl/"]); ?>
<?php echo $this->Form->button('Order', array('type' => 'submit', 'class' => 'btn btn-default btn-md round fa fa-arrow-circle-right ml-5', 'name' => 'submit')); ?>

</form>//write above code in your ctp file
0
По вопросам рекламы [email protected]