我运营一个网站,我使用ogone自定义付款网关从streamingvideoprovider.com平台(按次付费选项)销售视频。
付款流程还可以,但付款后重定向告诉我“付款验证的时间比预期的要长”。
我如何解决这个问题?如何向买家发送电子邮件(带票)?
我读了api开发人员,据说我必须调用ppv_confirm函数,但我不知道在我的脚本中调用ppv_confirm函数的位置。 你能不能帮我谢谢。
********这是ogone *************的自定义付款表格
<?php
function crypto_rand_secure($min, $max) {
$range = $max - $min;
if ($range < 0) return $min; // not so random...
$log = log($range, 2);
$bytes = (int) ($log / 8) + 1; // length in bytes
$bits = (int) $log + 1; // length in bits
$filter = (int) (1 << $bits) - 1; // set all lower bits to 1
do {
$rnd = hexdec(bin2hex(openssl_random_pseudo_bytes($bytes)));
$rnd = $rnd & $filter; // discard irrelevant bits
} while ($rnd >= $range);
return $min + $rnd;
}
function getToken($length){
$token = "";
$codeAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$codeAlphabet.= "abcdefghijklmnopqrstuvwxyz";
$codeAlphabet.= "0123456789";
for($i=0;$i<$length;$i++){
$token .= $codeAlphabet[crypto_rand_secure(0,strlen($codeAlphabet))];
}
return $token;
}
/* POST VALUES RECEIVED FROM www.streamingvideoprovider.com
$_POST = array (
[item_name] => Video ticket for: PLASTIC SURGERY
[item_number] => 485485
[order_key] => d8193ytvr
[amount] => 15
[quantity] => 1
[return] => http://www.streamingvideoprovider.com/ppv_index.php?l=ppv_order&a=payment_overlay_success
[cancel] => http://www.streamingvideoprovider.com/ppv_index.php?l=ppv_order&a=payment_overlay_cancel
[currency] => EUR
)*/
$ogone_SHA = 'xxxxxxxxxx';
$ogone_PSPID = 'xxxxxxxxxx';
$ogone_ORDERID = getToken(40);
$ogone_AMOUNT = $_POST['amount'];
$ogone_QUANTITY = $_POST['quantity'];
$ogone_AMOUNT = $ogone_AMOUNT*$ogone_QUANTITY;
$ogone_AMOUNT = round($ogone_AMOUNT, 2)*100;
$ogone_CURRENCY = $_POST['currency'];
$ogone_LANGUAGE = 'en_US';
$ogone_ACCEPTURL = $_POST['return'];
$ogone_CANCELURL = $_POST['cancel'];
$ogone_SHASIGN = "ACCEPTURL=$ogone_ACCEPTURL$ogone_SHA".
"AMOUNT=$ogone_AMOUNT$ogone_SHA".
"CANCELURL=$ogone_CANCELURL$ogone_SHA".
"CURRENCY=$ogone_CURRENCY$ogone_SHA".
"LANGUAGE=$ogone_LANGUAGE$ogone_SHA".
"ORDERID=$ogone_ORDERID$ogone_SHA".
"PSPID=$ogone_PSPID$ogone_SHA";
$ogone_SHASIGN = sha1($ogone_SHASIGN);
$ogone_video_name = $_POST['item_name'];
$ogone_video_name = explode(":",$ogone_video_name);
$ogone_video_name = $ogone_video_name[1];
?>
<form method="post" action="https://secure.ogone.com/ncol/prod/orderstandard.asp" id=form1 name=form1>
<!-- paramètres généraux : voir Paramètres de formulaire -->
<input type="hidden" name="PSPID" value="<?php echo $ogone_PSPID;?>">
<input type="hidden" name="ORDERID" value="<?php echo $ogone_ORDERID;?>">
<input type="hidden" name="AMOUNT" value="<?php echo $ogone_AMOUNT;?>">
<input type="hidden" name="CURRENCY" value="<?php echo $ogone_CURRENCY;?>">
<input type="hidden" name="LANGUAGE" value="<?php echo $ogone_LANGUAGE;?>">
<input type="hidden" name="CN" value=""> <!-- Le nom du client (facultatif) -->
<input type="hidden" name="EMAIL" value=""> <!-- L’adresse électronique du client (facultatif) -->
<input type="hidden" name="OWNERZIP" value=""> <!-- Le code postal du client (facultatif) -->
<input type="hidden" name="OWNERADDRESS" value=""> <!-- L’adresse du client (facultatif) -->
<input type="hidden" name="OWNERCTY" value=""> <!-- Le pays du client (facultatif) -->
<input type="hidden" name="OWNERTOWN" value=""> <!-- Nom de la ville du client (facultatif) -->
<input type="hidden" name="OWNERTELNO" value=""> <!-- Le numéro de téléphone du client (facultatif) -->
<!-- vérification avant le paiement : voir Sécurité : vérification avant le paiement (facultatif) -->
<input type="hidden" name="SHASIGN" value="<?php echo $ogone_SHASIGN;?>">
<!-- apparence et impression: voir Apparence de la page de paiement -->
<input type="hidden" name="TITLE" value="">
<input type="hidden" name="BGCOLOR" value="">
<input type="hidden" name="TXTCOLOR" value="">
<input type="hidden" name="TBLBGCOLOR" value="">
<input type="hidden" name="TBLTXTCOLOR" value="">
<input type="hidden" name="BUTTONBGCOLOR" value="">
<input type="hidden" name="BUTTONTXTCOLOR" value="">
<input type="hidden" name="LOGO" value="">
<input type="hidden" name="FONTTYPE" value="">
<!-- redirection après la transaction : voir Feedback au client sur la transaction -->
<input type="hidden" name="ACCEPTURL" value="<?php echo $ogone_ACCEPTURL;?>">
<input type="hidden" name="DECLINEURL" value="">
<input type="hidden" name="EXCEPTIONURL" value="">
<input type="hidden" name="CANCELURL" value="<?php echo $ogone_CANCELURL;?>">
<div class="userpro-section userpro-column userpro-collapsible-1 userpro-collapsed-0"><span><i class="userpro-icon-angle-down"></i></span>Video Details</div>
<div class='userpro-field userpro-field-first_name ' data-key='first_name'>
<div class='userpro-label iconed'><label for='first_name-501'>Video Name</label><div class=''></div></div>
<div class='userpro-input'>
<b style='color:#090569 !important;font-size: 13px;font-weight:bold'><?php echo $ogone_video_name;?></b>
<div class='userpro-clear'></div></div></div><div class='userpro-clear'>
</div>
<div class='userpro-field userpro-field-first_name ' data-key='first_name'>
<div class='userpro-label iconed'><label for='first_name-501'>Video Price</label><div class=''></div></div>
<div class='userpro-input'>
<b style='color:#090569 !important;font-size: 13px;font-weight:bold'><?php echo round(number_format(intval($ogone_AMOUNT)/100.00,2),2) . " " . $ogone_CURRENCY ;?></b>
<div class='userpro-clear'></div></div></div><div class='userpro-clear'>
</div>
<div class="userpro-clear"></div>
<div class="userpro-field userpro-submit userpro-column">
<div class="userpro-social-connect"></div><div class="userpro-clear"></div>
<input type="submit" value="Buy" class="userpro-button" id='ogone-buy'>
<div class="userpro-clear"></div>
</div>
<form>
付款后,我得到了错误。这是错误的图片
谢谢。