26 function _HasTransferNotify( $pDbh, $pCu ) {
29 $sqlSelect =
"SELECT email 31 WHERE cu = '{$pCu}' AND role = 'transfernotify'";
33 $sqlSelectRs = db_query( $sqlSelect, $pDbh );
35 $sqlEmail = db_fetch_array( $sqlSelectRs, 0 );
36 db_free_result( $sqlSelectRs );
38 $hasEmail = strlen( trim( $sqlEmail[
"email"] ) ) > 0;
66 function PerformTransfer( $pHBEnv, $pInputVars, $pMC ) {
67 $retStatusAry = Array(
68 'status' => Array(
'code'=>
'000',
'errors' => Array()),
75 $dbh = $pHBEnv[
"dbh"];
78 $sourceParts = isset( $pInputVars[
'txFromSuffix'] ) ? explode(
"|", $pInputVars[
'txFromSuffix'] ) : array();
79 $destParts = isset( $pInputVars[
"txToSuffix"] ) ? explode(
"|", $pInputVars[
"txToSuffix"] ) : array();
82 if ( (isset( $sourceParts[0] ) && $sourceParts[0] ===
"X") ||
83 (isset( $destParts[0] ) && $destParts[0] ===
"X") ) {
84 $transferFeatureCode = FEATURE_EXTERNAL_TRANSFERS;
85 }
else if ( isset( $destParts[0] ) && $destParts[0] ===
"M" ) {
86 $transferFeatureCode = FEATURE_M2M_TRANSFERS;
88 $transferFeatureCode = FEATURE_TRANSFERS;
92 $errorMessage = array();
95 if ( $pHBEnv[
'Fset'] & GetFlagsetValue(
"CU_MAILTXNS") ) {
97 $hasTransferNotify = _HasTransferNotify( $dbh, $pHBEnv[
"Cu"] );
99 if ( !$hasTransferNotify ) {
100 throw new Exception ( $pMC->msg(
'Option not set', HCU_DISPLAY_AS_RAW) );
105 $permissionInputs = array(
"feature" => $transferFeatureCode );
106 $limits = Perm_GetValidationLimits( $dbh, $pHBEnv, $permissionInputs );
108 if ( $limits ===
false ) {
112 $allowedAmount = floatval( $limits[
"amount_per_transaction"] );
116 if (!HCU_array_key_exists(
'txFrequency', $pInputVars) || $pInputVars[
'txFrequency'] ==
"") {
117 $pInputVars[
'txFrequency'] =
"OneTime";
123 if (!HCU_array_key_exists(
'txDateStart', $pInputVars) || $pInputVars[
'txDateStart'] ===
null) {
126 $pInputVars[
'txDateStart'] = date(
"m/d/Y");
132 if (!HCU_array_key_exists(
'txDateEnd', $pInputVars) || $pInputVars[
'txDateEnd'] ===
null) {
135 $pInputVars[
'txDateEnd'] = date(
"m/d/Y");
138 if ( (date(
"Ymd", strtotime($pInputVars[
'txDateStart'])) <= date(
"Ymd")) &&
139 ($pInputVars[
'txFrequency'] ==
"OneTime") ) {
141 $pInputVars[
'txOption'] =
"Immediate";
143 $pInputVars[
'txOption'] =
"Future";
148 $txScheduledAllowed = (($pHBEnv[
'flagset2'] & GetFlagsetValue(
"CU2_PROCRECUR")) === GetFlagsetValue(
"CU2_PROCRECUR"));
154 if (!$txScheduledAllowed || $pInputVars[
'txOption'] ===
"Immediate") {
157 $txValidateTransfer = ValidateTransfer( $pHBEnv, $dbh, $pMC, $pInputVars );
159 if ( $txValidateTransfer[
'status'][
'code'] !==
"000" ) {
162 for ( $i = 0; $i < count( $txValidateTransfer[
"status"][
"errors"] ); $i++ ) {
163 $errorMessage[] = $txValidateTransfer[
"status"][
"errors"][$i][
"message"];
167 $retStatusAry[
"status"][
"code"] =
"999";
168 $retStatusAry[
"status"][
"errors"] = $errorMessage;
170 return $retStatusAry;
173 $htmlTransferAmount = $pInputVars[
'txAmount'];
175 if ( $htmlTransferAmount > $allowedAmount ) {
177 throw new Exception ( $pMC->msg(
'Perm Limit - Request over authorized limit', HCU_DISPLAY_AS_HTML) );
181 $permissionInputs = array(
"feature" => $transferFeatureCode );
182 $permissionInputs[
"amount"] = $htmlTransferAmount;
193 if ($transferFeatureCode == FEATURE_EXTERNAL_TRANSFERS) {
195 if ($sourceParts[0] ==
"X") {
196 $permissionInputs[
"account"] = $destParts[1];
197 $permissionInputs[
"accounttype"] = $destParts[2];
199 $permissionInputs[
"account"] = $sourceParts[1];
200 $permissionInputs[
"accounttype"] = $sourceParts[2];
203 $permissionInputs[
"account"] = $sourceParts[1];
204 $permissionInputs[
"accounttype"] = $sourceParts[2];
207 $return = Perm_CheckLimits( $dbh, $pHBEnv, $permissionInputs );
208 if ( !$return || ($return[
"status"][
"code"] !==
"000") ) {
210 $errorMessage = Perm_GetLimitErrDesc($pMC, $return[
"status"][
"code"]);
211 throw new Exception ( $errorMessage );
214 db_work( $dbh, HOMECU_WORK_BEGIN);
217 $submitTransferResult = SubmitTransfer( $dbh, $pHBEnv, $pMC, $txValidateTransfer[
'data'], $aryTransferResults );
220 if ( $submitTransferResult ===
false || ($aryTransferResults[
"status"][
"code"] !=
"000") ) {
222 if ( strlen( $submitTransferResult[
"status"][
"errors"] ) > 0 ) {
223 $errorMessage[] = $submitTransferResult[
"status"][
"errors"];
225 $errorMessage[] = $pMC->msg(
"Transfer Error", HCU_DISPLAY_AS_HTML);
230 if ( count( $errorMessage ) > 0 ) {
231 if ($pInputVars[
'txFrequency'] !=
'OneTime') {
234 $errorMessage[] = $pMC->msg(
"Repeating Transfer not saved", HCU_DISPLAY_AS_RAW);
238 $retStatusAry[
"status"][
"code"] =
"999";
239 $retStatusAry[
"status"][
"errors"] = $errorMessage;
241 return $retStatusAry;
245 $confirmationRequired = Perm_CheckConfirmReq($dbh, $pHBEnv, $permissionInputs);
246 if (!$confirmationRequired) {
248 $entryId = $aryTransferResults[
"txn"][
"trans_id"];
250 if ( !ApproveTransfer( $dbh, $pHBEnv, $pMC, $entryId, $aryApprovalResults ) ) {
251 throw new Exception ( $pMC->msg(
"Trans approval failure", HCU_DISPLAY_AS_HTML) );
256 $aryTransferResults[
'txn'][
'data_confirm'] = $aryApprovalResults[
'status'][
'confirm'];
259 if ( $transferFeatureCode == FEATURE_TRANSFERS ||
260 $transferFeatureCode == FEATURE_M2M_TRANSFERS ) {
262 if ( !ProcessTransfer( $dbh, $pHBEnv, $pMC, $entryId, $aryProcessResults ) ) {
263 $errorMessage[] = $pMC->msg(
"Trans processing failure", HCU_DISPLAY_AS_HTML);
265 if ( count( $aryProcessResults[
"status"][
"errors"] ) > 0 ) {
266 for ( $i = 0; $i < count( $aryProcessResults[
"status"][
"errors"] ); $i++ ) {
267 $errorMessage[] = $aryProcessResults[
"status"][
"errors"][$i];
272 $retStatusAry[
"status"][
"code"] =
"999";
273 $retStatusAry[
"status"][
"errors"] = $errorMessage;
281 if (HCU_array_key_exists(
'trans_id', $aryTransferResults[
'txn'])) {
282 RevertTransferAndAddCUCoreRequest($aryTransferResults[
'txn'][
'trans_id'],
287 return $retStatusAry;
292 $aryTransferResults[
'txn'][
'data_confirm'] = $aryProcessResults[
'txn'][
'data_confirm'];
296 $retStatusAry[
"data"][
'posted'] = $pMC->msg(
"Transfer submitted for confirmation", HCU_DISPLAY_AS_RAW);
299 db_work($dbh, HOMECU_WORK_COMMIT);
302 $retStatusAry[
"data"][
"txn"] = $aryTransferResults[
"txn"];
308 if ($txScheduledAllowed) {
318 if (count($retStatusAry[
"status"][
"errors"]) === 0) {
323 $txIsInterval = ($pInputVars[
'txFrequency'] !=
"" && $pInputVars[
'txFrequency'] !=
"OneTime");
324 $txIsFuture = ($pInputVars[
'txOption'] !=
"" && $pInputVars[
'txOption'] ==
"Future");
325 if ($txIsInterval || $txIsFuture) {
331 $permissionScheduled = array(
"feature" => FEATURE_SCHEDULED_TRANSFERS );
334 $accessRights = Perm_AccessRights( $dbh, $pHBEnv, $permissionScheduled );
335 if ( !HCU_array_key_value(
"access", $accessRights ) ) {
336 $retStatusAry[
"data"][
'repeat'][] = $pMC->msg(
'Rights not set', HCU_DISPLAY_AS_HTML);
339 $txValidateTransfer = ValidateTransfer($pHBEnv, $dbh, $pMC, $pInputVars);
341 if ($txValidateTransfer[
'status'][
'code'] ===
"000") {
343 $htmlTransferAmount = $txValidateTransfer[
'data'][
'txAmount'];
345 if ( $htmlTransferAmount > $allowedAmount ) {
347 throw new Exception ( $pMC->msg(
'Perm Limit - Request over authorized limit', HCU_DISPLAY_AS_HTML) );
350 $txScheduleValues = array(
351 "txDateStart" => $txValidateTransfer[
'data'][
'txDateStart'],
352 "txDateEnd" => $txValidateTransfer[
'data'][
'txDateEnd'],
353 "txFrequency" => $txValidateTransfer[
'data'][
'txFrequency'],
354 "txFrequencyCount" => $txValidateTransfer[
'data'][
'txFrequencyCount'],
355 "txParameters" => TxnSchedParameters($txValidateTransfer[
'data']),
356 "txData" => TxnSchedData($txValidateTransfer[
'data']),
357 "txFeature" => $transferFeatureCode
361 $txCreateSchedule = TxnSchedCreate($pHBEnv, $dbh, $pMC, $txScheduleValues);
364 if ($txCreateSchedule[
'status'][
'code'] !==
"000") {
367 $retStatusAry[
"data"][
'repeat'] = $txCreateSchedule[
'status'][
'errors'];
369 $retStatusAry[
"data"][
'repeat'] = $pMC->msg(
'Repeating transfer scheduled', HCU_DISPLAY_AS_RAW) .
".";
373 $retStatusAry[
"status"][
"code"] =
"999";
374 $retStatusAry[
"status"][
"errors"] = $txValidateTransfer[
'status'][
'errors'];
376 return $retStatusAry;
382 }
catch(Exception $ex) {
384 db_work($dbh, HOMECU_WORK_ROLLBACK);
387 $retStatusAry[
"status"][
"code"] =
"999";
388 $retStatusAry[
"status"][
"errors"] = $ex->getMessage();
392 if ( is_array( $retStatusAry[
"status"][
"errors"] ) ) {
393 if ( count( $retStatusAry[
"status"][
"errors"] ) > 0 ) {
394 $retStatusAry[
"status"][
"code"] =
"999";
396 }
else if ( strlen( $retStatusAry[
"status"][
"errors"] ) > 0 ) {
397 $retStatusAry[
"status"][
"code"] =
"999";
400 return $retStatusAry;
416 function RevertTransferAndAddCUCoreRequest($transferId, $dbh, $Cu) {
417 $cu = trim(strtolower($Cu));
420 $transHdrTbl = $cu .
"transhdr";
421 $transDtlTbl = $cu .
"transdtl";
424 $sqlDeleteDtlHdr =
"DELETE from ${transDtlTbl}".
425 " WHERE transhdr_id=${transferId};".
426 " DELETE from ${transHdrTbl}".
427 " WHERE id=${transferId};";
429 $sqlDeleteDtlHdrRs = db_query($sqlDeleteDtlHdr, $dbh);
431 if (!$sqlDeleteDtlHdrRs) {
432 throw new Exception(
"Reverting transfer failed on core request failure.");
437 db_work($dbh, HOMECU_WORK_COMMIT);
439 }
catch (Exception $ex) {
466 function PerformTransferScheduled( $pHBEnv, $pInputVars, $pMC ) {
467 $retStatusAry = Array(
468 'status' => Array(
'code'=>
'000',
'errors' => Array()),
475 $dbh = $pHBEnv[
"dbh"];
478 $sourceParts = isset( $pInputVars[
'txFromSuffix'] ) ? explode(
"|", $pInputVars[
'txFromSuffix'] ) : array();
479 $destParts = isset( $pInputVars[
"txToSuffix"] ) ? explode(
"|", $pInputVars[
"txToSuffix"] ) : array();
482 if ( (isset( $sourceParts[0] ) && $sourceParts[0] ===
"X") ||
483 (isset( $destParts[0] ) && $destParts[0] ===
"X") ) {
484 $transferFeatureCode = FEATURE_EXTERNAL_TRANSFERS;
485 }
else if ( isset( $destParts[0] ) && $destParts[0] ===
"M" ) {
486 $transferFeatureCode = FEATURE_M2M_TRANSFERS;
487 }
else if ( (isset( $sourceParts[0] ) && $sourceParts[0] ===
"AC") ) {
488 $transferFeatureCode = FEATURE_ACH_COLLECTIONS;
489 }
else if ( (isset( $destParts[0] ) && $destParts[0] ===
"AP") ) {
490 $transferFeatureCode = FEATURE_ACH_PAYMENTS;
492 $transferFeatureCode = FEATURE_TRANSFERS;
496 $hasTransferNotify = _HasTransferNotify( $dbh, $pHBEnv[
"Cu"] );
498 if ( !$hasTransferNotify ) {
499 throw new Exception ( $pMC->msg(
'Option not set', HCU_DISPLAY_AS_RAW) );
503 $txScheduledAllowed = (($pHBEnv[
'flagset2'] & GetFlagsetValue(
"CU2_PROCRECUR")) === GetFlagsetValue(
"CU2_PROCRECUR"));
505 if (!$txScheduledAllowed) {
507 throw new Exception ( $pMC->msg(
'Option not set', HCU_DISPLAY_AS_RAW) );
514 $permissionInputs = array(
"feature" => FEATURE_SCHEDULED_TRANSFERS );
516 if (!PermCheckFeatureScreen($dbh, $pHBEnv, $pMC, $permissionInputs[
"feature"],
'',
false)) {
517 throw new Exception ( $pMC->msg(
'Rights not set', HCU_DISPLAY_AS_RAW) );
521 $permissionInputs = array (
"feature" => $transferFeatureCode );
522 $limits = Perm_GetValidationLimits( $dbh, $pHBEnv, $permissionInputs );
524 if ( $limits ===
false ) {
528 $allowedAmount = intval( $limits[
"amount_per_transaction"]);
531 if ($pInputVars[
'action'] ==
"readSchedule") {
532 $txScheduleData = TxnSchedRead($pHBEnv, $dbh, $pMC);
535 if ($txScheduleData[
'status'][
'code'] !==
"000") {
536 $retStatusAry[
"status"][
"errors"] = $txScheduleData[
'status'][
'errors'];
539 $txDateStart = mktime(0,0,0, date(
"m"), date(
"d") + 1);
540 $txDateEnd = mktime(0,0,0, date(
"m") + 12, date(
"d") + 2);
541 $txScheduleDates = GetCalendarData($pHBEnv, $pMC,
542 $txScheduleData[
'data'],
543 date(
"m/d/Y", $txDateStart),
544 date(
"m/d/Y", $txDateEnd));
546 $retStatusAry[
"data"][
'scheduleItems'] = $txScheduleDates[
'valid'];
547 $retStatusAry[
"data"][
'scheduleDates'] = $txScheduleDates[
'dates'];
548 $retStatusAry[
"data"][
'scheduleOccur'] = $txScheduleDates[
'occur'];
550 }
else if ($pInputVars[
'action'] ==
"deleteSchedule") {
551 $txDeleteTransfer = TxnSchedDelete($pHBEnv, $dbh, $pMC, $pInputVars);
553 if ($txDeleteTransfer[
'status'][
'code'] !==
"000") {
556 $retStatusAry[
"status"][
"errors"] = $txDeleteTransfer[
'status'][
'errors'];
558 $retStatusAry[
'info'][
'repeat'] = $pMC->msg(
'Transfer Delete', HCU_DISPLAY_AS_RAW) .
".";
561 $pInputVars[
'txOption'] =
"Future";
566 $txValidateTransfer = ValidateTransfer($pHBEnv, $dbh, $pMC, $pInputVars,
true);
568 if ($txValidateTransfer[
'status'][
'code'] !==
"000") {
569 $retStatusAry[
"status"][
"code"] =
"999";
570 $retStatusAry[
"status"][
"errors"] = $txValidateTransfer[
'status'][
'errors'];
572 return $retStatusAry;
576 $htmlTransferAmount = $txValidateTransfer[
'data'][
'txAmount'];
578 if ( $htmlTransferAmount > $allowedAmount ) {
580 throw new Exception ( $pMC->msg(
'Perm Limit - Request over authorized limit', HCU_DISPLAY_AS_HTML) );
583 $txScheduleTransfer =
null;
584 $txScheduleTransferInfo =
"";
587 $txScheduleValues = array(
588 "txDateStart" => $txValidateTransfer[
'data'][
'txDateStart'],
589 "txDateEnd" => $txValidateTransfer[
'data'][
'txDateEnd'],
590 "txFrequency" => $txValidateTransfer[
'data'][
'txFrequency'],
591 "txFrequencyCount" => $txValidateTransfer[
'data'][
'txFrequencyCount'],
592 "txParameters" => TxnSchedParameters($txValidateTransfer[
'data'])
596 if ($pInputVars[
'action'] ==
'skipSchedule') {
597 $txId = intval($pInputVars[
'txId']);
598 $changeList = array($txId);
599 $changeList = HCU_JsonEncode($changeList);
600 $txSkipSchedule = SkipTrans($dbh, $pHBEnv[
"Cu"], $pHBEnv[
'Uid'], $changeList, $pMC);
602 if ($txSkipSchedule[
'status'] !==
"000") {
603 throw new Exception($MC->msg(
"Skip Transaction Error", HCU_DISPLAY_AS_RAW), $txSkipSchedule[
'status']);
605 $txScheduleTransferInfo = $txSkipSchedule[
'info'];
606 }
else if ($pInputVars[
'action'] ==
"createSchedule") {
608 $txScheduleValues[
'txData'] = TxnSchedData( $txValidateTransfer[
'data'] );
609 $txScheduleValues[
'txFeature'] = $transferFeatureCode;
612 $txScheduleTransfer = TxnSchedCreate($pHBEnv, $dbh, $pMC, $txScheduleValues);
614 if ($txScheduleTransfer[
'status'][
'code'] !==
"000") {
615 throw new Exception( $pMC->msg(
"Transfer Save Error", HCU_DISPLAY_AS_RAW) );
618 $txScheduleTransferInfo = $pMC->msg(
'Scheduled transfer was saved', HCU_DISPLAY_AS_RAW) .
".";
619 }
else if ($pInputVars[
'action'] ==
"updateSchedule") {
620 $txScheduleValues[
'txId'] = $txValidateTransfer[
'data'][
'txId'];
621 $txScheduleValues[
'txStatus'] = $txValidateTransfer[
'data'][
'txStatus'];
625 $txDataCurrent = FindTransactionData($dbh, $txValidateTransfer[
'data'][
'txId']);
632 $txDataUpdated = HCU_JsonDecode($txDataCurrent[
'txn_data']);
633 $txDataUpdated[
'txn'][
'amount'] = $txValidateTransfer[
'data'][
'txAmount'];
639 $txDataParameters = HCU_JsonDecode($txDataCurrent[
'repeating_parameters']);
641 if ($txDataParameters[
'interval'] !== $txScheduleValues[
'txFrequency']) {
642 $txScheduleValues[
'txFrequencyCount'] = 0;
644 $txScheduleValues[
'txParameters'] = $txDataCurrent[
'repeating_parameters'];
649 if (strtotime($txDataCurrent[
'start_date']) !== strtotime($txScheduleValues[
'txDateStart'])) {
650 $txScheduleValues[
'txFrequencyCount'] = 0;
652 $txScheduleValues[
'txDateStart'] = $txDataCurrent[
'start_date'];
656 $txScheduleValues[
'txData'] = HCU_JsonEncode($txDataUpdated);
657 $txScheduleValues[
'txFeature'] = $txDataCurrent[
'feature_code'];
658 $txScheduleTransfer = TxnSchedUpdate($pHBEnv, $dbh, $pMC, $txScheduleValues);
660 if ($txScheduleTransfer[
'status'][
'code'] !==
"000") {
661 throw new Exception( $pMC->msg(
"Transfer Save Error", HCU_DISPLAY_AS_RAW) );
664 $txScheduleTransferInfo = $pMC->msg(
'Repeating transfer scheduled', HCU_DISPLAY_AS_RAW) .
".";
667 $retStatusAry[
'info'][
'repeat'] = $txScheduleTransferInfo;
669 }
catch(Exception $ex) {
672 $retStatusAry[
"status"][
"code"] =
"999";
673 $retStatusAry[
"status"][
"errors"] = $ex->getMessage();
677 if ( count( $retStatusAry[
"status"][
"errors"] > 0 ) ) {
678 $retStatusAry[
"status"][
"code"] =
"999";
681 return $retStatusAry;
720 function ValidateTransfer($pEnv, $pDbh, $pMC, $pValues, $pShowZeroBalance =
false) {
726 $retStatusAry = Array(
727 'status' => Array(
'code'=>
'000',
'errors' => Array()),
734 $retDataRow = array();
737 $txFromMember = isset($pValues[
'txFromMember']) ? $pValues[
'txFromMember'] :
null;
738 $txFromSuffix = isset($pValues[
'txFromSuffix']) ? $pValues[
'txFromSuffix'] :
null;
740 $txToMember = isset($pValues[
'txToMember']) ? $pValues[
'txToMember'] :
null;
741 $txToSuffix = isset($pValues[
'txToSuffix']) ? $pValues[
'txToSuffix'] :
null;
743 $txMemAccount = isset($pValues[
'txMemAccount']) ? $pValues[
'txMemAccount'] :
null;
744 $txMemName = isset($pValues[
'txMemName']) ? $pValues[
'txMemName'] :
null;
745 $txMemType = isset($pValues[
'txMemType']) ? $pValues[
'txMemType'] :
null;
746 $txCode = isset($pValues[
'txCode']) ? $pValues[
'txCode'] :
null;
747 $txAmount = isset($pValues[
'txAmount']) ? $pValues[
'txAmount'] :
null;
748 $txMemo = isset($pValues[
'txMemo']) ? $pValues[
'txMemo'] :
null;
749 $txFrequency = isset($pValues[
'txFrequency']) ? $pValues[
'txFrequency'] :
null;
750 $txFrequencyCount = isset($pValues[
'txFrequencyCount']) ? $pValues[
'txFrequencyCount'] : 0;
751 $txContinue = isset($pValues[
'txContinue']) ? $pValues[
'txContinue'] :
null;
752 $txDateStart = isset($pValues[
'txDateStart']) ? $pValues[
'txDateStart'] :
null;
753 $txDateEnd = isset($pValues[
'txDateEnd']) ? $pValues[
'txDateEnd'] :
null;
754 $txStatus = isset($pValues[
'txStatus']) ? $pValues[
'txStatus'] :
null;
755 $txPmtComment = isset($pValues[
'paymentComment']) ? $pValues[
'paymentComment'] :
null;
756 $txFeatureCode = isset($pValues[
'feature_code']) ? $pValues[
'feature_code'] :
null;
758 $txDeposit = isset($pValues[
'txDeposit']) ? $pValues[
'txDeposit'] :
null;
761 $txFromAcctSuffix =
"";
762 $txToAcctSuffix =
"";
765 if ( strlen( trim( $txFeatureCode ) ) == 0 ) {
766 $retStatusAry[
'status'][
'code'] =
"999";
767 $retStatusAry[
'status'][
'errors'][] = array(
768 "id" =>
"txFeatureCode",
769 "message" => $pMC->msg(
"Unknown feature type", HCU_DISPLAY_AS_RAW)
772 return $retStatusAry;
780 $isExtFromTrans = substr($txFromSuffix, 0, 1) ==
'X';
781 $isExtToTrans = substr($txToSuffix, 0, 1) ==
'X';
784 $txAcctList = TX_list($pDbh, $pEnv,
"", $pShowZeroBalance);
785 setFmsgTxCookie($pEnv, $txAcctList);
790 $txId = (isset($pValues[
'txId']) ? $pValues[
'txId'] : 0);
797 if ($pValues[
'txFromSuffix'] === $pValues[
'txToSuffix']) {
798 $retStatusAry[
'status'][
'errors'][] = array(
800 "message" => $pMC->msg(
'From account cannot be same', HCU_DISPLAY_AS_RAW)
805 $txToAcctParts = explode(
"|", $txToSuffix);
806 $txFromAcctParts = explode(
"|", $txFromSuffix);
809 if (is_array($txAcctList[
'acctlist'])) {
811 if (HCU_array_key_exists($pValues[
'txFromSuffix'], $txAcctList[
'acctlist'])) {
813 if (($isExtToTrans && $txAcctList[
'acctlist'][$pValues[
'txFromSuffix']][
'from_ext'] !==
"Y")
814 || (!$isExtFromTrans && $txAcctList[
'acctlist'][$pValues[
'txFromSuffix']][
'from_int'] !==
"Y")) {
823 $retStatusAry[
'status'][
'errors'][] = array(
825 "message" => $pMC->msg(
'Perm Limit - Not Authorized', HCU_DISPLAY_AS_RAW)
830 $txFromInfo = $txAcctList[
'acctlist'][$pValues[
'txFromSuffix']];
831 $txFromAcctSuffix = $txFromInfo[
'suffix'];
832 $txFromType = $txFromInfo[
'acctclass'];
834 if ($txFromType ==
"X") {
838 $txFromMember = $txFromInfo[
'member'];
842 if ( $txFromInfo[
"from"] !=
'Y' ) {
843 $retStatusAry[
'status'][
'errors'][] = array(
845 "message" => $pMC->msg(
'From invalid', HCU_DISPLAY_AS_RAW)
851 $retStatusAry[
'status'][
'errors'][] = array(
853 "message" => $pMC->msg(
'Account Type Missing', HCU_DISPLAY_AS_RAW)
859 if ( !($txToAcctParts[0] ===
"M" && $txToAcctParts[2] ===
"0") ) {
862 if (HCU_array_key_exists($pValues[
'txToSuffix'], $txAcctList[
'acctlist'])) {
864 $txToInfo = $txAcctList[
"acctlist"][$pValues[
'txToSuffix']];
867 if (($pEnv[
"flagset3"] & GetFlagsetValue(
"CU3_DISALLOW_MULT_ACCOUNTS_TRANSFER")) != 0) {
868 $relevantTypes = array(
"D",
"L");
869 if ($txFromInfo[
'member'] != $txToInfo[
"member"] && in_array($txFromInfo[
"acctclass"], $relevantTypes) && in_array($txToInfo[
"acctclass"], $relevantTypes)) {
872 if (HCU_array_key_exists($txFromInfo[
'member'], $txAcctList[
"xacctlist"])
873 && HCU_array_key_exists($pValues[
"txToSuffix"], $txAcctList[
"xacctlist"][$txFromInfo[
'member']])) {
874 $xaTxToInfo = $txAcctList[
"xacctlist"][$txFromInfo[
'member']][$pValues[
"txToSuffix"]];
876 if ($txFromInfo[
'member'] != $xaTxToInfo[
"member"] && in_array($txFromInfo[
"acctclass"], $relevantTypes)
877 && in_array($xaTxToInfo[
"acctclass"], $relevantTypes)) {
878 $retStatusAry[
'status'][
'errors'][] = array(
880 "message" => $pMC->msg(
'Transfers between accounts are prohibited', HCU_DISPLAY_AS_RAW)
884 $txToInfo = $xaTxToInfo;
887 $retStatusAry[
'status'][
'errors'][] = array(
889 "message" => $pMC->msg(
'Transfers between accounts are prohibited', HCU_DISPLAY_AS_RAW)
895 if (($isExtFromTrans && $txToInfo[
'to_ext'] !==
"Y")
896 || (!$isExtToTrans && $txToInfo[
'to_int'] !==
"Y")) {
905 $retStatusAry[
'status'][
'errors'][] = array(
907 "message" => $pMC->msg(
'Perm Limit - Not Authorized', HCU_DISPLAY_AS_RAW)
911 $txToAcctSuffix = $txToInfo[
'suffix'];
912 $txToType = $txToInfo[
'acctclass'];
914 $txTrust = $txToInfo[
'trust'];
916 $txToMember = $txToInfo[
'member'];
918 if ( $txToInfo[
"to"] !=
'Y' ) {
919 $retStatusAry[
'status'][
'errors'][] = array(
921 "message" => $pMC->msg(
'To invalid', HCU_DISPLAY_AS_RAW)
927 if ( $txFromType ==
"X" && $txToType ==
"X" ||
928 $txFromType ==
"X" && $txToType ==
"M" ||
929 $txFromType ==
"X" && $txToType ==
"O" ) {
931 $retStatusAry[
'status'][
'errors'][] = array(
933 "message" => $pMC->msg(
'Transfer Error external', HCU_DISPLAY_AS_RAW)
939 $retStatusAry[
'status'][
'errors'][] = array(
941 "message" => $pMC->msg(
'Account Type Not Found To Account', HCU_DISPLAY_AS_RAW)
947 if ( $txFromAcctParts[0] ==
"L" && $txToType ==
"X" ){
949 $retStatusAry[
'status'][
'errors'][] = array(
951 "message" => $pMC->msg(
'Transfer Error loan to external', HCU_DISPLAY_AS_RAW)
958 if ( $txFromAcctParts[0] ==
"L" && $txToType ==
"M" ) {
960 $retStatusAry[
'status'][
'errors'][] = array(
962 "message" => $pMC->msg(
'Transfer Error external', HCU_DISPLAY_AS_RAW)
968 if ($txToAcctParts[0] ===
"M" && $txToAcctParts[2] ===
"0") {
970 $txMemAccount = str_replace(
'_',
'', $txMemAccount);
971 $txMemAccount = trim($txMemAccount);
973 "dfi_account" => $txMemAccount,
974 "name_on_account" => $txMemName
978 if (trim($member[
'dfi_account']) ===
"") {
979 throw new Exception($pMC->msg(
"ACH Validation DFI Account"));
983 if (trim($member[
'name_on_account']) ===
"") {
984 throw new Exception($pMC->msg($pMC->msg(
"ACH Validation Name", HCU_DISPLAY_AS_HTML)));
988 if (!(intval($pValues[
'txMemType']) === ACCOUNT_TYPE_CHECKING || intval($pValues[
'txMemType']) === ACCOUNT_TYPE_SAVINGS)) {
989 throw new Exception($pMC->msg(
"ACH Validation DFI Type"));
994 if (count($retStatusAry[
'status'][
'errors']) === 0) {
995 if (!_ConfirmM2MAccount($pEnv, $member)) {
996 throw new Exception($pMC->msg(
"M2M Account Not Found", HCU_DISPLAY_AS_HTML));
1001 $txToInfo = array(
"acctclass" =>
"M" );
1003 }
catch (Exception $e) {
1004 $retStatusAry[
'status'][
'errors'][] = array(
1006 "message" => $e->getMessage()
1012 $retStatusAry[
'status'][
'errors'][] = array(
1014 "message" => $pMC->msg(
'Error Occurred During Transfer Processing', HCU_DISPLAY_AS_RAW)
1020 if (count($retStatusAry[
'status'][
'errors']) === 0) {
1023 $txAllowed = Get_HaveTrans($pDbh, $pEnv);
1024 $txCode = FindTransactionCode($txFromInfo, $txToInfo, $txAllowed);
1027 if ($txCode ==
"") {
1029 $retStatusAry[
'status'][
'errors'][] = array(
1031 "message" => $pMC->msg(
'Transfer Error', HCU_DISPLAY_AS_RAW)
1035 }
else if ( $txFromAcctParts[0] ===
"L" && $txCode ==
"MM" 1036 && $txToAcctParts[0] ===
"M" ) {
1038 $txError = $pMC->msg(
'Transfer Error M2M', HCU_DISPLAY_AS_RAW);
1041 }
else if ( ($txFrequency !=
"OneTime") && (($txCode ==
"LA")) ) {
1043 $txError = $pMC->msg(
'Repeating transfer not available', HCU_DISPLAY_AS_RAW);
1046 }
else if ( ($txFrequency !=
"OneTime" ||
1047 date(
"Ymd", strtotime($txDateStart)) != date(
"Ymd")) &&
1048 (($txToAcctParts[0] ===
"M" && $txToAcctParts[2] ===
"0") || ($txCode ==
"OT") || ($txCode ==
"CW")) ) {
1049 $txError = $pMC->msg(
'Repeating transfer not available', HCU_DISPLAY_AS_RAW);
1052 if (trim($txFromMember) == trim($txToMember) && $txCode ==
"AT" && !HCU_array_key_value(
'AT', $txAllowed)) {
1053 $txError = $pMC->msg(
'Transfer Deposit Not Allowed', HCU_DISPLAY_AS_RAW);
1055 if (trim($txFromMember) == trim($txToMember) && $txCode ==
"LP" && !HCU_array_key_value(
'LP', $txAllowed)) {
1056 $txError = $pMC->msg(
'Transfer Loan Not Allowed', HCU_DISPLAY_AS_RAW);
1060 if (trim($txFromMember) != trim($txToMember) && $txCode ==
"XA" && !HCU_array_key_value(
'XA', $txAllowed)) {
1061 $txError = $pMC->msg(
'Transfer Cross Deposit Not Allowed', HCU_DISPLAY_AS_RAW);
1063 if (trim($txFromMember) != trim($txToMember) && $txCode ==
"XP" && !HCU_array_key_value(
'XP', $txAllowed)) {
1064 $txError = $pMC->msg(
'Transfer Cross Loan Not Allowed', HCU_DISPLAY_AS_RAW);
1069 if ($txError !==
"") {
1070 $retStatusAry[
'status'][
'errors'][] = array(
1072 "message" => $txError
1079 $txToInfo[
'trust'] =
'';
1082 if (count($retStatusAry[
'status'][
'errors']) === 0) {
1084 if ( floatval( $txAmount ) <= 0 ) {
1085 $retStatusAry[
'status'][
'errors'][] = array(
1087 "message" => $pMC->msg(
'Amount Missing', HCU_DISPLAY_AS_RAW)
1093 if (count($retStatusAry[
'status'][
'errors']) === 0) {
1094 if ( !empty( $pValues[
"txOption"] ) && ($pValues[
"txOption"] ==
"Immediate") ) {
1096 if ( $txFromInfo[
"available"] < floatval( $txAmount) ) {
1097 $retStatusAry[
'status'][
'errors'][] = array(
1098 "id" =>
"txFrequency",
1099 "message" => $pMC->msg(
'Transfer exceeds', HCU_DISPLAY_AS_RAW)
1105 if (count($retStatusAry[
'status'][
'errors']) === 0) {
1107 $transferFrequencyList = TxIntervalList($pEnv[
"MC"]);
1109 if (!FindFrequencyValue($transferFrequencyList, $pValues[
'txFrequency'])) {
1110 $retStatusAry[
'status'][
'errors'][] = array(
1111 "id" =>
"txFrequency",
1112 "message" => $pMC->msg(
'Transfer Invalid Interval', HCU_DISPLAY_AS_RAW)
1117 if (count($retStatusAry[
'status'][
'errors']) === 0) {
1119 if (!validateDate($txDateStart)) {
1120 if ($txFrequency ==
"OneTime") {
1121 $retStatusAry[
'status'][
'errors'][] = array(
1122 "id" =>
"txDateStart",
1123 "message" => $pMC->msg(
'Transfer On', HCU_DISPLAY_AS_RAW) .
" " . $pMC->msg(
'is not a valid date', HCU_DISPLAY_AS_RAW)
1126 $retStatusAry[
'status'][
'errors'][] = array(
1127 "id" =>
"txDateStart",
1128 "message" => $pMC->msg(
'Start Date', HCU_DISPLAY_AS_RAW) .
" " . $pMC->msg(
'is not a valid date', HCU_DISPLAY_AS_RAW)
1134 if (count($retStatusAry[
'status'][
'errors']) === 0) {
1136 $startTime = strtotime($pValues[
'txDateStart']);
1137 $endTime = strtotime($pValues[
'txDateEnd']);
1138 $nextTime = TxNextInterval(
1142 $nextTime = strtotime($nextTime);
1144 if ($txFrequency ==
"OneTime") {
1146 }
else if ($txContinue ==
"continuous") {
1149 if (!validateDate($pValues[
'txDateEnd'])) {
1150 $retStatusAry[
'status'][
'errors'][] = array(
1151 "id" =>
"txDateStart",
1152 "message" => $pMC->msg(
'Stop Date', HCU_DISPLAY_AS_RAW) .
" " . $pMC->msg(
'is not a valid date', HCU_DISPLAY_AS_RAW)
1154 }
else if ($endTime < $nextTime) {
1155 $retStatusAry[
'status'][
'errors'][] = array(
1156 "id" =>
"txDateEnd",
1157 "message" => $pMC->msg(
'Continue Until greater than next', HCU_DISPLAY_AS_RAW)
1159 }
else if ($endTime < $startTime) {
1160 $retStatusAry[
'status'][
'errors'][] = array(
1161 "id" =>
"txDateEnd",
1162 "message" => $pMC->msg(
'Continue until greater than start', HCU_DISPLAY_AS_RAW)
1165 $txDateEnd = $pValues[
'txDateEnd'];
1171 $retDataRow[
"txFeatureCode"] = trim($txFeatureCode);
1172 $retDataRow[
'txId'] = intval($txId);
1173 $retDataRow[
'txFromMember'] = trim($txFromMember);
1174 $retDataRow[
'txFromSuffix'] = trim($txFromAcctSuffix);
1175 $retDataRow[
'txFromType'] = trim($txFromType);
1176 $retDataRow[
'txFromAcctId'] = trim($txFromSuffix);
1177 $retDataRow[
'txToMember'] = trim($txToMember);
1178 $retDataRow[
'txToSuffix'] = trim($txToAcctSuffix);
1179 $retDataRow[
'txToType'] = trim($txToType);
1180 $retDataRow[
'txToAcctId'] = trim($txToSuffix);
1181 $retDataRow[
'txMemAccount'] = trim($txMemAccount);
1182 $retDataRow[
'txMemName'] = trim($txMemName);
1183 $retDataRow[
'txMemType'] = intval($txMemType);
1184 $retDataRow[
'txCode'] = trim($txCode);
1185 $retDataRow[
'txAmount'] = floatval($txAmount);
1186 $retDataRow[
'txMemo'] = trim($txMemo);
1187 $retDataRow[
'txPmtComment'] = trim($txPmtComment);
1188 $retDataRow[
'txFrequency'] = trim($txFrequency);
1189 $retDataRow[
'txFrequencyCount'] = trim($txFrequencyCount);
1190 $retDataRow[
'txDateStart'] = trim($txDateStart);
1191 $retDataRow[
'txDateEnd'] = trim($txDateEnd);
1192 $retDataRow[
'txContinue'] = ($txContinue ==
"continuous" ? 1 : 0);
1193 $retDataRow[
'txStatus'] = trim($txStatus);
1194 $retDataRow[
"txTrust"] = $txToInfo[
"trust"];
1196 if (count($retStatusAry[
'status'][
'errors']) == 0) {
1197 $retStatusAry[
'data'] = $retDataRow;
1198 $retStatusAry[
'data'][
'txlist'] = $txAcctList;
1200 $retStatusAry[
'status'][
'code'] =
"999";
1203 return $retStatusAry;
1219 function FindTransactionCode($fromAcctInfo, $toAcctInfo, $cuTransSupport) {
1226 $transferFromAcctToTypes =
"";
1227 if (HCU_array_key_exists(
'acctclass', $fromAcctInfo) && HCU_array_key_exists(
'acctclass', $toAcctInfo)) {
1228 $transferFromAcctToTypes = $fromAcctInfo[
'acctclass'] .
'|' . $toAcctInfo[
'acctclass'];
1231 $transferToSuffix = HCU_array_key_value(
"suffix", $toAcctInfo);
1233 switch($transferFromAcctToTypes) {
1235 if (HCU_array_key_value(
'trust', $toAcctInfo) ==
"transfer") {
1237 $retTranCode =
'XA';
1239 $retTranCode =
'AT';
1243 if (HCU_array_key_value(
'trust', $toAcctInfo) ==
"transfer") {
1245 $retTranCode =
'XP';
1247 $retTranCode =
'LP';
1252 $retTranCode =
'LA';
1255 $retTranCode = ($cuTransSupport[
'CC'] ?
'CP' :
'LP');
1266 $retTranCode =
'LA';
1274 $retTranCode =
"OT";
1277 if ($transferToSuffix ==
"CW") {
1283 $retTranCode =
"CW";
1289 $retTranCode =
"OT";
1295 $retTranCode =
"1W";
1300 $retTranCode =
"2W";
1304 $retTranCode =
"MM";
1308 return $retTranCode;
1323 function FindFrequencyValue($freqArray, $valueToFind) {
1324 $valueFound = False;
1326 if (count($freqArray) > 0) {
1327 foreach ($freqArray as $freqIdx => $freqVal) {
1328 if ($freqVal[
'value'] === $valueToFind) {
1365 function SubmitTransfer( $pDbh, &$pHBEnv, $pMC, $pPostVariables, &$pResults ) {
1367 $sourceParts = explode(
"|", $pPostVariables[
"txFromAcctId"] );
1368 $destParts = explode(
"|", $pPostVariables[
"txToAcctId"] );
1372 if ( $sourceParts[0] ==
"X" ) {
1373 $recordType = $destParts[0];
1374 $account = $destParts[1];
1375 $accountType = $destParts[2];
1376 }
else if ( $destParts[0] ==
"X" || $destParts[0] ==
"M" ) {
1377 $recordType = $sourceParts[0];
1378 $account = $sourceParts[1];
1379 $accountType = $sourceParts[2];
1381 $recordType = $sourceParts[0];
1382 $account = $sourceParts[1];
1383 $accountType = $sourceParts[2];
1386 $htmlTransferComment =
"";
1387 if ( $destParts[0] ==
'O' && substr($destParts[2], 0, 1 ) ==
"P" ) {
1389 $htmlTransferComment = $pPostVariables[
'txPmtComment'];
1391 $htmlTransferComment = $pPostVariables[
'txMemo'];
1395 $txFromInfo = array(
"acctclass" => $sourceParts[0] );
1396 $txToInfo = array(
"acctclass" => $destParts[0] );
1397 $txAllowed = Get_HaveTrans( $pDbh, $pHBEnv );
1404 $txCode = HCU_array_key_value(
"txCode", $pPostVariables);
1407 if ( $txCode ==
"" ) {
1408 throw new Exception( $pMC->msg(
'Transfer Error external', HCU_DISPLAY_AS_RAW) );
1411 if ( $sourceParts[0] ==
"X" || $destParts[0] ==
"X" ) {
1413 $externalAccountId = ( $sourceParts[0] ==
"X" ) ? $sourceParts[2] : $destParts[2];
1414 $referenceId = $externalAccountId;
1416 $rdfiData = GetRemoteAccountInfo( $pDbh, $pHBEnv, $externalAccountId );
1419 if ( $rdfiData ===
"" ) {
1420 throw new Exception( $pMC->msg(
'EXT Acct Status Error', HCU_DISPLAY_AS_RAW) );
1424 $rdfiData[
"rdfi"][
"addenda"] =
"";
1428 if ( $sourceParts[0] ==
"X" ) {
1430 $rdfiData[
"rdfi"][
"rdfi_txn_type"] =
"DB";
1431 $sourceAccountInfo = $rdfiData;
1432 $destAccountInfo = $pPostVariables[
"txToAcctId"];
1434 if ($pPostVariables[
'txToType'] ==
"D") {
1435 $destKey[
'accountnumber'] = $pPostVariables[
'txToMember'];
1436 $destKey[
'recordtype'] = $pPostVariables[
'txToType'];
1437 $destKey[
'accounttype'] = $pPostVariables[
'txToSuffix'];
1438 $destKey[
'certnumber'] = $destParts[3];
1439 }
else if ($pPostVariables[
'txToType'] ==
"L" || $pPostVariables[
'txToType'] ==
"C") {
1440 $destKey[
'accountnumber'] = $pPostVariables[
'txToMember'];
1441 $destKey[
'recordtype'] = $pPostVariables[
'txToType'];
1442 $destKey[
'loannumber'] = $pPostVariables[
'txToSuffix'];
1446 $rdfiData[
"rdfi"][
"rdfi_txn_type"] =
"CR";
1447 $destAccountInfo = $rdfiData;
1448 $sourceAccountInfo = $pPostVariables[
"txFromAcctId"];
1449 $sourceKey = array();
1450 if ($pPostVariables[
'txFromType'] ==
"D") {
1451 $sourceKey[
'accountnumber'] = $pPostVariables[
'txFromMember'];
1452 $sourceKey[
'recordtype'] = $pPostVariables[
'txFromType'];
1453 $sourceKey[
'accounttype'] = $pPostVariables[
'txFromSuffix'];
1454 $sourceKey[
'certnumber'] = $sourceParts[3];
1455 }
else if ($pPostVariables[
'txFromType'] ==
"L" || $pPostVariables[
'txFromType'] ==
"C") {
1456 $sourceKey[
'accountnumber'] = $pPostVariables[
'txFromMember'];
1457 $sourceKey[
'recordtype'] = $pPostVariables[
'txFromType'];
1458 $sourceKey[
'loannumber'] = $pPostVariables[
'txFromSuffix'];
1461 }
else if ( $destParts[0] ==
"M" ) {
1463 $externalAccountId = $destParts[2];
1464 $referenceId = $externalAccountId;
1472 if ($externalAccountId ===
"0") {
1474 "account" => $pPostVariables[
'txMemAccount'],
1475 "type" => $pPostVariables[
'txMemType'],
1476 "name" => $pPostVariables[
'txMemName'],
1477 "display_name" => $pMC->msg(
"M2M Account", HCU_DISPLAY_AS_RAW )
1480 $rdfiData = GetRemoteAccountInfo( $pDbh, $pHBEnv, $externalAccountId );
1484 if ( $rdfiData ===
"" ) {
1485 throw new Exception( $pMC->msg(
'EXT Acct Status Error', HCU_DISPLAY_AS_RAW) );
1489 $sourceAccountInfo = $pPostVariables[
"txFromAcctId"];
1490 $sourceKey = array();
1491 if ($pPostVariables[
'txFromType'] ==
"D") {
1492 $sourceKey[
'accountnumber'] = $pPostVariables[
'txFromMember'];
1493 $sourceKey[
'recordtype'] = $pPostVariables[
'txFromType'];
1494 $sourceKey[
'accounttype'] = $pPostVariables[
'txFromSuffix'];
1495 $sourceKey[
'certnumber'] = $sourceParts[3];
1496 }
else if ($pPostVariables[
'txFromType'] ==
"L" || $pPostVariables[
'txFromType'] ==
"C") {
1497 $sourceKey[
'accountnumber'] = $pPostVariables[
'txFromMember'];
1498 $sourceKey[
'recordtype'] = $pPostVariables[
'txFromType'];
1499 $sourceKey[
'loannumber'] = $pPostVariables[
'txFromSuffix'];
1503 $destAccountInfo =
"M|" . $rdfiData[
"account"] .
"|" . $rdfiData[
"type"];
1506 $destKey[
'accountnumber'] = $rdfiData[
"account"];
1507 $destKey[
'accounttype'] = $rdfiData[
"type"];
1508 $destKey[
"display_name"] = $rdfiData[
"display_name"];
1509 $destKey[
"name"] = $rdfiData[
"name"];
1510 $destKey[
'ext_id'] = $externalAccountId;
1514 $sourceAccountInfo = $pPostVariables[
"txFromAcctId"];
1515 $destAccountInfo = $pPostVariables[
"txToAcctId"];
1516 $sourceKey = array();
1517 if ($pPostVariables[
'txFromType'] ==
"D") {
1518 $sourceKey[
'accountnumber'] = $pPostVariables[
'txFromMember'];
1519 $sourceKey[
'recordtype'] = $pPostVariables[
'txFromType'];
1520 $sourceKey[
'accounttype'] = $pPostVariables[
'txFromSuffix'];
1521 $sourceKey[
'certnumber'] = $sourceParts[3];
1522 }
else if ($pPostVariables[
'txFromType'] ==
"L" || $pPostVariables[
'txFromType'] ==
"C") {
1523 $sourceKey[
'accountnumber'] = $pPostVariables[
'txFromMember'];
1524 $sourceKey[
'recordtype'] = $pPostVariables[
'txFromType'];
1525 $sourceKey[
'loannumber'] = $pPostVariables[
'txFromSuffix'];
1529 if ($pPostVariables[
'txToType'] ==
"D") {
1531 $destKey[
'accountnumber'] = $pPostVariables[
"txTrust"] ==
"transfer" ? $destParts[1] : $pPostVariables[
'txToMember'];
1532 $destKey[
'recordtype'] = $pPostVariables[
'txToType'];
1533 $destKey[
'accounttype'] = $pPostVariables[
'txToSuffix'];
1534 $destKey[
'certnumber'] = $destParts[3];
1535 }
else if ($pPostVariables[
'txToType'] ==
"L" || $pPostVariables[
'txToType'] ==
"C") {
1537 $destKey[
'accountnumber'] = $pPostVariables[
"txTrust"] ==
"transfer" ? $destParts[1] : $pPostVariables[
'txToMember'];
1538 $destKey[
'recordtype'] = $pPostVariables[
'txToType'];
1539 $destKey[
'loannumber'] = $pPostVariables[
'txToSuffix'];
1542 $referenceId = $pHBEnv[
"Uid"];
1546 $transData = array(
"acct_source" => $sourceAccountInfo,
"acct_dest" => $destAccountInfo,
"source_key"=> $sourceKey,
"dest_key" => $destKey );
1547 if (HCU_array_key_value(
'txToMisc1', $pPostVariables) !==
'') {
1549 $transData[
'misc'] = HCU_array_key_value(
'txToMisc1', $pPostVariables);
1552 if ( $destParts[0] ==
"M" ) {
1554 $transData[
'misc'] = $rdfiData[
"name"];
1557 $jsonTransData = HCU_JsonEncode( $transData );
1563 $transMeta = array();
1564 $transMeta[
"source"] =
"immed";
1565 $transMeta[
"recurr"] =
"no";
1566 $transMeta[
"interval"] = 0;
1567 $jsonTransMeta = HCU_JsonEncode($transMeta);
1568 $recordVariables[
"txMeta"] = $jsonTransMeta;
1570 $amount = $pPostVariables[
'txAmount'];
1573 $recordVariables = array();
1574 $recordVariables[
"txFeatureCode"] = $pPostVariables[
'txFeatureCode'];
1575 $recordVariables[
"txPostedBy"] = $pHBEnv[
"Uid"];
1578 $recordVariables[
"txAuthAccount"] = $pPostVariables[
'txFromMember'];
1579 $recordVariables[
"txTransCode"] = $txCode;
1580 $recordVariables[
"txComment"] = $htmlTransferComment;
1581 $recordVariables[
"txReferenceId"] = $referenceId;
1582 $recordVariables[
"txAmount"] = $pPostVariables[
'txAmount'];
1583 $recordVariables[
"txData"] = $jsonTransData;
1584 $recordVariables[
"txMeta"] = $jsonTransMeta;
1587 $transferResult = RecordTransfer( $pDbh, $pHBEnv, $recordVariables );
1588 if ( $transferResult[
"status"][
"code"] !=
"000" ) {
1589 throw new Exception( $pMC->msg(
"Transfer Error", HCU_DISPLAY_AS_HTML) );
1592 $postedDate = $transferResult[
"data"][
"posted_date"];
1595 $confCodeBuilder[
"id"] = $transferResult[
"data"][
"id"];
1596 $confCodeBuilder[
"posted_by"] = $pHBEnv[
"Uid"];
1597 $confCodeBuilder[
"posted_date"] = $postedDate;
1598 $confirmationCode = GetTransferConfirmCode( $pHBEnv,
"post", $confCodeBuilder );
1599 $pHBEnv[
"confirmationCode"]= $confirmationCode;
1601 $myDateTime =
new DateTime( $postedDate );
1604 $myDateTime->setTimezone(
new DateTimeZone($pHBEnv[
"tz"]));
1605 $readableDate = $myDateTime->format(
"m/d/Y g:ia");
1608 $transactionInfo = array(
"transdata" => $jsonTransData,
1609 "transactioncode" => $txCode );
1618 $transDetail = GetTransferDetails( $pHBEnv, $transactionInfo );
1621 $pResults = array(
"status" => array(
"code" =>
"000" ),
1622 "txn" => array(
"trans_id" => $transferResult[
"data"][
"id"],
1623 "data_action" => $transDetail[
"action"],
1624 "data_from" => $transDetail[
"from"],
1625 "data_to" => $transDetail[
"to"],
1626 "data_amount" => $amount,
1627 "data_date" => $readableDate,
1628 "data_confirm" => $confirmationCode ) );
1631 }
catch (Exception $ex) {
1632 $errors = array( $ex->getMessage() );
1633 $pHBEnv[
"SYSENV"][
"logger"]->debug(
"Record Transfer:" . $errors );
1635 $pResults[
"status"] = array(
"code" =>
"999",
1636 "severity" =>
"ERROR",
1637 "errors" => $errors );
1651 function GetRemoteAccountInfo( $pDbh, $pHBEnv, $externalAccountId ) {
1655 $sql =
"SELECT type, display_name, remote_info 1656 FROM {$pHBEnv["Cu
"]}extaccount 1657 WHERE id = $externalAccountId 1658 AND user_id = {$pHBEnv["Uid
"]} 1661 $rs = db_query( $sql, $pDbh );
1665 list( $type, $displayName, $remoteInfo ) = db_fetch_array( $rs, 0 );
1667 $aryRemoteInfo = HCU_JsonDecode( $remoteInfo,
true );
1669 if ( $type ==
"EXT" && strlen( $aryRemoteInfo[
"rdfi"][
"routing"] ) > 0 ) {
1671 $returnInfo = array(
"rdfi" => array(
"rdfi_routing" => $aryRemoteInfo[
"rdfi"][
"routing"],
1672 "rdfi_account" => $aryRemoteInfo[
"rdfi"][
"account"],
1673 "rdfi_account_type" => $aryRemoteInfo[
"rdfi"][
"type"],
1674 "rdfi_txn_type" =>
"",
1676 "remote_entity" => array(
"name" => $aryRemoteInfo[
"rdfi"][
"name"],
1677 "entry_id" => $externalAccountId,
1678 "display_name" => $displayName )
1680 }
else if ( $type ==
"M2M" && strlen( $aryRemoteInfo[
"rdfi"][
"account"] ) > 0 ) {
1682 $returnInfo = array(
"account" => $aryRemoteInfo[
"rdfi"][
"account"],
1683 "type" => $aryRemoteInfo[
"rdfi"][
"type"],
1684 "name" => $aryRemoteInfo[
"rdfi"][
"name"],
1685 "entry_id" => $externalAccountId,
1686 "display_name" => $displayName
1715 function RecordTransfer( $pDbh, $pEnv, $pRecordVariables ) {
1716 $retStatusAry = array(
1717 "status" => array(
"code"=>
"000",
"errors" => Array() ),
1723 $transDataWithMeta = AddAccountMetaData( $pEnv,
1724 $pRecordVariables[
"txFeatureCode"],
1725 $pRecordVariables[
"txTransCode"],
1726 $pRecordVariables[
"txData"] );
1729 $transStatus = db_transaction_status( $pDbh );
1730 $startedTransaction =
false;
1731 if ( !($transStatus === PGSQL_TRANSACTION_ACTIVE || $transStatus === PGSQL_TRANSACTION_INTRANS) ) {
1733 $txnRs = db_work( $pDbh, HOMECU_WORK_BEGIN);
1735 $startedTransaction =
true;
1738 $txFeatureCode = prep_save($pRecordVariables[
"txFeatureCode"]);
1739 $txPostedBy = prep_save($pRecordVariables[
"txPostedBy"]);
1740 $txAuthAccount = prep_save($pRecordVariables[
"txAuthAccount"]);
1741 $txTransCode = prep_save($pRecordVariables[
"txTransCode"]);
1742 $txComment = prep_save($pRecordVariables[
"txComment"]);
1743 $txReferenceId = prep_save($pRecordVariables[
"txReferenceId"]);
1744 $txAmount = prep_save($pRecordVariables[
"txAmount"]);
1745 $txData = prep_save($transDataWithMeta);
1746 $txMeta = prep_save($pRecordVariables[
"txMeta"]);
1749 $txNotify = isset($pRecordVariables[
"txNotify"]) ? intval($pRecordVariables[
'txNotify']) : 0;
1752 if ( $txFeatureCode ==
"TRNEXT") {
1754 $effDate = ACH_GetEffectiveDate( $pEnv );
1757 $effectiveDate = date(
"Y-m-d", strtotime( $effDate ) );
1759 $effDateStr =
"'$effectiveDate'";
1761 $effDateStr =
"(SELECT CURRENT_DATE)";
1766 $sql =
"INSERT INTO {$pEnv["Cu
"]}transhdr (feature_code, effective_date, 1767 posted_by, posted_date, accountnumber, transactioncode, memo, transmeta) 1768 VALUES ('$txFeatureCode', {$effDateStr}, 1769 {$txPostedBy}, now(), '{$txAuthAccount}', '{$txTransCode}', '{$txComment}', '{$txMeta}' ) 1770 RETURNING id, posted_date";
1772 $hdrRs = db_query( $sql, $pDbh );
1774 throw new Exception(
"Transfer header query error " . db_last_error() );
1778 list($headerId, $postedDate) = db_fetch_array($hdrRs, 0);
1781 throw new Exception(
"Error getting id of header after insert query" );
1785 $sql =
"INSERT INTO {$pEnv["Cu
"]}transdtl (transhdr_id, reference_id, amount, email_notify, transdata) 1786 VALUES ($headerId, $txReferenceId, $txAmount, $txNotify, '$txData')";
1788 $dtlRs = db_query( $sql, $pDbh );
1791 throw new Exception(
"Error inserting transfer detail" );
1794 if ( $startedTransaction ) {
1796 $commitRs = db_work( $pDbh, HOMECU_WORK_COMMIT );
1799 throw new Exception (
"Failed to Commit Work");
1804 $returnData = array(
"id" => $headerId,
"posted_date" => $postedDate );
1805 $retStatusAry[
"data"] = $returnData;
1806 }
catch (Exception $ex) {
1807 $pEnv[
"SYSENV"][
"logger"]->debug(
"Record Transfer:" . $ex->getMessage() );
1809 if ( $startedTransaction ) {
1810 db_work( $pDbh, HOMECU_WORK_ROLLBACK );
1813 $retStatusAry[
"status"][
"code"] =
"999";
1816 return $retStatusAry;
1833 function AddAccountMetaData( $pHBEnv, $pFeatureCode, $pTxnCode, $pTransData ) {
1834 $returnTransData = $pTransData;
1837 $transData = HCU_JsonDecode( $pTransData );
1839 if ( empty( $transData ) ) {
1840 throw new Exception (
"Bad transfer data");
1845 $txAcctList = TX_list( $pHBEnv[
"dbh"], $pHBEnv );
1847 $sourceMeta = array(
"deposit_ach_type" =>
"" );
1848 $destMeta = array(
"deposit_ach_type" =>
"" );
1850 switch ( $pTxnCode ) {
1873 $sourceParts = explode(
"|", $transData[
"acct_source"]);
1874 if ( $sourceParts[0] ==
"D" ) {
1875 $sourceDepositType = $txAcctList[
"acctlist"][$transData[
"acct_source"]][
"deposittype"];
1876 $sourceDepositCode = $sourceDepositType ==
"Y" ? 10 : 20;
1878 $sourceDepositCode =
"";
1882 $sourceMeta[
"deposit_ach_type"] = $sourceDepositCode;
1883 $transData[
"source_meta"] = $sourceMeta;
1886 $transDataJson = HCU_JsonEncode($transData);
1887 if ( !empty( $transDataJson ) ) {
1888 $returnTransData = $transDataJson;
1895 $destParts = explode(
"|", $transData[
"acct_dest"]);
1896 if ( $destParts[0] ==
"D" ) {
1897 $destDepositType = $txAcctList[
"acctlist"][$transData[
"acct_dest"]][
"deposittype"];
1898 $destDepositCode = $destDepositType ==
"Y" ? 10 : 20;
1900 $destDepositCode =
"";
1904 $destMeta[
"deposit_ach_type"] = $destDepositCode;
1905 $transData[
"dest_meta"] = $destMeta;
1908 $transDataJson = HCU_JsonEncode($transData);
1909 if ( !empty( $transDataJson ) ) {
1910 $returnTransData = $transDataJson;
1918 }
catch( Exception $e ) {
1922 return $returnTransData;
1940 function ApproveTransfer( $pDbh, $pHBEnv, $pMC, $pWhich, &$pResults ) {
1942 $approvalInfo = array(
"txId" => $pWhich,
1943 "txApprover" => $pHBEnv[
"Uid"] );
1945 $returnInfo = MarkTransferApproved( $pDbh, $pHBEnv, $approvalInfo );
1948 if ( $returnInfo[
"status"][
"code"] !=
"000" ) {
1949 $pResults[
"status"] = array(
"code" =>
"999",
1950 "severity" =>
"ERROR",
1951 "errors" => $pMC->msg(
"Transfer Error", HCU_DISPLAY_AS_HTML) );
1954 $confCodeBuilder[
"id"] = $pWhich;
1955 $confCodeBuilder[
"approved_by"] = $pHBEnv[
"Uid"];
1956 $confCodeBuilder[
"approved_date"] = $returnInfo[
"data"][
"approved_date"];
1957 $confirmationCode = GetTransferConfirmCode( $pHBEnv,
"approve", $confCodeBuilder );
1960 $pResults[
"status"] = array(
"code" =>
"000",
"confirm" => $confirmationCode );
1983 function MarkTransferApproved( $pDbh, $pEnv, $pApprovalVariables ) {
1984 $retStatusAry = Array(
1985 "status" => Array(
"code"=>
"000",
"errors" => Array() ),
1990 $sql =
"UPDATE {$pEnv["Cu
"]}transhdr SET 1991 approved_by = '{$pApprovalVariables["txApprover
"]}', 1992 approved_date = now(), 1993 approved_status = 10 1994 WHERE id = {$pApprovalVariables["txId
"]} 1995 RETURNING id, approved_date";
1997 $hdrRs = db_query( $sql, $pDbh );
2000 list( $transId, $approvedDate) = db_fetch_array( $hdrRs, 0 );
2002 if ( !$hdrRs || !$transId ) {
2003 $retStatusAry[
"status"][
"code"] =
"999";
2006 $returnInfo[
"approved_date"] = $approvedDate;
2007 $retStatusAry[
"data"] = $returnInfo;
2010 return $retStatusAry;
2037 function PostInternalTransfer( $pHBEnv, $pTranRecord ) {
2040 "status" => array(
"code"=>
'000',
"errors" => Array() ),
2044 $dbh = HCU_array_key_value(
'dbh', $pHBEnv);
2045 $email = isset( $pHBEnv[
'Ml'] ) && strlen( $pHBEnv[
'Ml'] ) > 0 ? $pHBEnv[
'Ml'] :
"";
2049 $tranCode = $pTranRecord[
"transactioncode"];
2055 $transferListAry = TX_list($dbh, $pHBEnv,
'',
false, intval(HCU_array_key_value(
'posted_by', $pTranRecord)));
2057 if (!HCU_array_key_exists(
'acctlist', $transferListAry)) {
2058 throw new Exception (
"Unable to load transfer accounts. (99901)");
2061 $srcAcctList = HCU_array_key_value($pTranRecord[
'acct_source'], $transferListAry[
'acctlist']);
2063 $dstAcctList = ($tranCode !=
'MM' ? HCU_array_key_value($pTranRecord[
'acct_dest'], $transferListAry[
'acctlist']) : Array());
2068 if (!$srcAcctList || (!$dstAcctList && $tranCode !=
'MM')) {
2069 throw new Exception (
"Unable to load transfer account. (99902)");
2072 $tranAuthAccount = trim($pTranRecord[
'accountnumber']);
2074 $trMemo = $pTranRecord[
"memo"];
2076 # accept and validate transaction request 2077 $sourceInfo = explode(
"|", $pTranRecord[
"acct_source"] );
2078 $destInfo = explode(
"|", $pTranRecord[
"acct_dest"] );
2080 # try to post, but for now just return the stuff we will send 2081 $acct = $sourceInfo[1];
2082 $sourceSubAcct = $sourceInfo[2];
2083 # take care of one-sided (to-acctclass is O) 2084 $destSubAcct = ($destInfo[0] ==
'O') ?
"" : $destInfo[2];
2086 # don't think the no@email.com applies here, but make sure it works for legacy 2087 $memberEmail = ($email ==
"no\@email.com" ?
" " : trim($email));
2088 $memberEmail = str_replace(
" ",
"",trim($memberEmail));
2092 if ($tranCode ==
'MM') {
2100 if(HCU_array_key_exists(
"misc", $pTranRecord)) {
2101 $miscField = trim($pTranRecord[
'misc']);
2108 if(HCU_array_key_exists(
"misc1", $dstAcctList)) {
2109 $miscField = trim($dstAcctList[
'misc1']);
2113 $destAccount = $destInfo[1];
2114 $AMT = $pTranRecord[
"amount"];
2122 $tranCodeLookup = Array(
"AT",
"LP",
"CP",
"LA");
2124 $tranCodeXLookup = Array(
"XA",
"XP");
2125 if (in_array($tranCode, $tranCodeLookup)) {
2126 if (HCU_array_key_value(
'member', $srcAcctList) != HCU_array_key_value(
'member', $dstAcctList)) {
2129 $tranCode =
"X" . $tranCode;
2131 } elseif (in_array($tranCode, $tranCodeXLookup)) {
2134 $tranCode = ($tranCode ==
"XP" ?
"LP" :
"AT");
2141 # put this block of code where it will be executed for live only. 2153 $txnValues = array(
"member" => $acct,
2155 "tran_code" => $tranCode,
2156 "ref1" => $sourceSubAcct,
2157 "ref2" => $destSubAcct,
2158 "ref3" => $memberEmail,
2159 "ref4" => $miscField,
2160 "ref5" => $destAccount,
2163 "tauth" => $tranAuthAccount
2166 $operation =
"TRANSFER";
2168 $result = SendTransaction( $pHBEnv, $operation, $txnValues );
2170 if ( $result[
"status"][
"code"] !=
"000" ) {
2172 $errors = $result[
"status"][
"errors"];
2175 if (count($errors) > 0) {
2176 $txfr[
'status'][
'code']=
'999';
2177 $txfr[
'status'][
'severity']=
'ERROR';
2178 $txfr[
'status'][
'errors']=$errors;
2180 $txfr[
'status'][
'code']=
'000';
2181 $txfr[
'status'][
'severity']=
'INFO';
2184 $txfr[
'txn'][
'acct']=$acct;
2185 $txfr[
'txn'][
'tcode']=$tranCode;
2186 $txfr[
'txn'][
'r1fsfx']=$sourceSubAcct;
2187 $txfr[
'txn'][
'r2tsfx']=$destSubAcct;
2188 $txfr[
'txn'][
'r3email']=urldecode($memberEmail);
2189 $txfr[
'txn'][
'r4misc1']=$miscField;
2190 $txfr[
'txn'][
'r5tmem']=$destAccount;
2191 $txfr[
'txn'][
'amount']=$AMT;
2192 $txfr[
'txn'][
'trmemo']=$trMemo;
2194 }
catch( Exception $ex ) {
2195 $pHBEnv[
"SYSENV"][
"logger"]->debug(
"PostInternalTransfer:" . $ex->getMessage() );
2196 $errors[] = $ex->getMessage();
2198 $txfr[
'status'][
'code'] =
'999';
2199 $txfr[
'status'][
'severity'] =
'ERROR';
2200 $txfr[
'status'][
'errors'] = $errors;
2223 function PostSecureMessageTransfer( $pHBEnv, $tranData ) {
2227 "status" => array(
"code"=>
'000',
"errors" => Array() ),
2232 $MC = $pHBEnv[
"MC"];
2235 $destParts = explode(
"|", $tranData[
"acct_dest"] );
2237 $sourceParts = explode(
"|", $tranData[
"acct_source"] );
2239 $fromAcct = $sourceParts[2];
2240 $fromMbr = $sourceParts[1];
2246 $cuAllowedTransactionsAry = Get_HaveTrans( $pHBEnv[
"dbh"], $pHBEnv );
2248 $key= trim($destParts[2]);
2250 $secureFormTitle =
"";
2251 if ( HCU_array_key_exists($key, $cuAllowedTransactionsAry) ) {
2252 $secureFormTitle = $cuAllowedTransactionsAry[$key][2];
2253 if ( $secureFormTitle ==
"" ) {
2254 $secureFormTitle = $cuAllowedTransactionsAry[$key][0];
2257 $errors[] = $MC->msg(
'Option not set');
2260 if ( $secureFormTitle ==
"" ) {
2261 $secureFormTitle =
"Credit Card Payment Request";
2267 $sslFormsDir =
"/home/{$pHBEnv['chome']}/sslforms/";
2272 $sslFormsFileName =
'CCPmt' . date(
'YmdHis') . posix_getpid() .
'.html';
2275 $sql =
"SELECT email 2277 WHERE cu = '{$pHBEnv['Cu']}' 2278 AND role = 'ccemail'";
2279 $emRs = db_query($sql, $pHBEnv[
"dbh"]);
2280 list($notifyEmail) = db_fetch_array($emRs);
2281 db_free_result($emRs);
2284 if ( trim($notifyEmail) ==
'' || !(is_writable($sslFormsDir)) ) {
2285 $errors[] = $MC->msg(
'Contact CU');
2288 if ( count( $errors ) > 0 ) {
2289 $txfr[
'status'][
'code'] =
'999';
2290 $txfr[
'status'][
'severity'] =
'ERROR';
2291 $txfr[
'status'][
'errors'] = $errors;
2294 $dataConfirm= $pHBEnv[
"confirmationCode"];
2296 $tranCode = $tranData[
"transactioncode"];
2297 $trMemo = $tranData[
"memo"];
2300 $amount = number_format( $tranData[
"amount"], 2 );
2301 $secureFormDataAry = array();
2302 $secureFormDataAry[] = Array(
'type' =>
'field',
2303 'label' =>
"Submission Date",
2304 'value' =>
"Received on " . date(
"m/d/Y") .
" at " . date(
"H:i T" ) );
2305 $secureFormDataAry[] = Array(
'type' =>
'field',
2307 'value' => $pHBEnv[
"Cn"]);
2308 $secureFormDataAry[] = Array(
'type' =>
'field',
2309 'label' =>
"Transfer From Account",
2310 'value' => $sourceParts[1]);
2311 $secureFormDataAry[] = Array(
'type' =>
'field',
2312 'label' =>
"Amount",
2313 'value' =>
"\$" . money_format(
'%.2n', $amount) );
2314 $secureFormDataAry[] = Array(
'type' =>
'field',
2315 'label' =>
"Comments",
2316 'value' => $trMemo );
2317 $secureFormDataAry[] = Array(
'type' =>
'field',
2318 'label' =>
"Confirmation Code",
2319 'value' => $dataConfirm );
2320 $secureFormDataAry[] = Array(
'type' =>
'field',
2322 'value' => $pHBEnv[
"MC"]->msg(
"CCPayNote") );
2325 $securePathFileName = $sslFormsDir . $sslFormsFileName;
2328 $emailInfo[
"target"] = $notifyEmail;
2329 $emailInfo[
"reply"] =
"";
2330 $emailInfo[
"subject"] =
"SECURE FORM NOTIFICATION (CCPmt)";
2331 $body =
"A secure document has been submitted to your site. You\n";
2332 $body .=
"can retrieve it in the password protected admin directory.\n";
2333 $body .=
"\n\n{$pHBEnv["Cu
"]}\n";
2334 $emailInfo[
"body"] = $body;
2336 $result = PostSecureMessage( $secureFormDataAry, $securePathFileName, $secureFormTitle, $emailInfo, $pHBEnv );
2339 $dataFrom = $sourceParts[1];
2343 $txfr[
'status'][
'code'] =
'0';
2344 $txfr[
'status'][
'severity'] =
'INFO';
2345 $txfr[
'txn'][
'confirmid'] = $dataConfirm;
2346 $txfr[
'txn'][
'acct'] = $fromMbr;
2347 $txfr[
'txn'][
'tcode'] = $tranCode;
2348 $txfr[
'txn'][
'r1fsfx'] = $dataFrom;
2349 $txfr[
'txn'][
'r2tsfx'] =
'';
2350 $txfr[
'txn'][
'r3email'] =
'';
2351 $txfr[
'txn'][
'r4misc1'] =
'';
2352 $txfr[
'txn'][
'r5tmem'] = $fromMbr;
2353 $txfr[
'txn'][
'amount'] = $amount;
2354 $txfr[
'txn'][
'trmemo'] = $trMemo;
2356 }
catch( Exception $ex ) {
2357 $pHBEnv[
"SYSENV"][
"logger"]->debug(
"PostSecureMessageTransfer:" . $ex->getMessage() );
2358 $errors[] = $ex->getMessage();
2360 $txfr[
'status'][
'code'] =
'999';
2361 $txfr[
'status'][
'severity'] =
'ERROR';
2362 $txfr[
'status'][
'errors'] = $errors;
2387 function ProcessTransfer( $pDbh, $pHBEnv, $pMC, $pWhich, &$pResults, $fromUserActivity =
false) {
2391 $Cu = $pHBEnv[
"Cu"];
2394 $sql =
"with uaua as (select user_id, accountnumber, accounttype, display_name, certnumber, 2395 trim(recordtype) || '|' || trim(accountnumber) || '|' || trim(accounttype) || '|' || certnumber as key from ${Cu}useraccounts), 2396 albalb as (select description, 'D|' || trim(accountnumber) || '|' || trim(accounttype) || '|' || certnumber as key, misc1 from ${Cu}accountbalance 2397 union all select description, 'L|' || trim(accountnumber) || '|' || trim(loannumber) || '|0' as key, misc1 from ${Cu}loanbalance) 2398 select txn.*, uafrom.display_name as from_displayname, albto.misc1 as tomisc1, albfrom.misc1 as frommisc1, 2399 albfrom.description as from_desc, uafrom.accountnumber as from_acct, uafrom.accounttype as from_accounttype, uafrom.certnumber as from_certnumber, 2400 uato.display_name as to_displayname, albto.description as to_desc, uato.accountnumber as to_acct, uato.accounttype as to_accounttype, uato.certnumber as to_certnumber from 2401 (select h.*, d.amount, d.transdata, d.transdata::json->>'acct_source' as fromkey, d.transdata::json->>'acct_dest' as tokey 2402 from ${Cu}transhdr h 2403 inner join ${Cu}transdtl d on d.transhdr_id = h.id) txn 2404 left join uaua uafrom 2405 on txn.fromkey = uafrom.key or txn.fromkey || '|0' = uafrom.key and uafrom.user_id = txn.posted_by 2406 left join albalb albfrom 2407 on txn.fromkey = albfrom.key or txn.fromkey || '|0' = albfrom.key 2409 on txn.tokey = uato.key or txn.tokey || '|0' = uato.key 2410 left join albalb albto 2411 on txn.tokey = albto.key or txn.tokey || '|0' = albto.key 2412 where txn.id = $pWhich";
2413 $rs = db_query( $sql, $pDbh );
2416 throw new Exception( $pMC->msg(
"Transfer Error", HCU_DISPLAY_AS_HTML) );
2419 $transferRecord = db_fetch_array( $rs, 0 );
2423 if (in_array($transferRecord[
"feature_code"], array(FEATURE_EXTERNAL_TRANSFERS, FEATURE_ACH_PAYMENTS, FEATURE_ACH_COLLECTIONS))) {
2424 $errors[] = $pMC->msg(
"External Transfer", HCU_DISPLAY_AS_HTML);
2425 $pResults = array(
"status" => array(
"code" =>
"999",
2426 "severity" =>
"ERROR",
2427 "errors" => $errors ) );
2433 $transData = HCU_JsonDecode( $transferRecord[
'transdata'] );
2436 $destParts = explode(
"|", $transData[
"acct_dest"] );
2437 $sourceParts = explode(
"|", $transData[
"acct_source"] );
2439 if (empty($destParts) || empty($sourceParts)) {
2440 $errors[] = $pMC->msg(
'Missing required values' );
2443 if (count($errors) > 0) {
2444 $txfr[
'status'][
'code']=
'999';
2445 $txfr[
'status'][
'severity']=
'ERROR';
2446 $txfr[
'status'][
'errors']=$errors;
2449 $transData[
"transactioncode"] = $transferRecord[
"transactioncode"];
2450 $transData[
"memo"] = $transferRecord[
"memo"];
2451 $transData[
"amount"] = $transferRecord[
"amount"];
2453 $transData[
"accountnumber"] = $transferRecord[
"accountnumber"];
2454 $transData[
'posted_by'] = $transferRecord[
'posted_by'];
2465 if ( $destParts[0] ==
'O' && substr( $destParts[2], 0, 1 ) ==
"P" ) {
2466 $aryTransferRequestResult = PostSecureMessageTransfer( $pHBEnv, $transData );
2468 $aryTransferRequestResult = PostInternalTransfer( $pHBEnv, $transData );
2471 if ( $aryTransferRequestResult[
"status"][
"code"] !=
"999" ) {
2474 $sql =
"UPDATE {$pHBEnv["Cu
"]}transhdr SET 2475 processed_by = '*immed*', 2476 processed_date = now(), 2477 processed_status = 20 2479 RETURNING processed_date, posted_by";
2481 $rs = db_query( $sql, $pDbh );
2483 list( $processedDate, $postedBy ) = db_fetch_array( $rs, 0 );
2486 $confCodeBuilder[
"id"] = $pWhich;
2487 $confCodeBuilder[
"processed_by"] =
"*immed*";
2488 $confCodeBuilder[
"posted_by"] = $postedBy;
2489 $confCodeBuilder[
"processed_date"] = $processedDate;
2490 $confirmationCode = GetTransferConfirmCode( $pHBEnv,
"process", $confCodeBuilder );
2492 $confirmationCode = $confirmationCode;
2494 $transDetail = GetTransferDetails( $pHBEnv, $transferRecord );
2507 $myDateTime =
new DateTime( $processedDate );
2510 $myDateTime->setTimezone(
new DateTimeZone($pHBEnv[
"tz"]));
2511 $readableDate = $myDateTime->format(
"m/d/Y g:ia");
2513 $dataAmount = mobile_formatnumber($aryTransferRequestResult[
'txn'][
'amount'],
",");
2514 $pResults = array(
"status" => array(
"code" =>
"000" ),
2515 "txn" => array(
"data_action" => $transDetail[
"action"],
2516 "data_from" => $transDetail[
"from"],
2517 "data_to" => $transDetail[
"to"],
2518 "data_amount" => $dataAmount,
2519 "data_date" => $readableDate,
2520 "data_confirm" => $confirmationCode ) );
2525 $pResults = array(
"status" => $aryTransferRequestResult[
"status"] );
2530 }
catch (Exception $ex) {
2531 $pHBEnv[
"SYSENV"][
"logger"]->debug(
"Process Transfer:" . $ex->getMessage() );
2532 $errors[] = $ex->getMessage();
2533 $pResults = array(
"status" => array(
"code" =>
"999",
2534 "severity" =>
"ERROR",
2535 "errors" => $errors ) );
2553 function GetTransferDetails( $pHBEnv, $pTranRecord ) {
2556 $txnCode = $pTranRecord[
"transactioncode"];
2557 $dbh = $pHBEnv[
"dbh"];
2558 $Cu = $pHBEnv[
"Cu"];
2559 $fset3 = $pHBEnv[
"Fset3"];
2560 $Uid = $pHBEnv[
'Uid'];
2561 $MC = $pHBEnv[
'MC'];
2564 $transData = HCU_JsonDecode( $pTranRecord[
"transdata"] );
2566 if ( $txnCode ==
"1W" || $txnCode ==
"2W" ) {
2567 $dataAction = $pHBEnv[
"MC"]->msg(
"External Transfer", HCU_DISPLAY_AS_RAW );
2569 if ( substr( $txnCode, 0, 1 ) ==
"1" ) {
2574 $srcAcctId = HCU_AcctIdExplode(HCU_array_key_value(
'acct_source', $transData));
2575 $srcAcctKey = $transData[
'source_key'];
2577 if ($srcAcctId[
'valid']) {
2578 $localFromArray = GetMemberDescription($dbh, $Cu, $Uid, $srcAcctKey);
2580 $localFromDesc = $localFromArray[
'description'];
2581 $localFromDisp = $localFromArray[
'display_name'];
2584 throw new Exception (
"Unknown Acct ID");
2588 if ($srcAcctKey[
'recordtype'] ==
"D") {
2589 $dataFrom = getAccountDescription($dbh, $Cu, $srcAcctKey[
'accountnumber'], $localFromDesc, $srcAcctKey[
'accounttype'], $localFromDisp, $fset3, $srcAcctId[
'segment4']);
2591 $dataFrom = getAccountDescription($dbh, $Cu, $srcAcctKey[
'accountnumber'], $localFromDesc, $srcAcctKey[
'loannumber'], $localFromDisp, $fset3, $srcAcctId[
'segment4']);
2594 $acctDest = $transData[
"acct_dest"];
2595 if (HCU_array_key_value(
'remote_entity', $acctDest) !=
'' ) {
2596 $dataTo = HCU_array_key_value(
'name', $acctDest[
'remote_entity']);
2598 $dataTo = getAccountDescription($dbh, $Cu, $acctDest[
"rdfi"][
"rdfi_account"],
"", $acctDest[
"rdfi"][
"rdfi_account_type"],
"", $fset3, 0,
true,
true);
2602 $acctSource = $transData[
"acct_source"];
2604 if (HCU_array_key_value(
'remote_entity', $acctSource) !=
'' ) {
2605 $dataFrom = HCU_array_key_value(
'name', $acctSource[
'remote_entity']);
2607 $dataFrom = getAccountDescription($dbh, $Cu, $acctSource[
"rdfi"][
"rdfi_account"],
"", $acctSource[
"rdfi"][
"rdfi_account"],
"", $fset3, 0,
true,
true);
2613 $dstAcctId = HCU_AcctIdExplode(HCU_array_key_value(
'acct_dest', $transData));
2614 $dstAcctKey = $transData[
'dest_key'];
2615 if ($dstAcctId[
'valid']) {
2616 $localToArray = GetMemberDescription($dbh, $Cu, $Uid, $dstAcctKey);
2617 $localToDesc = $localToArray[
'description'];
2618 $localToDisp = $localToArray[
'display_name'];
2621 throw new Exception (
"Unknown Acct ID");
2624 if ($dstAcctKey[
'recordtype'] ==
"D") {
2625 $dataTo = getAccountDescription($dbh, $Cu, $dstAcctKey[
'accountnumber'], $localToDesc, $dstAcctKey[
'accounttype'], $localToDisp, $fset3, $dstAcctId[
'segment4']);
2627 $dataTo = getAccountDescription($dbh, $Cu, $dstAcctKey[
'accountnumber'], $localToDesc, $dstAcctKey[
'loannumber'], $localToDisp, $fset3, $dstAcctId[
'segment4']);
2630 }
else if ( $txnCode ==
"MM" ) {
2631 $dataAction = $pHBEnv[
"MC"]->msg(
"M2M Transfer", HCU_DISPLAY_AS_RAW );
2633 $srcAcctId = HCU_AcctIdExplode(HCU_array_key_value(
'acct_source', $transData));
2634 $srcAcctKey = $transData[
'source_key'];
2636 if ($srcAcctId[
'valid']) {
2637 $localFromArray = GetMemberDescription($dbh, $Cu, $Uid, $srcAcctKey);
2638 $localFromDesc = $localFromArray[
'description'];
2639 $localFromDisp = $localFromArray[
'display_name'];
2642 throw new Exception (
"Unknown Acct ID");
2645 if ($srcAcctKey[
'recordtype'] ==
"D") {
2646 $dataFrom = getAccountDescription($dbh, $Cu, $srcAcctKey[
'accountnumber'], $localFromDesc, $srcAcctKey[
'accounttype'], $localFromDisp, $fset3, $srcAcctId[
'segment4']);
2648 $dataFrom = getAccountDescription($dbh, $Cu, $srcAcctKey[
'accountnumber'], $localFromDesc, $srcAcctKey[
'loannumber'], $localFromDisp, $fset3, $srcAcctId[
'segment4']);
2651 $dstAcctId = HCU_AcctIdExplode(HCU_array_key_value(
'acct_dest', $transData));
2655 $localToDesc = HCU_array_key_value(
'misc', $transData);
2657 $localToType = ($dstAcctId[
'segment3'] ==
'10' ? $MC->msg(
'ACH Checking') : $MC->msg(
'ACH Savings'));
2658 $dataTo = getAccountDescription($dbh, $Cu, $dstAcctId[
'acctnumber'], $localToDesc, $localToType,
'', $fset3, 0,
true,
true);
2662 $transferSource = $transData[
"acct_source"];
2663 $sourceParts = explode(
"|", $transferSource );
2664 $srcAcctId = HCU_AcctIdExplode(HCU_array_key_value(
'acct_source', $transData));
2665 $srcAcctKey = $transData[
'source_key'];
2667 $transferDest = $transData[
"acct_dest"];
2668 $destParts = explode(
"|", $transferDest );
2669 $dstAcctId = HCU_AcctIdExplode(HCU_array_key_value(
'acct_dest', $transData));
2670 $dstAcctKey = $transData[
'dest_key'];
2676 if ($txnCode ==
"XA") {
2677 $lookupTxCode =
"AT";
2678 } elseif ($txnCode ==
"XP") {
2679 $lookupTxCode =
"LP";
2681 $lookupTxCode = $txnCode;
2685 $sql =
"SELECT trandesc FROM cutrans WHERE trancode = '$lookupTxCode'";
2686 $sth = db_query($sql, $pHBEnv[
"dbh"]);
2687 list( $tranDesc ) = db_fetch_array( $sth, 0 );
2689 $dataAction = $tranDesc;
2691 # FIX FOR PROD - Error checking, anyone? 2692 # send appropriate status if post fails 2695 $thirdSpotTestCode = $dstAcctId[
'segment3'];
2698 if ($dstAcctId[
'type'] ==
'O') {
2702 $cuOtherTrans = Get_HaveTrans($dbh, $pHBEnv);
2705 if (HCU_array_key_exists($thirdSpotTestCode, $cuOtherTrans)) {
2706 $transdesc = HCU_array_key_value($thirdSpotTestCode, $cuOtherTrans);
2708 $cudesc = isset($transdesc[2]) ? trim($transdesc[2]) :
"";
2709 $noncudesc = isset($transdesc[0]) ? trim($transdesc[0]) :
"";
2710 $dataAction = $cudesc !=
"" ? $cudesc : $noncudesc;
2714 $dataAction = $pHBEnv[
'MC']->msg(
"Unknown");
2716 $dataTo = $dataAction;
2719 $dstAcctId = HCU_AcctIdExplode(HCU_array_key_value(
'acct_dest', $transData));
2721 if ($dstAcctId[
'valid']) {
2724 $tranCodeXLookup = Array(
"XA",
"XP");
2726 if (in_array($txnCode, $tranCodeXLookup)) {
2731 $acctTypeorLoan = ($dstAcctKey[
'recordtype'] ==
"L" || $dstAcctKey[
'recordtype'] ==
"C" ?
"loannumber" :
"accounttype");
2732 $localAcctKey = Array(
2733 "recordtype" => $dstAcctKey[
'recordtype'],
2734 "accountnumber" => $srcAcctKey[
'accountnumber'],
2735 $acctTypeorLoan => $dstAcctKey[$acctTypeorLoan] .
'#' . $dstAcctKey[
'accountnumber'],
2740 $localAcctKey = $dstAcctKey;
2744 $localToArray = GetMemberDescription($dbh, $Cu, $Uid, $localAcctKey);
2746 $localToDesc = $localToArray[
'description'];
2747 $localToDisp = $localToArray[
'display_name'];
2751 throw new Exception (
"Unknown Acct ID");
2754 if ($dstAcctKey[
'recordtype'] ==
"D") {
2755 $dataTo = getAccountDescription($dbh, $Cu, $dstAcctKey[
'accountnumber'], $localToDesc, $dstAcctKey[
'accounttype'], $localToDisp, $fset3, $dstAcctId[
'segment4']);
2757 $dataTo = getAccountDescription($dbh, $Cu, $dstAcctKey[
'accountnumber'], $localToDesc, $dstAcctKey[
'loannumber'], $localToDisp, $fset3, $dstAcctId[
'segment4']);
2762 if ($srcAcctId[
'valid']) {
2763 $localFromArray = GetMemberDescription($dbh, $Cu, $Uid, $srcAcctKey, $srcAcctId);
2764 $localFromDesc = $localFromArray[
'description'];
2765 $localFromDisp = $localFromArray[
'display_name'];
2768 throw new Exception (
"Unknown Acct ID");
2772 if ($srcAcctKey[
'recordtype'] ==
"D") {
2773 $dataFrom = getAccountDescription($dbh, $Cu, $srcAcctKey[
'accountnumber'], $localFromDesc, $srcAcctKey[
'accounttype'], $localFromDisp, $fset3, $srcAcctId[
'segment4']);
2775 $dataFrom = getAccountDescription($dbh, $Cu, $srcAcctKey[
'accountnumber'], $localFromDesc, $srcAcctKey[
'loannumber'], $localFromDisp, $fset3, $srcAcctId[
'segment4']);
2779 $transferDetail = array(
2780 "action" => $dataAction,
2781 "from" => $dataFrom,
2784 }
catch (Exception $ex) {
2787 $transferDetail = array(
2788 "action" =>
"Transfer",
2789 "from" =>
"Unknown",
2794 return $transferDetail;
2810 function SanitizeTransaction ($pValues) {
2813 $retDataRow = array();
2818 $txFromMember = isset($pValues[
'txFromMember']) ? $pValues[
'txFromMember'] :
null;
2819 $txFromSuffix = isset($pValues[
'txFromSuffix']) ? $pValues[
'txFromSuffix'] :
null;
2821 $txToMember = isset($pValues[
'txToMember']) ? $pValues[
'txToMember'] :
null;
2822 $txToSuffix = isset($pValues[
'txToSuffix']) ? $pValues[
'txToSuffix'] :
null;
2824 $txCode = isset($pValues[
'txCode']) ? $pValues[
'txCode'] :
null;
2825 $txAmount = isset($pValues[
'txAmount']) ? $pValues[
'txAmount'] :
null;
2826 $txMemo = isset($pValues[
'txMemo']) ? $pValues[
'txMemo'] :
null;
2827 $txFrequency = isset($pValues[
'txFrequency']) ? $pValues[
'txFrequency'] :
null;
2828 $txContinue = isset($pValues[
'txContinue']) ? $pValues[
'txContinue'] :
null;
2829 $txDateStart = isset($pValues[
'txDateStart']) ? $pValues[
'txDateStart'] :
null;
2830 $txDateEnd = isset($pValues[
'txDateEnd']) ? $pValues[
'txDateEnd'] :
null;
2831 $txStatus = isset($pValues[
'txStatus']) ? $pValues[
'txStatus'] :
null;
2851 function GetTransferToOptions($HB_ENV, $sourceParts, $txFromPermMember, $fromScheduledPage) {
2854 $transferList = TX_list($HB_ENV[
"dbh"], $HB_ENV);
2856 $txFromType = HCU_array_key_value(0, $sourceParts);
2857 $txFromMember = HCU_array_key_value(1, $sourceParts);
2859 $txFromSuffix = HCU_array_key_value(2, $sourceParts);
2862 if (!HCU_array_key_exists(
"acctlist", $transferList)) {
2863 throw new exception (
"Transfer list is not valid.", 1);
2867 $permissionInputs = array(
"feature" => FEATURE_M2M_TRANSFERS );
2868 $permissionM2M = Perm_AccessRights($HB_ENV[
"dbh"], $HB_ENV, $permissionInputs );
2871 $isLive = $HB_ENV[
'live'] == 0 ? false :
true;
2875 $fromAcctValues = $transferList[
"acctlist"][implode(
"|", $sourceParts )];
2877 foreach ($transferList[
"acctlist"] as $acctKey => $acctValues) {
2880 $txToType = HCU_array_key_value(
"acctclass", $acctValues);
2881 $txToPermMember = HCU_array_key_value(
"member", $acctValues);
2882 $txToSuffix = HCU_array_key_value(
"suffix", $acctValues);
2883 $txToSuffix = explode(
"@", $txToSuffix)[0];
2884 $destParts = explode(
"|", $acctKey);
2885 $txToMember = HCU_array_key_value(1, $destParts);
2886 $acctInfo = Array();
2889 if ($fromScheduledPage && $txToType ==
"O") {
2894 if ($txFromType ==
"L" && $txToType ==
"X") {
2898 if ($acctValues[
"out_of_sync"] || !$acctValues[
"to"]) {
2903 if ($txToMember == $txFromMember
2904 && $txToPermMember == $txFromPermMember
2905 && $txToSuffix == $txFromSuffix
2906 && $txToType == $txFromType) {
2911 if ($txToType ==
"M" && !($isLive && $permissionM2M[
'access'])) {
2915 $relevantTypes = array(
"D",
"L");
2917 if (($HB_ENV[
"flagset3"] & GetFlagsetValue(
"CU3_DISALLOW_MULT_ACCOUNTS_TRANSFER")) != 0) {
2919 if ($txToPermMember != $txFromPermMember && in_array($txFromType, $relevantTypes) && in_array($txToType, $relevantTypes)) {
2923 if (HCU_array_key_exists($txFromPermMember, $transferList[
"xacctlist"])
2924 && HCU_array_key_exists($acctKey, $transferList[
"xacctlist"][$txFromPermMember])) {
2925 $acctValues = $transferList[
"xacctlist"][$txFromPermMember][$acctKey];
2927 $txToType = HCU_array_key_value(
"acctclass", $acctValues);
2928 $txToPermMember = HCU_array_key_value(
"member", $acctValues);
2929 $txToSuffix = HCU_array_key_value(
"suffix", $acctValues);
2930 $txToSuffix = explode(
"@", $txToSuffix)[0];
2931 $destParts = explode(
"|", $acctKey);
2932 $txToMember = HCU_array_key_value(1, $destParts);
2933 $acctInfo = Array();
2935 if ($txToPermMember != $txFromPermMember && in_array($txFromType, $relevantTypes) && in_array($txToType, $relevantTypes)) {
2946 $txScheduledAllowed = ($HB_ENV[
'flagset2'] & GetFlagsetValue(
"CU2_PROCRECUR")) != 0;
2948 if ($fromScheduledPage && !$txScheduledAllowed) {
2953 if ($txFromType ==
"X") {
2955 if (!in_array($txToType, $relevantTypes)) {
2960 if ($acctValues[
"to_ext"] !==
"Y") {
2964 if (HCU_array_key_value(
"from_int", $fromAcctValues) !==
"Y") {
2969 if ($txToType ==
"X") {
2971 if (!in_array($txFromType, $relevantTypes)) {
2975 if (HCU_array_key_value(
"from_ext", $fromAcctValues) !==
"Y") {
2980 if (HCU_array_key_value(
"to_int", $acctValues) !==
"Y") {
2986 if ($txFromType !==
"D" && $txToType ==
"M") {
2991 if ($txFromType ==
"L" && $txToType ==
"L") {
2996 if ( $txFromType ===
"X" || $txToType ===
"X" ) {
2997 $transferFeatureCode = FEATURE_EXTERNAL_TRANSFERS;
2998 }
else if ( $txToType ===
"M" ) {
2999 $transferFeatureCode = FEATURE_M2M_TRANSFERS;
3000 }
else if ( $txFromType ===
"AC" ) {
3001 $transferFeatureCode = FEATURE_ACH_COLLECTIONS;
3002 }
else if ( $txToType ===
"AP" ) {
3003 $transferFeatureCode = FEATURE_ACH_PAYMENTS;
3005 $transferFeatureCode = FEATURE_TRANSFERS;
3009 $hasTransferNotify = _HasTransferNotify( $HB_ENV[
"dbh"], $HB_ENV[
"Cu"] );
3011 if ( !$hasTransferNotify && ($fromScheduledPage || ($HB_ENV[
"flagset"] & GetFlagsetValue(
"CU_MAILTXNS")))) {
3016 $cuTransTypesAllowed = Get_HaveTrans($HB_ENV[
"dbh"], $HB_ENV);
3017 if ($txFromType ==
"L" && $acctValues[
"suffix"] ==
"CW" && !HCU_array_key_exists(
'LC', $cuTransTypesAllowed)) {
3024 if ($acctValues[
'trust'] !=
'transfer' && $acctValues[
'view_balances'] ==
'Y') {
3025 switch ($txToType) {
3028 Array(
"desc" => $HB_ENV[
"MC"]->msg(
'Balance', HCU_DISPLAY_AS_RAW),
"value" => $acctValues[
'balance'])
3034 Array(
"desc" => $HB_ENV[
"MC"]->msg(
'Payoff', HCU_DISPLAY_AS_RAW),
"value" => $acctValues[
'payoff']),
3035 Array(
"desc" => $HB_ENV[
"MC"]->msg(
'Balance', HCU_DISPLAY_AS_RAW),
"value" => $acctValues[
'balance']),
3036 Array(
"desc" => $HB_ENV[
"MC"]->msg(
'Payment', HCU_DISPLAY_AS_RAW),
"value" => $acctValues[
'paymentdue'])
3042 $Fset2 = ($HB_ENV[
'Fset2']) ??
null;
3043 if (($Fset2 & GetFlagsetValue(
'CU2_CC18NOINFO')) != GetFlagsetValue(
'CU2_CC18NOINFO')) {
3045 Array(
"desc" => $HB_ENV[
"MC"]->msg(
'Payoff', HCU_DISPLAY_AS_RAW),
"value" => $acctValues[
'payoff']),
3046 Array(
"desc" => $HB_ENV[
"MC"]->msg(
'Balance', HCU_DISPLAY_AS_RAW),
"value" => $acctValues[
'balance']),
3047 Array(
"desc" => $HB_ENV[
"MC"]->msg(
'Payment', HCU_DISPLAY_AS_RAW),
"value" => $acctValues[
'paymentdue'])
3055 "acctText" => htmlspecialchars_decode($acctValues[
'description'], ENT_QUOTES),
3056 "acctValue" => mobile_displayhtml($acctKey),
3057 "acctInfo" => $acctInfo,
3058 'acctClass' => $txToType,
3059 'acctGroup' => $acctValues[
'item-group'],
3060 'acctOrder' => $acctOrder,
3061 "permissionAcct" => $acctValues[
"member"]
3068 if (!$fromScheduledPage && $isLive && $permissionM2M[
'access'] && $txFromType ==
"D") {
3070 "acctText" => $HB_ENV[
"MC"]->msg(
"Transfer to another member", HCU_DISPLAY_AS_RAW),
3071 "acctValue" =>
"M|" . $HB_ENV[
'Uid'] .
"|0",
3072 "acctInfo" => array(),
3074 "acctGroup" =>
"6 - " . $HB_ENV[
"MC"]->msg(
"Other Member Accounts", HCU_DISPLAY_AS_RAW),
3075 "acctOrder" => $acctOrder
3079 $returnArray = array(
"status" =>
"000",
"error" =>
"",
"transferToList" => $toArray);
3080 }
catch (exception $e) {
3081 $returnArray = array(
"status" => $e->getCode(),
"error" => $e->getMessage(),
"transferToList" => array());
3083 return $returnArray;