1<?
if (!defined(
"B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !==
true)
die();?><?
2include(dirname(__FILE__).
"/common.php");
14<table border=
"0" width=
"100%" cellpadding=
"2" cellspacing=
"2">
16 <td
class=
"but2" align=
"center">
23 if (strlen($_POST[
"GetPayRes"]) > 0)
26 $cardnum = preg_replace(
"#[\D]#i",
"", $cardnum);
27 if (strlen($cardnum) <=0 )
28 $strErrorTmp.=
"Please fill in \"Credit Card Number\" field. ";
31 if (strlen($cvv2) <= 0)
36 if ($cardexp1 < 1 || $cardexp1 > 12)
37 $strErrorTmp.=
"Please fill in \"Expiration Date\" field. ";
38 elseif ($cardexp2 < 4 || $cardexp2 > 99)
39 $strErrorTmp.=
"Please fill in \"Expiration Date\" field. ";
42 $cardexp1 = ((strlen($cardexp1) < 2) ?
"0".$cardexp1 : $cardexp1);
43 $cardexp2 = ((strlen($cardexp2) < 2) ?
"0".$cardexp2 : $cardexp2);
47 if (strlen($noc) <= 0)
51 if (strlen($address1) <= 0)
55 if (strlen($zipcode) <= 0)
62 $AMT =
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"SHOULD_PAY"];
63 if (
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"CURRENCY"] !=
"USD")
69 $additor = $additor / 10;
72 while ($AMT_tmp < $AMT)
77 $AMT = str_replace(
",",
".", $AMT);
78 $cardExp = $cardexp1.$cardexp2;
80 $parms =
"ACCT=".urlencode($cardnum);
81 $parms .=
"&CVV2=".urlencode($cvv2);
82 $parms .=
"&AMT=".urlencode($AMT);
83 $parms .=
"&EXPDATE=".urlencode($cardExp);
85 $parms .=
"&PWD=".urlencode(
$PF_PWD);
86 $parms .=
"&TENDER=C";
87 $parms .=
"&TRXTYPE=S";
88 $parms .=
"&USER=".urlencode(
$PF_USER);
89 $parms .=
"&VENDOR=".urlencode(
$PF_USER);
90 $parms .=
"&ZIP=".urlencode($zipcode);
91 $parms .=
"&STREET=".urlencode($address1);
92 $parms .=
"&COMMENT1=".urlencode(
$ORDER_ID);
93 $parms .=
"&COMMENT2=".urlencode(
$GLOBALS[
"SALE_INPUT_PARAMS"][
"ORDER"][
"DATE_INSERT"]);
95 $ret_com =
"$strExePath $PF_HOST $PF_PORT \"$parms\" 30";
100 exec($ret_com, $arOutput, $ret_var);
102 $strOutput = $arOutput[0];
108 "PS_STATUS" => ((
$arResult[
"RESULT"]==0) ?
"Y" :
"N"),
111 "PS_STATUS_MESSAGE" =>
$arResult[
"PNREF"],
112 "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat(
"FULL", LANG)))
132 elseif ($arPaySysRes_tmp[
"RESULT"]==125)
134 $strErrorTmp.=
"Your payment is declined by Fraud Service. Please contact us to make payment. ";
138 $strErrorTmp.=
"Your payment is under review by Fraud Service. We contact you in 48 hours to get more specific information. ";
161 <font
class=
"text" color=
"#009900"><b>
162 Thank you
for purchasing!<br>
170 echo
"<font color=\"#FF0000\"><b>".$strErrorTmp.
"</b></font><br>";
176 <script type=
"text/javascript">
177 function checkFields(frm)
179 if (frm.elements[
'cardnum'].value ==
'')
181 alert(
'Card number missing');
184 if (frm.elements[
'cvv2'].value ==
'')
186 alert(
'CVV2 missing');
190 var now =
new Date();
192 expyear = parseInt(
"20" + frm.elements[
'cardexp2'].value);
193 expmonth = parseInt(
"" + frm.elements[
'cardexp1'].value);
194 curMonth = now.getMonth();
195 if ( (expyear < now.getFullYear()) || ((expyear == now.getFullYear()) && (expmonth <= curMonth)) )
197 alert(
'Incorrect expiration date');
200 if (frm.elements[
'noc'].value ==
'')
202 alert(
'Cardholder name missing');
205 if (frm.elements[
'address1'].value ==
'')
207 alert(
'Cardholder address missing');
210 if (frm.elements[
'zipcode'].value ==
'')
212 alert(
'Cardholder zip code missing');
219 <form onsubmit=
"return checkFields(this)" method=
"post" action=
"">
220 <input type=
"hidden" name=
"CurrentStep" value=
"<?= IntVal($GLOBALS["CurrentStep
"]) ?>">
221 <input type=
"hidden" name=
"ORDER_ID" value=
"<?= $ORDER_ID ?>">
222 <input type=
"hidden" name=
"GetPayRes" value=
"YES">
225 <th><font
class=
"text">Credit&
nbsp;Card&
nbsp;Number</font></th>
226 <td><input
class=
"inputtext" maxlength=
"16" type=
"text" name=
"cardnum" value=
"<?= htmlspecialcharsbx($cardnum) ?>" size=
"35"></td>
229 <th><font
class=
"text">CVV2</font></th>
230 <td><input type=
"text" class=
"inputtext" maxlength=
"4" name=
"cvv2" value=
"<?= htmlspecialcharsbx($cvv2) ?>" size=
"5"></td>
233 <th><font
class=
"text">Expiration&
nbsp;Date&
nbsp;(MM/YY)</font></th>
235 <
select name=
"cardexp1" class=
"inputselect">
238 if (empty($cardexp1)) $cardexp1 =
$curMonth;
239 for (
$i = 1;
$i <= 12;
$i++)
243 <option value=
"<?= $val ?>" <?
if ($cardexp1 ==
$val) echo
"selected=\"selected\"";?>><?=
$val ?></option>
248 <
select name=
"cardexp2" class=
"inputselect">
251 if (empty($cardexp2)) $cardexp2 =
$curYear;
255 $fullYear = 2000 + intval(
$val);
257 <option value=
"<?= $val ?>" <?
if ($cardexp2 ==
$val) echo
"selected";?>><?= $fullYear ?></option>
266 <td><input type=
"text" maxlength=
"250" class=
"inputtext" name=
"noc" value=
"<?echo (strlen($noc) > 0) ? $noc : $noc_def ?>"></td>
270 <td><input type=
"text" size=
"30" maxlength=
"250" class=
"inputtext" name=
"address1" value=
"<?echo (strlen($address1) > 0) ? $address1 : $address1_def ?>"></td>
274 <td><input type=
"text" maxlength=
"10" class=
"inputtext" name=
"zipcode" value=
"<?echo (strlen($zipcode) > 0) ? $zipcode : $zipcode_def ?>"></td>
279 <input type=
"submit" value=
"Proceed" class=
"inputbutton">
static ConvertCurrency($valSum, $curFrom, $curTo, $valDate="")
static GetParamValue($key, $defaultValue=null)
static Update($ID, $arFields, $bDateUpdate=true)
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
for($i=1; $i<=12; $i++) $curYear
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
SaleFormatCurrency($fSum, $strCurrency, $OnlyValue=false, $withoutFormat=false)
const SALE_VALUE_PRECISION
$GLOBALS['_____370096793']