Skip to content

Commit 8bfa816

Browse files
committed
updates to charge_card adding handling for null cc
1 parent 5a2149b commit 8bfa816

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/cc.inc.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,12 @@ function charge_card($custid, $amount = false, $invoice = false, $module = 'defa
346346
//$cc = $data['cc'];
347347
$ccs = parse_ccs($data);
348348
$cc = isset(App::variables()->request['ot_cc']) && isset($ccs[App::variables()->request['ot_cc']]) ? App::decrypt($ccs[App::variables()->request['ot_cc']]['cc']) : App::decrypt($data['cc']);
349+
if (is_null($cc)) {
350+
if (isset($webpage) && $webpage == true) {
351+
add_output('<div class="container alert alert-danger"><strong>Error! Bad CC Number! </strong>This Credit-Card Number has been determined unusable or bad.</div>');
352+
}
353+
return $retvall;
354+
}
349355
$cc = trim($cc);
350356
$cc = str_replace([' ', '_', '-'], ['', '', ''], $cc);
351357
$badcc = get_bad_cc();

0 commit comments

Comments
 (0)