2 function RDCconfig($dbh,&$parms) {
3 $parms[
'UAT'] = (!isset($parms[
'UAT']) ? 0 : $parms[
'UAT'] );
4 $parms[
'serviceurl'] = ($parms[
'UAT'] == 0 ? $parms[
'ProdURL'] : $parms[
'UATurl']);
5 $parms[
'acctttl'] = (!isset($parms[
'acctttl']) ?
'Select account' : $parms[
'acctttl'] );
6 $parms[
'descttl'] = (!isset($parms[
'descttl']) ?
'Description' : $parms[
'descttl'] );
9 function RDCauth($dbh, $HB_ENV, $MC, $parms) {
10 # requires: $parms['Cu'] 12 # Additional values rdcvendor retrieved and decoded from cutrusteddetail 15 # assume we are going to succeed... 16 $return[
'status'][
'response'] =
'true';
17 $return[
'status'][
'code'] =
'000';
18 $return[
'status'][
'message'] =
'Success';
21 # If authorizing at HomeCU, is member authorized? 22 if ($parms[
'HomeCUAuth']) {
23 $mbr_rdc = Get_RDCSetting($dbh, $HB_ENV,
'RDCBluepoint', $parms[
'MBRACCT']);
24 if ($mbr_rdc[
'status'][
'code'] !=
'000') {
25 throw new Exception($mbr_rdc[
'status'][
'message'], $mbr_rdc[
'status'][
'code']);
27 $dl = $mbr_rdc[
'rdcsetting'];
28 if (abs(intval($dl)) == 0) {
30 $HB_Notices_ary = Get_NoticeInfo($dbh, $HB_ENV, $MC,
'M',
"mblNoRDC",
true);
31 if ($HB_Notices_ary[
'status'][
'code'] ==
'000') {
32 $noticeData = $HB_Notices_ary[
"notice"][0][
"notice_text"];
36 if (strlen($noticeData)) {
37 $message = $noticeData;
40 $message =
"Account not permitted for Remote Deposit. Please contact the Credit Union for more information";
43 throw new Exception($message, $code);
46 # member authorized, or not authorizing at HomeCU. 47 # check if they have any valid accounts 48 $parms[
'Fset2'] = $HB_ENV[
'Fset2']; # HB_ENV
49 $parms[
'Fset3'] = $HB_ENV[
'Fset3']; # HB_ENV
50 $parms[
'Uid'] = $HB_ENV[
'Uid'];
51 $hculist = RDCGetAccts($dbh, $parms);
53 if ($hculist[
'status'][
'response'] ==
'false') {
54 throw new Exception($hculist[
'status'][
'message'], $hculist[
'status'][
'code']);
57 # got a valid RDC account list 59 $parms[
'RDCAcctList'] = $hculist[
'data'];
60 $parms[
'deplimit'] = (isset($dl) ? $dl : 0);
61 # Check first for valid session key, if not found, start session 62 # make sure prior deposit finished before re-using key? No, could just abandon one.... 64 $session = curdc_read($dbh,array(
'Cu'=>$parms[
'Cu'],
'Uid' => $HB_ENV[
'Uid'],
'MBRACCT'=>$parms[
'MBRACCT']));
66 if ($session[
'status'][
'response'] ==
'true' &&
67 isset($session[
'data'][
'vendorinfo'][
'Vendortime']) &&
68 ($vtime - $session[
'data'][
'vendorinfo'][
'Vendortime']) < 720) { # less than 12 minutes)
69 if ($session[
'data'][
'status'] ==
'S' ) {
71 # session key not used yet for any deposit activity (presumably just history) 72 # use this record instead of building a new one 73 # return info including depmessages 74 $parms[
'depositid'] = $session[
'data'][
'depositid'];
75 $parms[
'rdcstatus'] =
'S';
76 $parms[
'vendorinfo'] = $session[
'data'][
'vendorinfo'];
77 $return[
'data'][
'accounts']=$parms[
'vendorinfo'][
'accounts'];
78 $return[
'data'][
'terms']=$parms[
'vendorinfo'][
'terms'];
79 $return[
'data'][
'depmessages']=$parms[
'vendorinfo'][
'depmessages'];
80 $return[
'data'][
'scanlimit']=$parms[
'vendorinfo'][
'scanlimit'];
83 $parms[
'rdcstatus'] =
'S';
84 $parms[
'vendorinfo'] = array(Vendortime => $session[
'data'][
'vendorinfo'][
'Vendortime'],
85 accounts => $session[
'data'][
'vendorinfo'][
'accounts'],
86 scanlimit => $session[
'data'][
'vendorinfo'][
'scanlimit'],
87 depmessages => $session[
'data'][
'vendorinfo'][
'depmessages'],
88 terms => $session[
'data'][
'vendorinfo'][
'terms']);
89 $return[
'data'][
'accounts']=$parms[
'vendorinfo'][
'accounts'];
90 $return[
'data'][
'terms']=$parms[
'vendorinfo'][
'terms'];
91 # return basic info only if we are recycling a session 94 # no session to recycle, or only old sessions 95 # get the Bluepoint ScanLimit 96 # according to Bluepoint, this call also auto-creates a record 97 # for new users. So call this BEFORE the GetActiveStatus 98 # but still check status in case they were created w/pending status 99 $rdcresult = bluepointGetReviewLimits($parms);
100 # check return values for error 101 if ($rdcresult[
'status'][
'response'] ==
'false') {
102 throw new Exception(
"Bluepoint Connection failed \n{$rdcresult['status']['message']}",300);
104 if ($rdcresult[
'data'][
'Limits'][
'ScanLimit'] <= 0) {
105 # Scan limit negative or zero - don't know if this is even possible, but just in case... 106 throw new Exception(
'Bluepoint ScanLimit negative or zero',300);
108 $rdcActiveStatus = bluepointGetActiveStatus($parms);
110 if ($rdcActiveStatus[
'status'][
'response'] ==
'false') {
111 throw new Exception(
'Bluepoint Connection failed',300);
113 if ($rdcActiveStatus[
'data'][
'Status'] !=
'Active') {
114 $HB_Notices_ary = Get_NoticeInfo($dbh, $HB_ENV, $MC,
'M',
"mblNoRDC",
true);
115 if ($HB_Notices_ary[
'status'][
'code'] ==
'000') {
116 $noticeData = $HB_Notices_ary[
"notice"][0][
"notice_text"];
120 if ( strlen( $noticeData ) ) {
121 $message = $noticeData;
124 $message =
"Account not permitted for Remote Deposit. Please contact the Credit Union for more information";
127 throw new Exception($message, $code);
130 $parms[
'ScanLimit'] = $rdcresult[
'data'][
'Limits'][
'ScanLimit'];
134 $parms[
'rdcstatus'] =
'S';
136 if ($parms[
'HomeCUterms']) {
137 $rdcterms = hcuGetRDCterms($dbh, $HB_ENV, $MC);
139 if ($rdcterms[
'status'][
'response'] ==
'false') {
140 $e =
"HCU GetTerms call failed ({$rdcterms['status']['code']} {$rdcterms['status']['message']}";
141 throw new Exception($e ,301);
143 if ($rdcterms[
'data'][
'notice_popup'] == 1) {
144 $parms[
'rdcstatus'] =
'T';
147 $parms[
'rdcstatus'] =
'S';
150 $return = RDCPresentAccounts($parms, $hculist, $rdcresult, $rdcterms);
152 if ($return[
'status'][
'response'] ==
'false') {
154 throw new Exception($return[
'status'][
'message'], $return[
'status'][
'code']);
156 $depmessages=array();
157 if ($parms[
'ShowScanlimit']) {
158 $depmessages[] = array(
"MessageTextCd" =>
"HCU1",
"LocalizedText" =>
"Deposit Limit is " . sprintf(
"%.2f",
"{$rdcresult['data']['Limits']['ScanLimit']}"));
160 $parms[
'vendorinfo'] = array(
'Vendortime' => mktime(),
161 'userAgent' => $_SERVER[
'HTTP_USER_AGENT'],
162 'userIP' => $_SERVER[
'REMOTE_ADDR'],
163 'accounts' => $return[
'data'][
'accounts'],
164 'scanlimit' => $rdcresult[
'data'][
'Limits'][
'ScanLimit'],
165 'depmessages' => $depmessages,
166 'terms' => HCU_array_key_value(
'terms',$return[
'data']));
169 # start curdc record, return depositid as part of result 170 $depostat = curdc_start($dbh, $parms);
171 if ($depostat[
'status'][
'response'] ==
'false') {
173 throw new Exception(
'HomeCU Start Deposit Failed', 200);
175 $parms[
'depositid'] = $depostat[
'data'][
'depositid'];
178 $return[
'data'][
'depositid'] = $parms[
'depositid'];
179 $return[
'data'][
'depmessages']=$parms[
'vendorinfo'][
'depmessages'];
181 $depostat = curdc_setvinfo($dbh, array(
'Cu' => $parms[
'Cu'],
'depositid' => $parms[
'depositid'],
182 'vendorinfo' => json_encode($parms[
'vendorinfo'])));
183 if ($depostat[
'status'][
'response'] ==
'false') {
185 throw new Exception($depostat[
'status'][
'message'], $depostat[
'status'][
'code']);
187 }
catch (Exception $e) {
188 $return[
'status'][
'response'] =
'false';
189 $return[
'status'][
'code'] = $e->getCode();
190 $return[
'status'][
'message'] =
"(" . $e->getLine() .
") " . htmlspecialchars($e->getMessage(), ENT_QUOTES,
'UTF-8', FALSE);
195 function RDCaccept($dbh, $HB_ENV, $MC, $parms) {
196 # requires: $parms['Cu'] 197 # $parms['depositid'] 198 # Additional values retrieved and decoded from cutrusteddetail 199 # or from curdcstatus record using depositid as key 201 # assume we are going to succeed... 202 $return[
'status'][
'response'] =
'true';
203 $return[
'status'][
'code'] =
'000';
204 $return[
'status'][
'message'] =
'Success';
207 if (!isset($parms[
'Cu']) || !isset($parms[
'depositid'])) {
208 throw new Exception(
'Missing Parameters',100);
212 $depo = curdc_read($dbh, $parms);
213 if ($depo[
'status'][
'response'] ==
'false') {
214 throw new Exception(
'HomeCU DepositID not found',205);
217 # look up rdcTerms doc and then update to show acceptance 219 $noticeInfo = Get_NoticeInfo($dbh, $HB_ENV, $MC,
"P",
"rdcTerms",
false);
220 if ($noticeInfo[
"status"][
"code"] ==
"000" && HCU_array_item_count(
'notice',$noticeInfo)
221 && intval($noticeInfo[
'notice'][0][
'notice_id']) > 0) {
222 # action P post so set up the HCUPOST array 223 $HB_ENV[
'HCUPOST'][
'notice_id'] = $noticeInfo[
'notice'][0][
'notice_id'];
224 $HB_ENV[
'HCUPOST'][
'notice_type'] = $noticeInfo[
'notice'][0][
'notice_type'];
225 $HB_ENV[
'HCUPOST'][
'notice_device'] =
'P';
226 $HB_ENV[
"HCUPOST"][
'notice_response'] = array(
"answer" => 1);
227 # not sure if the next two are needed - 228 $HB_ENV[
"HCUPOST"][
'notice_cancel'] =
"0";
229 $HB_ENV[
'HCUPOST'][
'notice_msg_show'] = 1;
230 $noticeUpd = Update_NoticeInfo($dbh, $HB_ENV, $MC);
232 $return[
'status'][
'message'] =
'Accept Terms OK';
233 $vendorinfo = $depo[
'vendorinfo'];
234 $vendorinfo[
'terms']=
'';
235 $vendorinfo[
'Vendortime'] = mktime();
236 $parms[
'vendorinfo'] = $vendorinfo;
240 # update curdcstatus record 241 $parms[
'rdcstatus'] =
'O';
243 $depostat = curdc_setvinfo($dbh, array(
'Cu' => $parms[
'Cu'],
'depositid' => $parms[
'depositid'],
244 'rdcstatus' => $parms[
'rdcstatus'],
'vendorinfo' => json_encode($parms[
'vendorinfo'])));
245 if ($depostat[
'status'][
'response'] ==
'false') {
247 throw new Exception($depostat[
'status'][
'message'], $depostat[
'status'][
'code']);
250 }
catch (Exception $e) {
251 $return[
'status'][
'response'] =
'false';
252 $return[
'status'][
'code'] = $e->getCode();
253 $return[
'status'][
'message'] =
"(" . $e->getLine() .
") " . htmlspecialchars($e->getMessage(), ENT_QUOTES,
'UTF-8', FALSE);
257 function RDChistorylist($dbh, $parms) {
258 # requires: $parms['Cu'] 259 # $parms['depositid'] 260 # Additional values retrieved and decoded from cutrusteddetail 261 # or from curdcstatus record using depositid as key 263 # assume we are going to succeed... 264 $return[
'status'][
'response'] =
'true';
265 $return[
'status'][
'code'] =
'000';
266 $return[
'status'][
'message'] =
'Success';
269 if (!isset($parms[
'Cu']) || !isset($parms[
'depositid'])) {
270 throw new Exception(
'Missing Parameters',100);
274 $depo = curdc_read($dbh, $parms);
275 if ($depo[
'status'][
'response'] ==
'false') {
276 throw new Exception(
"HomeCU DepositID not found [{$parms['depositid']}]",205);
278 $rdcresult = bluepointGetCustomerHistory($parms);
279 if ($rdcresult[
'status'][
'response'] ==
'false') {
280 throw new Exception(
'Bluepoint Get History List call failed',305);
282 foreach ($rdcresult[
'data'][
'ItemList'] as $histkey =>$aval) {
283 foreach($aval as $ikey => $ival) {
285 foreach($ival as $zkey => $zval) {
286 $histitem[$zval[
'Parameter']] = $zval[
'Value'];
291 $rdcresult[
'data'][
'TransactionList'][$histkey][
'ReceiptReferenceNo']=$histitem[
'ItemRecID'];
292 $rdcresult[
'data'][
'TransactionList'][$histkey][
'transactionid']=$histitem[
'ItemRecID'];
293 $rdcresult[
'data'][
'TransactionList'][$histkey][
'transactiondttm']=$histitem[
'ScannedDate'];
294 $rdcresult[
'data'][
'TransactionList'][$histkey][
'submittedamount']=sprintf(
'%.2f',floatval($histitem[
'ItemAmount']));
295 $rdcresult[
'data'][
'TransactionList'][$histkey][
'currentamount']=sprintf(
'%.2f',floatval($histitem[
'AcceptedAmount']));
296 $rdcresult[
'data'][
'TransactionList'][$histkey][
'status']=$histitem[
'Status'];
297 $rdcresult[
'data'][
'TransactionList'][$histkey][
'statusdescr']=$histitem[
'Status'];
298 $rdcresult[
'data'][
'TransactionList'][$histkey][
'accountnumber']=$histitem[
'Account'];
300 $return[
'status'][
'message'] =
'Bluepoint History List OK';
301 $vendorinfo = (HCU_array_key_exists(
'vendorinfo',$depo) ? $depo[
'vendorinfo'] : array() );
302 $vendorinfo[
'Vendortime'] = mktime();
303 $parms[
'vendorinfo'] = $vendorinfo;
305 # update curdcstatus record 307 $depostat = curdc_setvinfo($dbh, array(
'Cu' => $parms[
'Cu'],
'depositid' => $parms[
'depositid'],
308 'vendorinfo' => json_encode($parms[
'vendorinfo'])));
309 if ($depostat[
'status'][
'response'] ==
'false') {
311 throw new Exception($depostat[
'status'][
'message'], $depostat[
'status'][
'code']);
313 $return[
'data']=$rdcresult[
'data'];
314 $return[
'data'][
'rdcvendor']=$depo[
'data'][
'rdcvendor'];
316 }
catch (Exception $e) {
317 $return[
'status'][
'response'] =
'false';
318 $return[
'status'][
'code'] = $e->getCode();
319 $return[
'status'][
'message'] =
"(" . $e->getLine() .
") " . htmlspecialchars($e->getMessage(), ENT_QUOTES,
'UTF-8', FALSE);
324 function RDChistorydetl($dbh, $parms) {
325 # coded for Ensenta only? 326 # requires: $parms['Cu'] 327 # $parms['transactionid'] 328 # Additional values retrieved and decoded from cutrusteddetail 329 # or from curdcstatus record using depositid as key 331 # assume we are going to succeed... 332 $return[
'status'][
'response'] =
'true';
333 $return[
'status'][
'code'] =
'000';
334 $return[
'status'][
'message'] =
'Success';
337 if (!isset($parms[
'Cu']) || !isset($parms[
'transactionid']) || !isset($parms[
'depositid'])) {
338 throw new Exception(
'Missing Parameters',100);
342 $depo = curdc_read($dbh, $parms);
343 if ($depo[
'status'][
'response'] ==
'false') {
344 throw new Exception(
'HomeCU DepositID not found',205);
346 # update curdcstatus record 347 $depostat = curdc_setvinfo($dbh, array(
'Cu' => $parms[
'Cu'],
'depositid' => $parms[
'depositid'],
348 'vendorinfo' => json_encode($parms[
'vendorinfo'])));
349 if ($depostat[
'status'][
'response'] ==
'false') {
351 throw new Exception($depostat[
'status'][
'message'], $depostat[
'status'][
'code']);
353 $return[
'data']=$rdcresult[
'data'];
356 }
catch (Exception $e) {
357 $return[
'status'][
'response'] =
'false';
358 $return[
'status'][
'code'] = $e->getCode();
359 $return[
'status'][
'message'] =
"(" . $e->getLine() .
") " . htmlspecialchars($e->getMessage(), ENT_QUOTES,
'UTF-8', FALSE);
364 function RDCdeposit($dbh, $parms) {
365 # requires: $parms['Cu'] 366 # $parms['depositid'] 369 # Additional values retrieved and decoded from cutrusteddetail 370 # or from curdcstatus record using depositid as key 372 # assume we are going to succeed... 373 $return[
'status'][
'response'] =
'true';
374 $return[
'status'][
'code'] =
'000';
375 $return[
'status'][
'message'] =
'Success';
377 if (!isset($parms[
'Cu']) || !isset($parms[
'depositid']) ||
378 !isset($parms[
'amount']) || !isset($parms[
'acctid']) ) {
379 throw new Exception(
'Missing Parameters', 100);
388 $depo = curdc_read($dbh, $parms);
389 if ($depo[
'status'][
'response'] ==
'false') {
390 throw new Exception(
'HomeCU DepositID not found', 205);
393 switch ($depo[
'data'][
'status']) {
395 $fail=
'Must accept terms of use before depositing funds';
398 $fail=
'Deposit has been rejected';
401 $fail=
'Deposit already completed';
405 if (!isset($parms[
'POSTAWAY'])) {
406 $fail=
'Deposit requires override confirmation';
411 throw new Exception($fail,229);
413 if (is_null($depo[
'data'][
'frontpath']) || is_null($depo[
'data'][
'backpath'])
414 || !getimagesize($depo[
'data'][
'frontpath']) || !getimagesize($depo[
'data'][
'backpath'])) {
415 throw new Exception(
'Check Images not found', 220);
417 $vendorinfo = $depo[
'data'][
'vendorinfo'];
420 $depostat = curdc_update($dbh, array(
'Cu' => $parms[
'Cu'],
'depositid' => $parms[
'depositid'],
421 'amount' => $parms[
'amount'],
'acctid' => $parms[
'acctid']));
422 if ($depostat[
'status'][
'response'] ==
'false') {
423 throw new Exception(
'HomeCU Update Deposit Amount Failed', 225);
426 $acctid = $parms[
'acctid'];
427 $hculist = RDCGetAccts($dbh, $parms, $acctid);
429 if ($hculist[
'status'][
'response'] !==
'true') {
430 throw new Exception(
'Invalid Deposit Account', 230);
432 if ( $vendorinfo[
'scanlimit'] < ($parms[
'amount'] * .01)) {
433 throw new Exception(
"Deposit Amount Exceeds Deposit Limit (" .
434 sprintf(
'%.2f',$vendorinfo[
'scanlimit']) .
")",231);
436 $parms[
'AccountNumber'] = $vendorinfo[
'accounts'][$acctid][
'suffix'];
437 # set default AccountType, then override if configured 438 $parms[
'AccountType'] = $vendorinfo[
'accounts'][$acctid][
'rdcdesc'];
439 switch ($vendorinfo[
'accounts'][$acctid][
'rdcdesc']) {
441 if (isset($parms[
'Ck_rdctype'])) {
442 $parms[
'AccountType'] = $parms[
'Ck_rdctype'];
446 if (isset($parms[
'Sv_rdctype'])) {
447 $parms[
'AccountType'] = $parms[
'Sv_rdctype'];
451 $parms[
'AccountType'] = $vendorinfo[
'accounts'][$acctid][
'rdcdesc'];
455 $parms[
'CheckFront'] = base64_encode(file_get_contents($depo[
'data'][
'frontpath']));
456 $parms[
'CheckBack'] = base64_encode(file_get_contents($depo[
'data'][
'backpath']));
457 $rdcresult = bluepointDepositItem($parms);
458 if ($rdcresult[
'status'][
'response'] ==
'false') {
459 throw new Exception(
'DepositItem call failed', 242);
461 # if no DepositStatus use Result instead 462 $rstat = (
"{$rdcresult['data']['DepositStatus']}" ==
"" ? $rdcresult[
'data'][
'Result'] : $rdcresult[
'data'][
'DepositStatus']);
463 # check return values for error 466 case "LimitExceeded":
468 case "TimeoutExceeded":
469 case "InvalidAdminCredentials":
470 case "InvalidCredentials":
471 case "UserUnauthorized":
472 case "InvalidRequestdata":
473 case "HubConnectionDown":
474 case "MitekConnectionDown":
475 case "DuplicateMicrNotAllowed":
476 $parms[
'rdcstatus'] =
'R';
477 $vendorinfo[
'Vendortime'] = mktime();
478 $vendorinfo[
'DepositStatus'] = $rstat;
479 $vendorinfo[
'Message'] = $rdcresult[
'data'][
'Message'];
480 $vendorinfo[
'DepositTime'] = date(
'YmdHis');
481 $depostat = curdc_setvinfo($dbh, array(
'Cu' => $parms[
'Cu'],
'depositid' => $parms[
'depositid'],
482 'rdcstatus' => $parms[
'rdcstatus'],
'vendorinfo' => json_encode($vendorinfo)));
483 if ($depostat[
'status'][
'response'] ==
'false') {
484 throw new Exception(
'HomeCU Update Vendorinfo Failed', 240);
486 throw new Exception($rdcresult[
'data'][
'DepositStatus'] .
' ' . $rdcresult[
'data'][
'Message'] .
' Deposit Cannot be processed as submitted', 241);
491 $receipt = (
"{$rdcresult['data']['ItemRecID']}" ==
"" ? $rdcresult[
'data'][
'BatchID'] .
"-" . $rdcresult[
'data'][
'BatchRecID'] : $rdcresult[
'data'][
'ItemRecID']);
492 $parms[
'rdcstatus'] =
'C';
493 $vendorinfo[
'Vendortime'] = mktime();
494 $vendorinfo[
'DepositStatus'] = $rstat;
495 $vendorinfo[
'Message'] = $rdcresult[
'data'][
'Message'];
496 $vendorinfo[
'Review'] = $rdcresult[
'data'][
'SentToReview'];
497 $vendorinfo[
'TransactionReceiptNumber'] = $receipt;
498 $vendorinfo[
'TransactionDateTime'] = date(
'c');
500 $depostat = curdc_setvinfo($dbh, array(
'Cu' => $parms[
'Cu'],
'depositid' => $parms[
'depositid'],
'frontaccept' =>
'Y',
501 'backaccept' =>
'Y',
'rdcstatus' => $parms[
'rdcstatus'],
'vendorinfo' => json_encode($vendorinfo)));
502 if ($depostat[
'status'][
'response'] ==
'false') {
503 throw new Exception(
'HomeCU Update Vendorinfo Failed', 240);
505 $return[
'status'][
'response'] =
'true';
506 $return[
'status'][
'message'] =
'Bluepoint Deposit Complete';
507 # this returns everything from Ensenta, but that will be a problem if we add other vendors 508 # pick a list of stuff to return and be consistent for everyone? 509 $return[
'data'] = $rdcresult[
'data'];
510 $return[
'data'][
'depositid'] = $parms[
'depositid'];
511 $return[
'data'][
'rdcstatus'] = $parms[
'rdcstatus'];
512 # use the Ensenta names for values the apps look for -- 513 $return[
'data'][
'TransactionReceiptNumber'] = $receipt;
514 $return[
'data'][
'TransactionDateTime'] = date(
'c');
515 $return[
'data'][
'MaskedAccountholderNumber'] = $vendorinfo[
'accounts'][$acctid][
'suffix'];
517 if (
"{$rdcresult['data']['ItemRecID']}" ==
"" ) {
518 $hcumessage =
"Your deposit request for account {$vendorinfo['accounts'][$acctid]['suffix']} has been received pending review";
521 $hcumessage =
"Your deposit request for account {$vendorinfo['accounts'][$acctid]['suffix']} has been received";
522 if ($rdcresult[
'data'][
'SentToReview'] ==
'true') {
523 $hcumessage .=
" pending review";
525 $hcumessage .=
". Your confirmation number is '{$rdcresult['data']['ItemRecID']}'. ";
526 $hcumessage .=
"Please save this number and refer to it if you need to contact the credit union regarding this transaction. ";
531 if ($parms[
'live'] && $parms[
'postHomeCU']) {
532 if ($rdcresult[
'data'][
'DepositStatus'] ==
'Passed' && $rdcresult[
'data'][
'SentToReview'] !=
'true') {
533 # post live transaction 534 list($statcode, $statdesc, $confcode) = post_pkt_track(
535 $vendorinfo[
'accounts'][$acctid][
'tomember'],
'ED', $vendorinfo[
'accounts'][$acctid][
'suffix'],
536 $rdcresult[
'data'][
'ItemRecID'], $parms[
'Ml'],
'', $vendorinfo[
'accounts'][$acctid][
'tomember'],
537 $parms[
'amount'], $parms[
'MBRACCT'],
'');
541 $return[
'data'][
'HCUReceiptMessage'] = $hcumessage;
544 }
catch (Exception $e) {
545 $return[
'status'][
'response'] =
'false';
546 $return[
'status'][
'code'] = $e->getCode();
547 $return[
'status'][
'message'] =
"(" . $e->getLine() .
") " . htmlspecialchars($e->getMessage(), ENT_QUOTES,
'UTF-8', FALSE);
552 function RDCGetAccts($dbh, $parms, $Acctid=
"") {
555 if (!isset($parms[
'Cu']) || !isset($parms[
'Uid']) || !isset($parms[
'MBRACCT'])) {
557 $AcctList[
'status'][
'response'] =
'false';
558 $AcctList[
'status'][
'code'] =
'910';
559 $AcctList[
'status'][
'message'] =
'Missing RDC Account Parameters'; # RDCGetAccts missing Cu/Uid/MBRACCT
566 $Uid = $parms[
'Uid'];
567 $Fset2 = $parms[
'Fset2'];
568 $Fset3 = $parms[
'Fset3'];
569 $balwhere = $parms[
'balwhere'];
570 $lnwhere = $parms[
'lnwhere'];
571 $MBRACCT = $parms[
'MBRACCT'];
573 # default allow deposit, loan pmt, credit card pmt 574 $rtxn = ( HCU_array_item_count(
'rtxn',$parms) == 0 ?
575 array(
'AT' => 1,
'LP' => 1,
'CP' => 1) :
576 json_decode($parms[
'rtxn'],TRUE) );
577 $savingsql = (!isset($parms[
'savingsql']) ?
578 "trim(accounttype)" :
579 $parms[
'savingsql'] );
580 $draftsql = (!isset($parms[
'draftsql']) ?
581 "trim(accounttype)" :
582 $parms[
'draftsql'] );
583 $loansql = (!isset($parms[
'loansql']) ?
586 $mbrsql = (!isset($parms[
'mbrsql']) ?
587 "trim(accountnumber)" :
591 # fetch transactions types 593 $sql =
"select ht.trancode, trim(t.trandesc), trim(ht.cudesc), t.specialproc 594 from cutrans t, cuhavetrans ht 596 and ht.trancode = t.trancode\n";
598 $sth = db_query($sql, $dbh);
600 # Return a line for each allowed transaction type. 603 for ($row = 0; list($code, $desc, $cudesc, $spec) = db_fetch_array($sth, $row); $row++) {
604 $txncodes{$code} = array($desc, $spec, $cudesc);
606 db_free_result($sth);
611 $sv_rdctype = (!isset($parms[
'sv_rdctype']) ?
'0' : $parms[
'sv_rdctype']);
612 $ck_rdctype = (!isset($parms[
'ck_rdctype']) ?
'1' : $parms[
'ck_rdctype']);
613 $ln_rdctype = (!isset($parms[
'ln_rdctype']) ?
'128' : $parms[
'ln_rdctype']);
614 $sv_rdctype = (str_word_count ( $sv_rdctype , 0 ,
'0123456789' ) > 1 ? $sv_rdctype :
"'$sv_rdctype'");
615 $ck_rdctype = (str_word_count ( $ck_rdctype , 0 ,
'0123456789' ) > 1 ? $ck_rdctype :
"'$ck_rdctype'");
616 $ln_rdctype = (str_word_count ( $ln_rdctype , 0 ,
'0123456789' ) > 1 ? $ln_rdctype :
"'$ln_rdctype'");
618 # find out how many valid accounts the member has: 619 $sql =
"WITH accountlist as ( 620 SELECT ab.accountnumber, 623 ua.accounttype as accounttype, 624 ua.certnumber as certnumber, 627 ua.view_transactions, 629 'DP' as cbtype, amount as currentbalance, 631 trim(ab.micraccount) as micraccount 632 FROM {$Cu}useraccounts as ua 633 INNER JOIN {$Cu}accountbalance as ab ON ab.accountnumber = ua.accountnumber 634 AND ab.accounttype = ua.accounttype 635 AND ua.certnumber = ua.certnumber 636 WHERE ua.user_id = $Uid 637 AND ua.accountnumber = '{$MBRACCT}' 638 AND ua.recordtype = 'D' 639 AND ab.may_deposit = true 641 SELECT lb.accountnumber, 648 ua.view_transactions, 650 lb.cbtype, currentbalance as currentbalance, 653 FROM {$Cu}useraccounts as ua 654 INNER JOIN {$Cu}loanbalance as lb ON lb.accountnumber = ua.accountnumber 655 AND lb.loannumber = ua.accounttype 656 WHERE ua.user_id =$Uid 657 AND ua.accountnumber = '{$MBRACCT}' 658 AND ua.recordtype = 'L' 659 AND lb.may_payment = true ) ";
661 if (HCU_array_key_exists(
'AT',$txncodes) && HCU_array_key_exists(
'AT',$rtxn)) {
662 # $txncodes is configured list @HCU - $rtxn is allowed list for RDC 665 $sql .=
"SELECT recordtype as tbl, 666 $mbrsql as rdcmember, trim(description) as description, 667 trim(display_name) as display_name, 668 trim(accounttype) as accounttype, $savingsql as suffix, 669 certnumber as certnumber, $sv_rdctype as rdctype, 670 display_order, trim(accountnumber) as accountnumber 672 WHERE recordtype = 'D' $balwhere 673 AND upper(deposittype) in ('S','N') 675 SELECT recordtype, $mbrsql as rdcmember, 676 trim(description), trim(display_name), 677 trim(accounttype), $draftsql, 678 certnumber, $ck_rdctype, display_order, 681 WHERE recordtype = 'D' $balwhere 682 AND upper(deposittype) = 'Y' ";
686 if (HCU_array_key_exists(
'LP',$txncodes) && HCU_array_key_exists(
'LP',$rtxn)) {
689 SELECT 'L', $mbrsql as rdcmember, 690 trim(description), trim(display_name), 691 trim(accounttype), $loansql,'0', $ln_rdctype, display_order, 694 WHERE recordtype = 'L' $lnwhere 695 AND currentbalance > 0 ";
696 if ($Fset2 & GetFlagsetValue(
"CU2_SPEC18")) {
697 $sql .=
" and (cbtype <> '18' or cbtype is null) ";
698 if (HCU_array_key_exists(
'CP',$rtxn)) {
700 SELECT 'C', $mbrsql as rdcmember, 701 trim(description), trim(display_name), 702 trim(loannumber), $loansql, '0', $ln_rdctype, display_order, 705 WHERE recordtype='L' $lnwhere 707 if (!($Fset2 & GetFlagsetValue(
"CU2_CC18SHOWZERO"))) {
708 $sql .=
" and currentbalance > 0 ";
713 $sql .=
" order by 6,2,3";
714 $acct_rs = db_query($sql, $dbh);
716 if (db_num_rows($acct_rs) == 0) {
718 $AcctList[
'status'][
'response'] =
'false';
719 $AcctList[
'status'][
'code'] =
'920';
720 $AcctList[
'status'][
'message'] = htmlspecialchars(
'No Eligible RDC <test>Accounts', ENT_QUOTES,
'UTF-8',FALSE); # RDCGetAccts no valid accounts
721 $AcctList[
'status'][
'sql'] = $sql;
724 $AcctList[
'status'][
'response'] =
'true';
725 $AcctList[
'status'][
'code'] =
'000';
726 $AcctList[
'status'][
'message'] =
'Success';
727 for ($row = 0; $drow = db_fetch_array($acct_rs, $row); $row++) {
729 $accounttype = $drow[
'accounttype'];
730 $suffix = $drow[
'suffix'];
731 $cert = $drow[
'certnumber'];
732 $rdctype = $drow[
'rdctype'];
744 $rdcdesc=
'CreditCard';
756 $rdcmember = $drow[
'rdcmember'];
757 if (strpos($accounttype,
"@")) {
758 list($jtype,$jacct) = explode(
"@",$accounttype);
765 $tokn = sha1(
"${Uid}${accounttype}${Cu}${rdctype}obl1vi0u5");
768 $desc = getAccountDescription($dbh, $Cu, $drow[
'accountnumber'], $drow[
'description'], $drow[
'accounttype'], $drow[
'display_name'], $Fset3, $drow[
'certnumber'],
false,
false);
769 $desc = htmlspecialchars($desc, ENT_QUOTES,
'UTF-8',FALSE);
770 $displaydesc = $desc;
772 $Accts[
"$tbl|$jacct|$jtype|$cert"][
'accounttype'] = $accounttype;
773 $Accts[
"$tbl|$jacct|$jtype|$cert"][
'suffix'] = $suffix;
774 $Accts[
"$tbl|$jacct|$jtype|$cert"][
'certnumber'] = $cert;
775 $Accts[
"$tbl|$jacct|$jtype|$cert"][
'acctclass'] = $tbl;
776 $Accts[
"$tbl|$jacct|$jtype|$cert"][
'description'] = $desc;
777 $Accts[
"$tbl|$jacct|$jtype|$cert"][
'tokn'] =
"$tokn";
778 $Accts[
"$tbl|$jacct|$jtype|$cert"][
'Uid'] =
"$Uid";
779 $Accts[
"$tbl|$jacct|$jtype|$cert"][
'trust'] =
"$trust";
780 $Accts[
"$tbl|$jacct|$jtype|$cert"][
'displaydesc'] =
"$displaydesc";
781 $Accts[
"$tbl|$jacct|$jtype|$cert"][
'rdctype'] = $rdctype;
782 $Accts[
"$tbl|$jacct|$jtype|$cert"][
'rdcdesc'] = $rdcdesc;
783 $Accts[
"$tbl|$jacct|$jtype|$cert"][
'rdcmember'] = $rdcmember;
786 if (!empty($Acctid)) {
787 # got an account identifier - return one only 788 $AcctList[
'data'][$Acctid]=$Accts[$Acctid];
790 $AcctList[
'data']=$Accts;
841 function RDCPresentAccounts($parms, $hculist, $rdcsent, $rdcterms) {
842 # build array list to send to app 844 # include terms to be accepted if they are provided 845 # include labels acctttl, descttl 846 $pass_along = $rdcsent; # GetReviewLimits result
847 $pass_along[
'data'][
'accounts']=$hculist[
'data'];
848 # Bluepoint doesn't filter accounts, just pass what we got from DB 849 # Bluepoint doesn't serve terms 12/5/2014 now serving from HCU 850 if (
sizeof($rdcterms) > 0)
851 $pass_along[
'data'][
'terms'] = $rdcterms[
'data'][
'terms'];
852 $pass_along[
'status'][
'response'] =
'true';
853 $pass_along[
'status'][
'code'] =
'000';
854 $pass_along[
'status'][
'message'] =
'Success';
858 function bluepointGetActiveStatus($parms) {
859 # uses: $parms['UIN'] 861 # $parms['AdminPass'] 866 if (!isset($parms[
'UIN']) || !isset($parms[
'serviceurl']) ||
867 !isset($parms[
'AdminID']) ||
868 !isset($parms[
'AdminPass']) ||
869 !isset($parms[
'RTN']) ||
870 !isset($parms[
'MBRACCT'])) {
871 throw new Exception(
"Missing Parameters");
873 $parms[
'AdminPass'] = htmlentities($parms[
'AdminPass'],ENT_COMPAT | ENT_XML1);
875 $soapString =
'<?xml version="1.0" encoding="utf-8"?>';
878 $soapString .=
"\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:blu=\"http://bluepoint.com/\">";
879 $soapString .=
"\n<soapenv:Header/>";
880 $soapString .=
"\n<soapenv:Body>";
881 $soapString .=
"<blu:GetCustomerActiveStatus> 883 <blu:UIN>{$parms['UIN']}</blu:UIN> 884 <blu:AdminID>{$parms['AdminID']}</blu:AdminID> 885 <blu:AdminPassword>{$parms['AdminPass']}</blu:AdminPassword> 886 <blu:RTN>{$parms['RTN']}</blu:RTN> 887 <blu:UserID>{$parms['MBRACCT']}</blu:UserID> 889 </blu:GetCustomerActiveStatus> 891 </soapenv:Envelope>\n";
893 $cmd =
"/usr/bin/curl --silent --data-binary '$soapString' -H 'Content-Type: text/xml; charset=utf-8'";
894 $cmd .=
" -H 'SOAPAction: \"http://bluepoint.com/IMobileVendorService/GetCustomerActiveStatus\"'";
895 $cmd .=
" {$parms['serviceurl']}";
898 $soapHeaders = array();
899 $soapHeaders[] =
"Content-Type: text/xml; charset=utf-8";
900 $soapHeaders[] =
'SOAPAction: "http://bluepoint.com/IMobileVendorService/GetCustomerActiveStatus"';
901 $response = embcurl($soapString, $soapHeaders, $parms[
'serviceurl']);
904 if ($parms[
"logging"] ==
"enabled") {
905 $logParms = $parms[
"environment"];
906 $logParms[
"SSOVendor"] = $parms[
'rdcvendor'];
907 $logParms[
"token"] = HCU_array_key_value(
'Token',$parms);
908 $logParms[
"txnId"] = time();
909 $logParms[
"logPoint"] =
"GetActiveStatus";
910 $logParms[
"request"] = $cmd;
911 $logParms[
"reply"] = $response;
912 LogSSOActivity($logParms);
914 $pos = strpos ( $response ,
'HCUERROR: ' );
915 if ($pos !==
false ) {
916 throw new Exception(substr($response,$pos));
918 if (empty($response)) {
919 throw new Exception(
"Empty Response");
921 # call parse function to format response array 922 $xmlreturn = bluepointGetXMLResponse($response,
'GetCustomerActiveStatusResult',
'http://bluepoint.com/');
923 if (!is_array($xmlreturn)) {
924 throw new Exception(
"RDC Invalid XML Response");
926 if (HCU_array_key_value(
'faultcode',$xmlreturn)) {
927 throw new Exception(
"RDC Fault {$xmlreturn['faultcode']} " . HCU_array_key_value(
'faultstring',$xmlreturn));
929 $return[
'status'][
'response'] =
'true';
930 $return[
'status'][
'code'] =
'000';
931 $return[
'status'][
'message'] =
'Success';
932 $return[
'data'] = $xmlreturn[0];
934 }
catch (Exception $e) {
935 $return[
'status'][
'response'] =
'false';
936 $return[
'status'][
'message'] = $e->getMessage();
940 function bluepointGetCustomerHistory($parms) {
941 # uses: $parms['UIN'] 943 # $parms['AdminPass'] 948 if (!isset($parms[
'UIN']) || !isset($parms[
'serviceurl']) ||
949 !isset($parms[
'AdminID']) ||
950 !isset($parms[
'AdminPass']) ||
951 !isset($parms[
'RTN']) ||
952 !isset($parms[
'MBRACCT']) ) {
953 throw new Exception(
"Missing Parameters");
956 $parms[
'AdminPass'] = htmlentities($parms[
'AdminPass'],ENT_COMPAT | ENT_XML1);
959 $soapString =
'<?xml version="1.0" encoding="utf-8"?>';
960 $soapString .=
"\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:blu=\"http://bluepoint.com/\">";
961 $soapString .=
"\n<soapenv:Header/>";
962 $soapString .=
"\n<soapenv:Body>";
963 $soapString .=
"<blu:GetCustomerHistory> 965 <blu:UIN>{$parms['UIN']}</blu:UIN> 966 <blu:AdminID>{$parms['AdminID']}</blu:AdminID> 967 <blu:AdminPassword>{$parms['AdminPass']}</blu:AdminPassword> 968 <blu:RTN>{$parms['RTN']}</blu:RTN> 969 <blu:UserID>{$parms['MBRACCT']}</blu:UserID> 971 </blu:GetCustomerHistory> 973 </soapenv:Envelope>\n";
975 $cmd =
"/usr/bin/curl --silent --data-binary '$soapString' -H 'Content-Type: text/xml; charset=utf-8'";
976 $cmd .=
" -H 'SOAPAction: \"http://bluepoint.com/IMobileVendorService/GetCustomerHistory\"'";
977 $cmd .=
" {$parms['serviceurl']}";
981 $soapHeaders = array();
982 $soapHeaders[] =
"Content-Type: text/xml; charset=utf-8";
983 $soapHeaders[] =
'SOAPAction: "http://bluepoint.com/IMobileVendorService/GetCustomerHistory"';
984 $response = embcurl($soapString, $soapHeaders, $parms[
'serviceurl']);
986 if ($parms[
"logging"] ==
"enabled") {
987 $logParms = $parms[
"environment"];
988 $logParms[
"SSOVendor"] = $parms[
'rdcvendor'];
989 $logParms[
"token"] = HCU_array_key_value(
'Token',$parms);
990 $logParms[
"txnId"] = time();
991 $logParms[
"logPoint"] =
"GetCustomerHistory";
992 $logParms[
"request"] = $cmd;
993 $logParms[
"reply"] = $response;
994 LogSSOActivity($logParms);
997 $pos = strpos ( $response ,
'HCUERROR: ' );
998 if ($pos !==
false ) {
999 throw new Exception(substr($response,$pos));
1001 if (empty($response)) {
1002 throw new Exception(
"RDC No Response");
1005 # call parse function to format response array 1006 $xmlreturn = bluepointGetXMLResponse($response,
'GetCustomerHistoryResult',
'http://bluepoint.com/');
1007 if (!is_array($xmlreturn)) {
1008 throw new Exception(
"RDC Invalid XML Response");
1010 if (HCU_array_key_value(
'faultcode',$xmlreturn)) {
1011 throw new Exception(
"RDC Fault {$xmlreturn['faultcode']} " . HCU_array_key_value(
'faultstring',$xmlreturn));
1014 $return[
'data']=$xmlreturn[0];
1024 $xmlitems = bluepointGetXMLResponse($response,
'ItemInfo',
'http://bluepoint.com/');
1025 if (!is_array($xmlitems)) {
1026 throw new Exception(
"RDC Invalid ItemInfo");
1028 if (HCU_array_key_value(
'faultcode',$xmlitems)) {
1029 throw new Exception(
"RDC Fault {$xmlitems['faultcode']} " . HCU_array_key_value(
'faultstring',$xmlitems));
1032 $return[
'status'][
'response'] =
'true';
1033 $return[
'status'][
'code'] =
'000';
1034 $return[
'status'][
'message'] =
'Success';
1035 $return[
'data'][
'ItemList']=$xmlitems;
1036 $return[
'data'][
'raw']=$response;
1039 }
catch (Exception $e) {
1040 $return[
'status'][
'response'] =
'false';
1041 $return[
'status'][
'message'] = $e->getMessage();
1042 $return[
'data'] = array();
1047 function bluepointGetReviewLimits($parms) {
1048 # uses: $parms['UIN'] 1050 # $parms['AdminPass'] 1055 if (!isset($parms[
'UIN']) || !isset($parms[
'serviceurl']) ||
1056 !isset($parms[
'AdminID']) ||
1057 !isset($parms[
'AdminPass']) ||
1058 !isset($parms[
'RTN']) ||
1059 !isset($parms[
'MBRACCT']) ) {
1060 throw new Exception(
"Missing Parameters");
1063 $parms[
'AdminPass'] = htmlentities($parms[
'AdminPass'],ENT_COMPAT | ENT_XML1);
1065 $soapString =
'<?xml version="1.0" encoding="utf-8"?>';
1066 $soapString .=
"\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:blu=\"http://bluepoint.com/\">";
1067 $soapString .=
"\n<soapenv:Header/>";
1068 $soapString .=
"\n<soapenv:Body>";
1069 $soapString .=
"<blu:GetReviewLimits> 1071 <blu:UIN>{$parms['UIN']}</blu:UIN> 1072 <blu:AdminID>{$parms['AdminID']}</blu:AdminID> 1073 <blu:AdminPassword>{$parms['AdminPass']}</blu:AdminPassword> 1074 <blu:RTN>{$parms['RTN']}</blu:RTN> 1075 <blu:UserID>{$parms['MBRACCT']}</blu:UserID> 1077 </blu:GetReviewLimits> 1079 </soapenv:Envelope>\n";
1082 $cmd =
"/usr/bin/curl --silent --data-binary '$soapString' -H 'Content-Type: text/xml; charset=utf-8'";
1083 $cmd .=
" -H 'SOAPAction: \"http://bluepoint.com/IMobileVendorService/GetReviewLimits\"'";
1084 $cmd .=
" {$parms['serviceurl']}";
1087 $soapHeaders = array();
1088 $soapHeaders[] =
"Content-Type: text/xml; charset=utf-8";
1089 $soapHeaders[] =
'SOAPAction: "http://bluepoint.com/IMobileVendorService/GetReviewLimits"';
1091 $response = embcurl($soapString,$soapHeaders,$parms[
'serviceurl']);
1093 if ($parms[
"logging"] ==
"enabled") {
1094 $logParms = $parms[
"environment"];
1095 $logParms[
"SSOVendor"] = $parms[
'rdcvendor'];
1096 $logParms[
"token"] = HCU_array_key_value(
'Token',$parms);
1097 $logParms[
"txnId"] = time();
1098 $logParms[
"logPoint"] =
"GetReviewLimits";
1099 $logParms[
"request"] = $cmd;
1100 $logParms[
"reply"] = $response;
1101 LogSSOActivity($logParms);
1104 $pos = strpos ( $response ,
'HCUERROR: ' );
1105 if ($pos !==
false ) {
1106 throw new Exception(substr($response,$pos));
1108 if (empty($response)) {
1109 throw new Exception(
"RDC No Response");
1111 # call parse function to format response array 1112 $xmlreturn = bluepointGetXMLResponse($response,
'LimitValue',
'http://bluepoint.com/');
1113 if (!is_array($xmlreturn)) {
1114 throw new Exception(
"RDC Invalid LimitValue Response");
1116 if (HCU_array_key_value(
'faultcode',$xmlreturn)) {
1117 throw new Exception(
"RDC Fault {$xmlreturn['faultcode']} " . HCU_array_key_value(
'faultstring',$xmlreturn));
1120 $return[
'status'][
'response'] =
'true';
1121 $return[
'status'][
'code'] =
'000';
1122 $return[
'status'][
'message'] =
'Success';
1123 foreach ($xmlreturn as $val) {
1124 $return[
'data'][
'Limits'][$val[
'Limit']] = $val[
'Value'];
1127 }
catch (Exception $e) {
1128 $return[
'status'][
'response'] =
'false';
1129 $return[
'status'][
'message'] = $e->getMessage();
1130 $return[
'data'] = array();
1135 function bluepointDepositItem($parms) {
1136 # uses: $parms['partnerid'] 1137 # $parms['serviceurl'] 1138 # $parms['certfile'] 1139 # $parms['SessionStateId'] 1143 if (!isset($parms[
'UIN']) || !isset($parms[
'serviceurl']) ||
1144 !isset($parms[
'AdminID']) || !isset($parms[
'AdminPass']) ||
1145 !isset($parms[
'RTN']) || !isset($parms[
'AccountNumber']) ||
1146 !isset($parms[
'CheckFront']) || !isset($parms[
'CheckBack']) ||
1147 !isset($parms[
'amount'])) {
1148 throw new Exception(
"Missing Parameters");
1151 $deposittime = date(
'c');
1153 $parms[
'AdminPass'] = htmlentities($parms[
'AdminPass'],ENT_COMPAT | ENT_XML1);
1155 $soapString =
'<?xml version="1.0" encoding="utf-8"?>';
1156 $soapString .=
"\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:blu=\"http://bluepoint.com/\"> 1161 <blu:UIN>{$parms['UIN']}</blu:UIN> 1162 <blu:AdminID>{$parms['AdminID']}</blu:AdminID> 1163 <blu:AdminPassword>{$parms['AdminPass']}</blu:AdminPassword> 1164 <blu:RTN>{$parms['RTN']}</blu:RTN> 1165 <blu:Amount>{$parms['amount']}</blu:Amount> 1166 <blu:AccountNumber>{$parms['AccountNumber']}</blu:AccountNumber> 1167 <blu:UserID>{$parms['MBRACCT']}</blu:UserID> 1168 <blu:Base64FrontImage>{$parms['CheckFront']}</blu:Base64FrontImage> 1169 <blu:Base64BackImage>{$parms['CheckBack']}</blu:Base64BackImage> 1170 <blu:AccountType>{$parms['AccountType']}</blu:AccountType> 1174 </soapenv:Envelope>\n";
1177 $cmd =
"/usr/bin/curl --silent --data-binary '$soapString' -H 'Content-Type: text/xml; charset=utf-8'";
1178 $cmd .=
" -H 'SOAPAction: \"http://bluepoint.com/IMobileVendorService/DepositItem\"'";
1179 $cmd .=
" {$parms['serviceurl']}";
1184 $soapHeaders = array();
1185 $soapHeaders[] =
"Content-Type: text/xml; charset=utf-8";
1186 $soapHeaders[] =
'SOAPAction: "http://bluepoint.com/IMobileVendorService/DepositItem"';
1187 $response = embcurl($soapString, $soapHeaders, $parms[
'serviceurl']);
1189 if ($parms[
"logging"] ==
"enabled") {
1190 $logParms = $parms[
"environment"];
1191 $logParms[
"SSOVendor"] = $parms[
'rdcvendor'];
1192 $logParms[
"token"] = $parms[
'Token'];
1193 $logParms[
"txnId"] = time();
1194 $logParms[
"logPoint"] =
"DepositItem";
1195 $logParms[
"request"] = $cmd;
1196 $logParms[
"reply"] = $response;
1197 LogSSOActivity($logParms);
1200 $pos = strpos ( $response ,
'HCUERROR: ' );
1201 if ($pos !==
false ) {
1202 throw new Exception(substr($response,$pos));
1204 if (empty($response)) {
1205 throw new Exception(
"RDC No Response");
1207 # call parse function to format response array 1209 $xmlreturn = bluepointGetXMLResponse($response,
'DepositItemResult',
'http://bluepoint.com/');
1210 if (!is_array($xmlreturn)) {
1211 throw new Exception(
"RDC Invalid XML Response");
1213 if (HCU_array_key_value(
'faultcode',$xmlreturn)) {
1214 throw new Exception(
"RDC Fault {$xmlreturn['faultcode']} " . HCU_array_key_value(
'faultstring',$xmlreturn));
1216 $return[
'status'][
'response'] =
'true';
1217 $return[
'status'][
'code'] =
'000';
1218 $return[
'status'][
'message'] =
'Success';
1219 $return[
'data'] = $xmlreturn[0];
1221 }
catch (Exception $e) {
1222 $return[
'status'][
'response'] =
'false';
1223 $return[
'status'][
'message'] = $e->getMessage();
1224 $return[
'data'] = array();
1229 function bluepointGetXMLResponse($rdcXML, $rdcCONT, $rdcNS) {
1231 $xml = simplexml_load_string($rdcXML,
"SimpleXMLElement",LIBXML_NOWARNING);
1232 if (!is_object($xml)) {
1233 throw new Exception(
"Invalid XML");
1236 $xml->registerXPathNamespace(
's',
"http://schemas.xmlsoap.org/soap/envelope/");
1237 $errorresponse = $xml->xpath(
"//s:Fault");
1238 if(is_array($errorresponse) && count($errorresponse)) {
1239 $resp_arr = array(
'faultcode' => $errorresponse[0]->faultcode,
1240 'faultstring' => $errorresponse[0]->faultstring);
1242 $xml->registerXPathNamespace(
'rdc', $rdcNS);
1243 $dataresponse = $xml->xpath(
"//rdc:$rdcCONT");
1244 $resp_arr = objectToArray($dataresponse);
1247 }
catch (Exception $e) {