11 $serviceViewFromCUAdmin = (isset($serviceViewFromCUAdmin) ? $serviceViewFromCUAdmin :
false);
12 if (!$serviceViewFromCUAdmin) {
14 $serviceShowInfo =
true;
15 $serviceLoadMenu =
true;
16 $serviceShowMenu =
true;
17 $serviceLiveCheck =
true;
19 require_once(dirname(__FILE__) .
'/../library/hcuService.i');
22 require_once(dirname(__FILE__) .
'/hcuMobilePay.plugin');
23 require_once(dirname(__FILE__) .
'../../../shared/library/cutrusted.i');
29 PermCheckFeatureScreen($dbh, $HB_ENV, $MC, FEATURE_BASIC);
33 $varOk = array(
"mp_token"=>
"string",
"mp_type"=>
"string",
"mpVendor"=>
"string",
"allowp2p"=>
"string");
35 HCU_ImportVars( $inputVars,
"", $varOk );
38 if ( strpos( $inputVars[
'mp_token'],
"=" ) !==
false ||
39 strpos( $inputVars[
'mp_token'],
"+" ) !==
false ) {
41 $decodedToken = $inputVars[
'mp_token'];
42 $encodedToken = urlencode( $inputVars[
'mp_token'] );
44 $encodedToken = $inputVars[
'mp_token'];
45 $decodedToken = urldecode( $inputVars[
'mp_token'] );
48 $commonString = hcu_decrypturl( $decodedToken, $HB_ENV[
'2factorkey']);
50 parse_str( $commonString, $commonParms );
52 $mpType = $inputVars[
"mp_type"];
53 $mpDateModel = $commonParms[
"mpDateModel"];
54 $mobilePayName = $commonParms[
"mpName"];
55 $mpAccount = $commonParms[
"mpAccount"];
56 $mpVendorKey = $commonParms[
"mpVendor"];
57 $mpToken = $commonParms[
"mpToken"];
59 $allowP2P = $commonParms[
"allowp2p"];
61 $userTokens = explode(
"|", $mpToken);
62 $subId = $userTokens[1];
64 $accountTypes = GetBPAccountTypes($HB_ENV[
"MC"]);
65 $p2pTypes = GetBPP2PTypes($HB_ENV[
"MC"]);
68 $extrasString = str_replace(
"|",
"&", $commonParms[
"mpExtras"] );
69 $extrasString = str_replace(
":",
"=", $extrasString );
71 parse_str( $extrasString, $mpExtras );
75 foreach ($mpExtras as $key => $val) {
76 if ( strlen( $extrasString ) > 0 ) $extrasString .=
"|";
77 $extrasString .=
"$key:$val";
80 if (strlen( $mpToken )) {
82 $commonURL =
"mpToken=$mpToken&mpVendor=$mpVendorKey&mpDateModel=$mpDateModel&mpName=$mobilePayName&mpExtras=$extrasString&allowp2p=$allowP2P&mpAccount=$mpAccount";
83 $encryptedCommonURL = hcu_encrypturl( $commonURL, $HB_ENV[
'2factorkey'] );
84 $encodedCommonURL = urlencode( $encryptedCommonURL );
89 require_once(dirname(__FILE__) .
'/../includes/hcuPreContent.i');
115 .k-window-titlebar .k-window-actions {
120 <!--
template for payee grid -->
121 <script
id=
"addPayee" type=
"text/x-kendo-template">
122 <div
id=
"payee-add" class=
"payee-add">
123 <span
class=
"k-icon k-i-plus"></span>
124 <span
class=
"add"><?php echo $MC->msg(
"Add New Payee", HCU_DISPLAY_AS_HTML)?></span>
127 <script
id=
"payeeRow" type=
"text/x-kendo-template">
129 <td
class=
"payee-view">
130 <div
class=
"col-xs-12 payee-name">#: Name# (#: Nickname#)</div>
131 <div
class=
"col-xs-12 payee-date"><?php echo $MC->msg(
"Last Paid", HCU_DISPLAY_AS_HTML)?>: #: kendo.toString(Amount,
"C")# <?php echo $MC->msg(
"on", HCU_DISPLAY_AS_JS) ?> #
if(Date ===
"") {# N/A #}
else {# #=kendo.toString(kendo.parseDate(Date),
"MM/dd/yyyy") # #}#</div>
133 <td
class=
"payee-view">
134 <span
class=
"k-icon k-i-edit k-i-pencil" onclick=
'EditPayee(this)'></span>
135 <span
class=
"k-icon k-i-delete k-i-trash" onclick=
'DeletePayee(this)'</span>
140 <div
id=
"confirmationWindow"></div>
141 <div
id=
"confirmationDeleteTemplate"></div>
142 <div
id=
"buttonWindow" name=
"buttonWindow" style=
"display: none;" class=
"container-fluid">
144 <div
class=
'col-xs-12'>
145 <span
id=
"billPayBtn" class=
"k-button payBtns" style=
"width:100%; height:100%; margin-top: 10px;"><span
class=
"fa fa-credit-card"></span> <?php echo $MC->msg(
"New Bill Payee", HCU_DISPLAY_AS_HTML) ?></span>
149 <div
class=
'col-xs-12'>
150 <span
id=
"extTransBtn" class=
"k-button payBtns" style=
"width:100%; height:100%; margin-top: 10px;"><span
class=
"fa fa-exchange"></span> <?php echo $MC->msg(
"New External Transfer", HCU_DISPLAY_AS_HTML) ?></span>
153 <?php
if($allowP2P ==
'true') : ?>
155 <div
class=
'col-xs-12'>
156 <span
id=
"indPayBtn" class=
"k-button payBtns" style=
"width:100%; height:100%; margin-top: 10px;"><span
class=
"fa fa-user"></span> <?php echo $MC->msg(
"New Indv Payee", HCU_DISPLAY_AS_HTML) ?></span>
161 <!-- Payee Detail -->
162 <div
id=
"detailPayeeTemplate" name=
"detailPayeeTemplate" style=
"display: none;" class=
"container-fluid">
164 <div
class=
"k-content col-xs-12 " >
165 <div
id=
"detailPayeeFormStatus" class=
"homecu-formStatus k-block k-error-colored" style=
"display:none; margin-bottom:10px;"></div>
166 <div
id=
'editErrors'></div>
167 <div
class=
"form-horizontal form-widgets well well-sm">
169 <div
class=
"form-group comp indv">
170 <label
class=
"col-sm-12" for=
"payeeName"><?php echo $MC->msg(
"Payee Name", HCU_DISPLAY_AS_HTML) ?>
171 <span
class=
"hcu-required-field"><sup>*</sup></span></label>
172 <div
class=
"col-sm-12">
173 <input
id=
'payeeName' class=
'k-textbox distinctAcct hcu-all-100' name=
'payeeName' type=
"text" pattern=
"[0-9a-zA-Z .,'-]{1,100}" 174 data-required-msg=
"<?php echo $MC->msg("Payee Name Missing
", HCU_DISPLAY_AS_HTML) ?>" 175 data-bind=
"value: payeeName" 176 validationMessage=
"<?php echo $MC->msg("Payee Name Invalid
", HCU_DISPLAY_AS_HTML) ?>" 180 <!-- Routing Number -->
181 <div
class=
"form-group fininst">
182 <label
class=
"col-sm-12" for=
"routingNum"><?php echo $MC->msg(
"Routing Number", HCU_DISPLAY_AS_HTML) ?><span
class=
"hcu-required-field"><sup>*</sup></span></label>
183 <div
class=
"col-sm-12">
184 <input
id=
'routingNum' class=
'k-textbox distinctAcct hcu-all-100' name=
'routingNum' type=
"text" 185 data-required-msg=
"<?php echo $MC->msg("Routing Number Missing
", HCU_DISPLAY_AS_HTML) ?>" 186 data-bind=
"value: routingNum" 187 validationMessage=
"<?php echo $MC->msg("Routing Number Invalid
", HCU_DISPLAY_AS_HTML) ?>" 191 <!-- Account Number -->
192 <div
class=
"form-group fininst comp ">
193 <label
class=
"col-sm-12" for=
"accountNum"><?php echo $MC->msg(
"Account Number", HCU_DISPLAY_AS_HTML) ?><span
class=
"hcu-required-field"><sup>*</sup></span></label>
194 <div
class=
"col-sm-12">
195 <input
id=
'accountNum' class=
'k-textbox distinctAcct hcu-all-100' name=
'accountNum' type=
"text" 196 data-required-msg=
"<?php echo $MC->msg("Account Number Missing
", HCU_DISPLAY_AS_HTML) ?>" 197 data-bind=
"value: accountNum" 198 validationMessage=
"<?php echo $MC->msg("Account Number Invalid
", HCU_DISPLAY_AS_HTML) ?>" 202 <!-- Account Type -->
203 <div
class=
"form-group fininst">
204 <label
class=
"col-sm-12" for=
"accountType"><?php echo $MC->msg(
"Account Type", HCU_DISPLAY_AS_HTML)?><span
class=
"hcu-required-field"><sup>*</sup></span></label>
205 <div
class=
"col-sm-12">
206 <input
id=
'accountType' class=
'distinctAcct hcu-all-100' name=
'accountType' data-role=
'dropdownlist' 207 data-bind=
"value: accountType" 208 data-required-msg=
"<?php echo $MC->msg("Account Type Missing
", HCU_DISPLAY_AS_HTML)?>" 213 <div
class=
"form-group comp indv">
214 <label
class=
"col-sm-12" for=
"addr1"><?php echo $MC->msg(
"ACH Address", HCU_DISPLAY_AS_HTML) .
" 1"; ?><span
class=
"hcu-required-field"><sup>*</sup></span></label>
215 <div
class=
"col-sm-12">
216 <input
id=
'addr1' class=
'k-textbox distinctAcct hcu-all-100' name=
'addr1' maxlength=
"100" 217 data-required-msg=
"<?php echo $MC->msg("Address Missing
", HCU_DISPLAY_AS_HTML) ?>" 218 data-bind=
"value: addr1" 223 <div
class=
"form-group comp indv">
224 <label
class=
"col-sm-12" for=
"addr1"><?php echo $MC->msg(
"ACH Address", HCU_DISPLAY_AS_HTML) .
" 2"; ?></label>
225 <div
class=
"col-sm-12">
226 <input
id=
'addr2' class=
'k-textbox distinctAcct hcu-all-100' name=
'addr2' maxlength=
"100" 227 data-bind=
"value: addr2" 232 <div
class=
"form-group comp indv">
233 <label
class=
"col-sm-12" for=
"city"><?php echo $MC->msg(
"City", HCU_DISPLAY_AS_HTML)?><span
class=
"hcu-required-field"><sup>*</sup></span></label>
234 <div
class=
"col-sm-12">
235 <input
id=
'city' class=
'k-textbox distinctAcct hcu-all-100' name=
'city' type=
'text' type=
"text" pattern=
"[[0-9a-zA-Z .,'-]{1,100}" 236 data-required-msg=
"<?php echo $MC->msg("City Missing
", HCU_DISPLAY_AS_HTML)?>" 237 data-bind=
"value: city" 238 validationMessage=
"<?php echo $MC->msg("City Invalid
", HCU_DISPLAY_AS_HTML)?>" 243 <div
class=
"form-group comp indv">
244 <label
class=
"col-sm-12" for=
"state"><?php echo $MC->msg(
"State", HCU_DISPLAY_AS_HTML)?><span
class=
"hcu-required-field"><sup>*</sup></span></label>
245 <div
class=
"col-sm-12">
246 <input
id=
'state' class=
'distinctAcct hcu-all-100' name=
'state' data-role=
'dropdownlist' 247 data-bind=
"value: state" 248 data-required-msg=
"<?php echo $MC->msg("State Missing
", HCU_DISPLAY_AS_HTML)?>" 253 <div
class=
"form-group comp indv">
254 <label
class=
"col-sm-12" for=
"zip"><?php echo $MC->msg(
"Zip Code", HCU_DISPLAY_AS_HTML)?><span
class=
"hcu-required-field"><sup>*</sup></span></label>
255 <div
class=
"col-sm-12">
256 <input
id=
'zip' class=
'k-textbox distinctAcct hcu-all-100' name=
'zip' type=
"text" 257 data-bind=
"value: zip" 258 data-required-msg=
'<?php echo $MC->msg("Zip Code Missing", HCU_DISPLAY_AS_HTML)?>' 263 <div
class=
"form-group indv">
264 <label
class=
"col-sm-12" for=
"p2pType"><?php echo $MC->msg(
"P2P Type", HCU_DISPLAY_AS_HTML)?>
265 <span
class=
"hcu-required-field"><sup>*</sup></span>
266 <span
class=
"fa fa-question-circle-o" id=
"p2pTip"></span>
268 <div
class=
"col-sm-12">
269 <input
id=
'p2pType' class=
'distinctAcct hcu-all-100' name=
'p2pType' data-role=
'dropdownlist' 270 data-bind=
"value: p2pType" 271 data-required-msg=
"<?php echo $MC->msg("P2P Type Missing
", HCU_DISPLAY_AS_HTML)?>" 276 <div
class=
"form-group comp indv">
277 <label
class=
"col-sm-12" for=
"phone"><?php echo $MC->msg(
"Phone", HCU_DISPLAY_AS_HTML)?>
278 <span
id=
"phoneSpan" class=
"hcu-required-field"><sup>*</sup></span></label>
279 <div
class=
"col-sm-12">
280 <input
id=
'phone' class=
'k-textbox distinctAcct hcu-all-100' name=
'phone' type=
'tel' 281 data-bind=
"value: phone" 282 data-required-msg=
'<?php echo $MC->msg("Phone Missing", HCU_DISPLAY_AS_HTML)?>' 287 <div
class=
"form-group indv">
288 <label
class=
"col-sm-12" for=
"email"><?php echo $MC->msg(
"Email", HCU_DISPLAY_AS_HTML)?>
289 <span
id=
"emailSpan" class=
"hcu-required-field"><sup>*</sup></span>
290 <span
class=
"fa fa-question-circle-o" id=
"emailTip"></span>
292 <div
class=
"col-sm-12">
293 <input
id=
'email' class=
'k-textbox distinctAcct hcu-all-100' name=
'email' type=
'email' 294 placeholder=
"<?php echo $MC->msg("Email Placeholder
", HCU_DISPLAY_AS_HTML)?>" 295 validationMessage=
"<?php echo $MC->msg("Email appears invalid
", HCU_DISPLAY_AS_HTML)?>" 296 data-required-msg=
"<?php echo $MC->msg("Email Missing
", HCU_DISPLAY_AS_HTML)?>" 297 data-bind=
"value: email" 301 <!-- Name on Account / Subscriber Name -->
302 <div
class=
"form-group comp">
303 <label
class=
"col-sm-12" for=
"subName"><?php echo $MC->msg(
"EXT Name On Account", HCU_DISPLAY_AS_HTML) ?>
304 <span
class=
"hcu-required-field"><sup>*</sup></span>
305 <span
class=
"fa fa-question-circle-o" id=
"subNameTip"></span>
307 <div
class=
"col-sm-12">
308 <input
id=
'subName' class=
'k-textbox distinctAcct hcu-all-100' name=
'subName' type=
"text" pattern=
"[0-9a-zA-Z .,'-]{1,100}" 309 data-required-msg=
"<?php echo $MC->msg("Name On Account Missing
", HCU_DISPLAY_AS_HTML) ?>" 310 data-bind=
"value: subName" 311 validationMessage=
"<?php echo $MC->msg("Name On Account Invalid
", HCU_DISPLAY_AS_HTML) ?>" 316 <div
class=
"form-group comp indv fininst">
317 <label
class=
"col-sm-12" for=
"payFrom"><?php echo $MC->msg(
"Account", HCU_DISPLAY_AS_HTML)?>
318 <span
class=
"hcu-required-field"><sup>*</sup></span></label>
319 <div
class=
"col-sm-12">
320 <input
id=
'payFrom' class=
'distinctAcct hcu-all-100' name=
'payFrom' data-role=
'dropdownlist' 321 data-bind=
"value: accountId" 322 data-required-msg=
"<?php echo $MC->msg("Account is required
", HCU_DISPLAY_AS_HTML)?>" 326 <!-- Payee Nickname -->
327 <div
class=
"form-group comp indv fininst">
328 <label
class=
"col-sm-12" for=
"nickName"><?php echo $MC->msg(
"Payee Nickname", HCU_DISPLAY_AS_HTML)?>
329 <span
id=
"nickSpan" class=
"hcu-required-field"><sup>*</sup></span>
331 <div
class=
"col-sm-12">
332 <input
id=
'nickName' class=
'k-textbox distinctAcct hcu-all-100' name=
'nickName' type=
"text" pattern=
"[0-9a-zA-Z .,'-]{1,100}" 333 data-bind=
"value: nickName" 334 data-required-msg=
"<?php echo $MC->msg("Nickname Missing
", HCU_DISPLAY_AS_HTML)?>" 335 validationMessage=
"<?php echo $MC->msg("Nickname Invalid
", HCU_DISPLAY_AS_HTML)?>" 339 <!-- Shared Secret code or word -->
340 <div
class=
"form-group indv">
341 <label
class=
"col-sm-12" for=
"secret"><?php echo $MC->msg(
"Shared Secret", HCU_DISPLAY_AS_HTML)?>
342 <span
class=
"hcu-required-field"><sup>*</sup></span>
343 <span
class=
"fa fa-question-circle-o" id=
"secretTip"></span>
345 <div
class=
"col-sm-12">
346 <input
id=
'secret' class=
'k-textbox distinctAcct hcu-all-100' name=
'secret' type=
"text" pattern=
"[0-9a-zA-Z .,'-]{1,100}" 347 data-bind=
"value: secret" 348 data-required-msg=
"<?php echo $MC->msg("Secret Missing
", HCU_DISPLAY_AS_HTML)?>" 349 validationMessage=
"<?php echo $MC->msg("Secret Invalid
", HCU_DISPLAY_AS_HTML)?>" 353 <!-- ACTION BUTTONS -->
354 <div
class=
"hcu-template">
355 <div
class=
"hcu-edit-buttons k-state-default">
356 <a href=
"hcuMobilePayPayees.prg?<?php echo $HB_ENV['cuquery'] ?>&mp_token=<?php echo $encodedToken ?>&mp_type=Payees" id=
"lnkCancel" style=
""><?php echo $MC->msg(
"Cancel", HCU_DISPLAY_AS_HTML)?></a>
358 <button
class=
"k-button k-primary" id=
"btnEditPayee"><i
class=
"fa fa-check fa-lg"></i><?php echo $MC->msg(
"Update", HCU_DISPLAY_AS_HTML)?></button>
359 <button
class=
"k-button k-primary" id=
"btnAddPayee"><i
class=
"fa fa-check fa-lg"></i><?php echo $MC->msg(
"Add", HCU_DISPLAY_AS_HTML)?></button>
366 <!-- Grid to show payee list -->
368 <div
class=
"container-fluid">
370 <div
class=
"col-xs-12" style=
"margin: 10px 0px 10px 0px;">
371 <span
class=
"hcu-breadcrumbs"><a href=
'hcuMobilePay.prg?mp_token=<?php echo $encodedCommonURL ?>&<?php echo $HB_ENV['cuquery
'] ?>' class=
"tabReturnBtn"><?php echo $mobilePayName .
" " . $MC->msg(
"Menu", HCU_DISPLAY_AS_HTML) ?></a> / <span
class=
"realname">
372 <?php echo $MC->msg(
"Payees", HCU_DISPLAY_AS_HTML)?></span></span>
375 <div
id=
"formStatusMain" class=
"homecu-formStatus k-block k-error-colored" style=
"display:none; margin: 10px;"></div>
377 <div
class=
"hcu-xs-btn-margin-top text-center" style=
"max-width:800px;">
378 <div
class=
"btn-group" role=
"group" id=
"typeGroupButtonSelect">
379 <button type=
"button" class=
"btn btn-default" ><?php echo $MC->msg(
"Payments", HCU_DISPLAY_AS_HTML)?></button>
380 <button type=
"button" class=
"btn btn-default" ><?php echo $MC->msg(
"Transfers", HCU_DISPLAY_AS_HTML)?></button>
381 <button type=
"button" class=
"btn btn-default active" ><?php echo $MC->msg(
"All", HCU_DISPLAY_AS_HTML)?></button>
386 <div
class=
"col-xs-12" style=
"max-width:800px;">
387 <div
id=
"grid" class=
"hcu-xs-btn-margin-top">
393 <script
id=
"confirmationTemplateAdd" type=
"text/x-kendo-tmpl">
394 <div
id=
"confirmationStatus"></div>
395 <div
id=
"responseDiv">
396 <div
class=
"local-transfer-msg">
397 <?php echo $MC->msg(
'Payee Added', HCU_DISPLAY_AS_JS); ?>
401 <script
id=
"confirmationTemplateEdit" type=
"text/x-kendo-tmpl">
402 <div
id=
"confirmationStatus"></div>
403 <div
id=
"responseDiv">
404 <div
class=
"local-transfer-msg">
405 <?php echo $MC->msg(
'Payee Updated', HCU_DISPLAY_AS_JS); ?>
409 <script
id=
"confirmationTemplateDelete" type=
"text/x-kendo-tmpl">
410 <div
id=
"confirmationStatus"></div>
411 <div
id=
"responseDiv">
412 <div
class=
"local-transfer-msg">
413 <?php echo $MC->msg(
'Payee Deleted', HCU_DISPLAY_AS_JS); ?>
417 <script type=
"text/javascript">
419 var windowStack = [];
420 var dsCUAccounts = [];
421 var dataPayFrom = [];
427 var stateList = <?php echo HCU_JsonEncode( GetBPStateList() ); ?>;
428 var accountTypes = <?php echo HCU_JsonEncode($accountTypes); ?>;
429 var p2pTypes = <?php echo HCU_JsonEncode($p2pTypes); ?>;
430 var subId =
"<?php echo $subId; ?>";
433 function EditPayee(args){
434 var entityGrid = $(
"#grid").data(
"kendoGrid");
435 var tr = $(args).closest(
"tr");
436 currentSelectedRow = entityGrid.dataItem(tr);
439 dsGetAccounts.read();
441 payeeType = currentSelectedRow.Class;
442 payeeId = currentSelectedRow.Id;
444 var request = { mp_type:
"GetPayee", vPayeeId: payeeId };
445 dsPayeeMod.read(request);
447 kendo.bind($(
"#detailPayeeTemplate"), payeeModel);
448 var window = $(
"#detailPayeeTemplate").data(
"kendoWindow");
450 title:
"<?php echo $MC->msg('Edit Payee', HCU_DISPLAY_AS_JS); ?>",
452 $(
"#btnAddPayee").hide();
453 $(
"#btnEditPayee").show();
454 payeeWindow.open().toFront().center();
458 function DeletePayee(args){
459 var entityGrid = $(
"#grid").data(
"kendoGrid");
460 var tr = $(args).closest(
"tr");
461 currentSelectedRow = entityGrid.dataItem(tr);
462 dsGetAccounts.read();
464 payeeType = currentSelectedRow.Class;
465 payeeId = currentSelectedRow.Id;
466 var payeeName = currentSelectedRow.Name;
467 var nickname = currentSelectedRow.Nickname;
470 var request = { mp_type:
"GetPayee", vPayeeId: payeeId };
471 dsPayeeMod.read(request);
472 kendo.bind($(
"#detailPayeeTemplate"), payeeModel);
476 var confirmDeleteDialog = $(
"#confirmationDeleteTemplate").kendoDialog({
477 title:
"<?php echo $MC->msg('Delete', HCU_DISPLAY_AS_JS); ?>",
485 content:
"<?php echo $MC->msg('Delete Payee', HCU_DISPLAY_AS_JS); ?>: " + payeeName +
" (" + nickname +
") ?",
488 text:
"<?php echo $MC->msg('Cancel', HCU_DISPLAY_AS_JS); ?>",
491 text:
"<?php echo $MC->msg('Delete', HCU_DISPLAY_AS_JS); ?>",
493 action:
function(e) {
494 mpType =
"DeletePayee";
497 payeeModel.set(
"delete",
"true");
505 var buttons = $(
'.k-dialog button.k-button');
506 $(buttons).addClass(
'k-state-disabled');
510 windowStack.push(
function(e) {
511 confirmDeleteDialog.close(e);
518 }).data(
"kendoDialog");
520 confirmDeleteDialog.open();
524 function AddPayee (){
525 payeeModel.ResetModel();
526 dsGetAccounts.read();
527 kendo.bind($(
"#detailPayeeTemplate"), payeeModel);
528 var window = $(
"#detailPayeeTemplate").data(
"kendoWindow");
530 title:
"<?php echo $MC->msg('Add Payee', HCU_DISPLAY_AS_JS); ?>",
532 $(
"#btnAddPayee").show();
533 $(
"#btnEditPayee").hide();
534 buttonWindow.open().toFront().center();
538 function ShowHideFields(){
540 if(payeeType ===
'Comp'){
542 $(
".fininst").hide();
546 $(
"#routingNum").attr(
'required',
false);
547 $(
"#accountType").attr(
'required',
false);
548 $(
"#secret").attr(
'required',
false);
549 $(
"#nickName").attr(
'required',
false);
550 $(
"#nickSpan").hide();
551 $(
"#email").attr(
'required',
false);
552 $(
"#p2pType").attr(
'required',
false);
555 $(
"#phone").attr(
'required',
true);
557 }
else if(payeeType ===
'FinInst'){
560 $(
".fininst").show();
563 $(
"#addr1").attr(
'required',
false);
564 $(
"#city").attr(
'required',
false);
565 $(
"#state").attr(
'required',
false);
566 $(
"#zip").attr(
'required',
false);
567 $(
"#phone").attr(
'required',
false);
568 $(
"#subName").attr(
'required',
false);
569 $(
"#payeeName").attr(
'required',
false);
570 $(
"#secret").attr(
'required',
false);
571 $(
"#email").attr(
'required',
false);
572 $(
"#p2pType").attr(
'required',
false);
574 }
else if(payeeType ===
'Indv'){
576 $(
".fininst").hide();
580 $(
"#accountNum").attr(
'required',
false);
581 $(
"#routingNum").attr(
'required',
false);
582 $(
"#accountType").attr(
'required',
false);
583 $(
"#subName").attr(
'required',
false);
588 $(
"#zip").kendoMaskedTextBox({
590 clearPromptChar:
true 594 $(
"#phone").kendoMaskedTextBox({
595 mask:
"(000)000-0000",
596 clearPromptChar:
true 601 "<?php echo $MC->msg("Name On Account Tip
", HCU_DISPLAY_AS_HTML)?>" ,
603 "<?php echo $MC->msg("Shared Secret Tip
", HCU_DISPLAY_AS_HTML)?>" ,
605 "<?php echo $MC->msg("P2P Type Tip
", HCU_DISPLAY_AS_HTML)?>",
607 "<?php echo $MC->msg("Email Tip
", HCU_DISPLAY_AS_HTML)?>" 610 function InitDataSources(){
613 $(
"#state").kendoDropDownList({
614 dataTextField:
"name",
615 dataValueField:
"value",
616 dataSource: stateList,
617 optionLabel: {value:
"", name:
"<?php echo $MC->msg("ACH Select State
", HCU_DISPLAY_AS_JS) ?>"},
621 $(
"#accountType").kendoDropDownList({
622 dataTextField:
"name",
623 dataValueField:
"value",
624 dataSource: accountTypes,
625 optionLabel: {value:
"", name:
"<?php echo $MC->msg("ACH Need remote account type
", HCU_DISPLAY_AS_JS) ?>"},
629 $(
"#p2pType").kendoDropDownList({
630 dataTextField:
"name",
631 dataValueField:
"value",
632 dataSource: p2pTypes,
633 change:
function(e) {
635 var dropdownValue = dropdown.value();
637 if ( dropdownValue ==
"SMS" ) {
638 $(
"#email").attr(
"disabled",
true);
639 $(
"#phone").attr(
"disabled",
false);
640 $(
"#phone").attr(
"required",
true);
641 $(
"#phoneSpan").show();
642 $(
"#emailSpan").hide();
647 $(
"#phone").attr(
"disabled",
true);
648 $(
"#email").attr(
"disabled",
false);
649 $(
"#email").attr(
"required",
true);
650 $(
"#emailSpan").show();
651 $(
"#phoneSpan").hide();
656 optionLabel: {value:
"", name:
"<?php echo $MC->msg("P2P Select
", HCU_DISPLAY_AS_JS) ?>"},
659 dsCUAccounts =
new kendo.data.DataSource ({
663 var accountURL =
"hcuMobilePay.data?cu=<?php echo $HB_ENV['cu']; ?>&mp_token=<?php echo $encodedToken ?>&mp_type=SrcAccounts&<?php echo $HB_ENV['cuquery'] ?>" 666 dsGetAccounts =
new kendo.data.DataSource ({
670 contentType:
'application/x-www-form-urlencoded',
677 requestStart:
function( e ) {
680 requestEnd:
function( e ) {
684 if ( e.response && e.response.homecuErrors )
685 error = e.response.homecuErrors;
686 if ( error && error.length > 0 ) {
688 $.homecuValidator.displayMessage(error, $.homecuValidator.settings.statusError);
695 error:
function( e ) {
696 alert(
"Transport error: " + e.errorThrown);
699 data:
function (response) {
701 var returnData = Array();
703 if (response.homecuData) {
704 dataPayFrom = (response.homecuData.source ? response.homecuData.source : []);
705 dsCUAccounts.data(dataPayFrom);
706 returnData = response.homecuData;
707 }
else if (response.homecuErrors) {
710 throw "Error Parsing Result From Server";
723 $(
"#payFrom").kendoDropDownList({
724 optionLabel: {FromId:
"", Name:
"<?php echo $MC->msg("Select Pay From
", HCU_DISPLAY_AS_JS) ?>"},
725 dataSource: dsCUAccounts,
726 dataTextField:
'Name',
727 dataValueField:
"FromId",
728 valueTemplate:
'#= Name #',
729 template:
'#= Name #',
732 var dropdownValue = dropdown.value();
733 var dropdownText = dropdown.text();
734 payeeModel.set(
"accountId", dropdownValue);
735 payeeModel.set(
"accountName", dropdownText);
739 var crudServiceBaseUrl =
"hcuMobilePay.data?cu=<?php echo $HB_ENV['cu']; ?>&mp_token=<?php echo $encodedToken ?>";
742 dsPayees =
new kendo.data.DataSource({
745 url:
"hcuMobilePay.data?cu=<?php echo $HB_ENV['cu']; ?>&mp_token=<?php echo $encodedToken ?>&mp_type=<?php echo $mpType; ?>&<?php echo $HB_ENV['cuquery'] ?>",
746 contentType:
'application/x-www-form-urlencoded',
757 requestStart:
function( e ) {
760 requestEnd:
function( e ) {
764 if ( e.response && e.response.homecuErrors )
765 error = e.response.homecuErrors;
766 if ( error && error.length > 0 ) {
768 $.homecuValidator.settings.formErrorTitle =
"Error";
769 $.homecuValidator.settings.formStatusField =
"formStatusMain";
770 $.homecuValidator.displayMessage(error, $.homecuValidator.settings.statusError);
777 error:
function( e ) {
778 alert(
"<?php echo $MC->msg("Transport error
", HCU_DISPLAY_AS_JS); ?>: " + e.status );
781 data:
"homecuData.data",
782 total:
function(response) {
783 return $(response.homecuData.data).length;
789 dsPayeeMod =
new kendo.data.DataSource({
794 url: crudServiceBaseUrl,
796 contentType:
"application/x-www-form-urlencoded",
802 parse:
function(response) {
808 requestStart:
function( e ) {
811 requestEnd:
function(e) {
815 if ( e.response && e.response.homecuErrors ){
816 error = e.response.homecuErrors;
818 if ( error && error.length > 0 ) {
820 $.homecuValidator.settings.formErrorTitle =
"Error";
821 if ( mpType ==
"DeletePayee" ) {
822 $.homecuValidator.settings.formStatusField =
"formStatusMain";
824 $.homecuValidator.settings.formStatusField =
"detailPayeeFormStatus";
826 $.homecuValidator.displayMessage(error, $.homecuValidator.settings.statusError);
828 }
else if ( e.response && e.response.homecuData ) {
829 var results = e.response.homecuData;
830 if ( results.data ) {
831 var payeeInfo = results.data;
833 payeeModel.set(
"payeeId", payeeInfo[0].payeeId );
834 payeeModel.set(
"payeeName", payeeInfo[0].payeeName );
835 payeeModel.set(
"nickName", payeeInfo[0].nickName );
836 payeeModel.set(
"addr1", payeeInfo[0].addr1 );
837 payeeModel.set(
"addr2", payeeInfo[0].addr2 );
838 payeeModel.set(
"city", payeeInfo[0].city );
839 payeeModel.set(
"state", payeeInfo[0].state );
840 payeeModel.set(
"zip", payeeInfo[0].zip );
841 payeeModel.set(
"phone", payeeInfo[0].phone );
842 payeeModel.set(
"email", payeeInfo[0].email );
843 payeeModel.set(
"routingNum", payeeInfo[0].routingNum );
844 payeeModel.set(
"accountNum", payeeInfo[0].accountNum );
845 payeeModel.set(
"accountType", payeeInfo[0].accountType );
846 payeeModel.set(
"accountId", payeeInfo[0].accountId );
847 payeeModel.set(
"subName", payeeInfo[0].subName );
848 payeeModel.set(
"secret", payeeInfo[0].secret );
849 payeeModel.set(
"payeeType", payeeInfo[0].payeeType );
850 payeeModel.set(
"p2pType", payeeInfo[0].p2pType );
852 if ( payeeInfo[0].p2pType ==
"SMS" ) {
853 $(
"#email").attr(
"disabled",
true);
854 $(
"#phoneSpan").show();
855 $(
"#emailSpan").hide();
856 payeeModel.set(
"email",
"");
857 }
else if ( payeeInfo[0].p2pType ==
"Email" ) {
858 $(
"#phone").attr(
"disabled",
true);
859 $(
"#phoneSpan").hide();
860 $(
"#emailSpan").show();
861 payeeModel.set(
"phone",
"");
864 payeeModel.set(
"subId", subId);
866 var buttons = $(
'.k-dialog button.k-button');
867 $(buttons).removeClass(
'k-state-disabled');
873 var grid = $(
"#grid").data(
"kendoGrid");
878 error:
function( e ) {
879 alert(
"<?php echo $MC->msg("Transport error
", HCU_DISPLAY_AS_JS); ?>: " + e.status );
884 function InitDataView(){
886 payeeModel = kendo.observable({
913 if ( mpType ==
"DeletePayee" ) {
916 payeeType: this.payeeType,
918 payeeId: this.payeeId,
919 firstName: this.firstName,
920 lastName: this.lastName,
921 payeeName: this.payeeName,
922 accountNum: this.accountNum,
929 subName: this.subName,
930 accountName: this.accountName,
931 accountId: this.accountId,
932 nickName: this.nickName,
934 routingNum: this.routingNum,
935 accountType: this.accountType,
937 p2pType: this.p2pType,
941 dsPayeeMod.read(request);
943 if ( ExtraValidation() ) {
945 payeeType: this.payeeType,
947 payeeId: this.payeeId,
948 firstName: this.firstName,
949 lastName: this.lastName,
950 payeeName: this.payeeName,
951 accountNum: this.accountNum,
958 subName: this.subName,
959 accountName: this.accountName,
960 accountId: this.accountId,
961 nickName: this.nickName,
963 routingNum: this.routingNum,
964 accountType: this.accountType,
966 p2pType: this.p2pType,
970 dsPayeeMod.read(request);
974 ResetModel:
function() {
975 this.
set(
"payeeId",
"" );
976 this.
set(
"payeeType",
"" );
977 this.
set(
"mp_type",
"" );
978 this.
set(
"firstName",
"" );
979 this.
set(
"lastName",
"" );
980 this.
set(
"payeeName",
"" );
981 this.
set(
"accountNum",
"" );
982 this.
set(
"addr1",
"" );
983 this.
set(
"addr2",
"" );
984 this.
set(
"city",
"" );
985 this.
set(
"state",
"" );
986 this.
set(
"zip",
"" );
987 this.
set(
"phone",
"" );
988 this.
set(
"subName",
"" );
989 this.
set(
"accountName",
"" );
990 this.
set(
"accountId",
"" );
991 this.
set(
"nickName",
"" );
992 this.
set(
"subId",
"" );
993 this.
set(
"routingNum",
"" );
994 this.
set(
"accountType",
"" );
995 this.
set(
"secret",
"" );
996 this.
set(
"p2pType",
"" );
997 this.
set(
"email",
"" );
998 this.
set(
"delete",
"false" );
1000 var dropdownlist = $(
"#payFrom").data(
"kendoDropDownList");
1001 dropdownlist.select(0);
1005 kendo.bind($(
"#detailPayeeTemplate"), payeeModel);
1008 $(
"#confirmationWindow").kendoDialog({
1009 title:
"<?php echo $MC->msg('Success', HCU_DISPLAY_AS_JS); ?>",
1019 text:
"<?php echo $MC->msg('Close', HCU_DISPLAY_AS_JS); ?>",
1026 close:
function(e) {
1030 $.homecuValidator.settings.formStatusField =
"formStatus";
1031 $.homecuValidator.settings.formInfoTitle =
"";
1034 window.location =
'hcuMobilePayPayees.prg?mp_token=<?php echo $encodedToken ?>&mp_type=Payees&<?php echo $HB_ENV['cuquery
'] ?>';
1039 function ShowSuccess(){
1040 var confirmationTemplate;
1041 if ( mpType ==
"AddPayee" ){
1042 confirmationTemplate = kendo.template($(
"#confirmationTemplateAdd").html());
1043 }
else if ( mpType ==
"EditPayee" ) {
1044 confirmationTemplate = kendo.template($(
"#confirmationTemplateEdit").html());
1045 }
else if ( mpType ==
"DeletePayee" ) {
1046 confirmationTemplate = kendo.template($(
"#confirmationTemplateDelete").html());
1048 var confirmationDisplay = confirmationTemplate;
1049 $(
"#confirmationWindow").data(
"kendoDialog").content(confirmationDisplay);
1050 $(
"#confirmationWindow").data(
"kendoDialog").open().toFront().center();
1052 payeeModel.ResetModel();
1055 function ExtraValidation(){
1056 var otherErrors = Array();
1058 if (payeeModel.zip !=
"") {
1060 var zipcode = payeeModel.zip;
1061 var zipReplace = zipcode.replace(/_/g,
"");
1062 var zipSplit = zipReplace.split(
"-");
1063 var zipConstruct =
"";
1066 if (zipSplit[0].length < 5) {
1067 $.homecuValidator.displayMessage(
"<?php echo $MC->msg("Zip Code Invalid
", HCU_DISPLAY_AS_JS) ?>", $.homecuValidator.settings.statusError);
1068 otherErrors.push(
"<?php echo $MC->msg("Zip Code Invalid
", HCU_DISPLAY_AS_JS) ?>");
1069 }
else if (zipSplit[1]) {
1070 if (zipSplit[1].length > 0 && zipSplit[1].length < 4) {
1071 $.homecuValidator.displayMessage(
"<?php echo $MC->msg("Zip Code Invalid
", HCU_DISPLAY_AS_JS) ?>", $.homecuValidator.settings.statusError);
1072 otherErrors.push(
"<?php echo $MC->msg("Zip Code Invalid
", HCU_DISPLAY_AS_JS) ?>");
1078 zipConstruct += zipSplit[0] +
"-" + zipSplit[1];
1080 zipConstruct += zipSplit[0];
1082 payeeModel.set(
"zip", zipConstruct);
1086 if (payeeModel.phone !=
"") {
1088 var phoneNumber = payeeModel.phone;
1089 var phoneReplace = phoneNumber.replace(/\(|\)|-|_/g,
"");
1090 if ( phoneReplace.length < 10 ) {
1091 otherErrors.push(
"<?php echo $MC->msg("Phone Invalid
", HCU_DISPLAY_AS_JS) ?>");
1094 payeeModel.set(
"phone", phoneReplace);
1097 $.homecuValidator.validate();
1098 var totalErrors = $.homecuValidator.homecuKendoValidator.errors();
1101 for (var i = 0; i < otherErrors.length; i++) {
1102 if ($.inArray(otherErrors[i], totalErrors) == -1) {
1103 totalErrors.push(otherErrors[i]);
1107 if (totalErrors.length > 0) {
1108 $.homecuValidator.displayMessage(totalErrors, $.homecuValidator.settings.statusError);
1109 $.homecuValidator.homecuValidate =
false;
1111 $.homecuValidator.homecuValidate =
true;
1114 return ( $.homecuValidator.homecuValidate );
1118 buttonWindow = $(
"#buttonWindow").kendoWindow({
1121 title:
"<?php echo $MC->msg('Add Payee', HCU_DISPLAY_AS_JS); ?>",
1125 activate:
function(e) {
1126 windowStack.push(
function(e) {
1127 buttonWindow.close(e);
1129 $(
"#btnDetailClose").click(
function() {
1130 detailWindow.close();
1133 close:
function(e) {
1136 }).data(
"kendoWindow");
1138 payeeWindow = $(
"#detailPayeeTemplate").kendoWindow({
1148 activate:
function(e) {
1149 windowStack.push(
function(e) {
1150 payeeWindow.close(e);
1152 $.homecuValidator.setup({formValidate:
"detailPayeeTemplate",
1153 formErrorTitle:
"<?php echo $MC->msg("Error Occurred
", HCU_DISPLAY_AS_JS) ?>",
1154 formStatusField:
"detailPayeeFormStatus"});
1157 close:
function(e) {
1160 }).data(
"kendoWindow");
1162 var billPayButton = $(
"#billPayBtn"),
1163 extTransButton = $(
"#extTransBtn"),
1164 indPayButton = $(
"#indPayBtn");
1166 billPayButton.click(
function() {
1169 payeeModel.set(
"payeeType", payeeType);
1171 buttonWindow.close();
1172 payeeWindow.open().toFront().center();
1175 extTransButton.click(
function() {
1177 payeeType =
"FinInst";
1178 payeeModel.set(
"payeeType", payeeType);
1180 buttonWindow.close();
1181 payeeWindow.open().toFront().center();
1184 indPayButton.click(
function() {
1187 payeeModel.set(
"payeeType", payeeType);
1189 buttonWindow.close();
1190 payeeWindow.open().toFront().center();
1193 $(
".btn-group > .btn").click(
function(e){
1194 $(
this).addClass(
"active").siblings().removeClass(
"active");
1195 var grid = $(
"#grid").data(
"kendoGrid");
1196 var dataSource = grid.dataSource;
1197 switch($(
'.btn-group > .btn.active').text()) {
1198 case "<?php echo $MC->msg('Payments', HCU_DISPLAY_AS_JS); ?>":
1199 dataSource.filter ({
1205 case "<?php echo $MC->msg('Transfers', HCU_DISPLAY_AS_JS); ?>":
1206 dataSource.filter ({
1213 dataSource.filter ({
1219 $(document).on(
"click",
".k-overlay",
function (e) {
1220 if(windowStack.length > 0) {
1222 var fn = windowStack[windowStack.length - 1];
1227 $(document).ready(
function () {
1228 $.homecuValidator.setup({formErrorTitle:
"<?php echo $MC->msg("Error Occurred
", HCU_DISPLAY_AS_JS) ?>"});
1233 var grid = $(
"#grid").kendoGrid({
1234 dataSource: dsPayees,
1235 toolbar: kendo.template($(
"#addPayee").html()),
1236 rowTemplate: kendo.template($(
"#payeeRow").html()),
1239 alwaysVisible:
false,
1241 pageSizes: [5, 10, 15, 20]
1245 columns: [ {headerAttributes: {style:
"display: none"},attributes:{style:
"border-left-width: 0;"}},
1246 {width:
"100px", headerAttributes: {style:
"display: none"},attributes:{style:
"border-left-width: 0;"}}],
1247 noRecords: {
template:
"<?php echo $MC->msg('No Payees Found', HCU_DISPLAY_AS_JS); ?>"},
1251 grid.find(
".k-grid-toolbar").on(
"click",
".k-i-plus",
function (e) {
1256 grid.find(
".k-grid-toolbar").on(
"click",
".add",
function (e) {
1261 $(
"#btnAddPayee").on(
'click',
function (event) {
1263 mpType =
"AddPayee";
1264 payeeModel.set(
"subId", subId);
1268 $(
"#btnEditPayee").on(
'click',
function (event) {
1270 mpType =
"EditPayee";
1284 require_once(dirname(__FILE__) .
'/../includes/hcuPostContent.i');