function process_auth() { // response fields indicating status of transaction $approval_code = $_POST["approval_code"]; $status = $_POST["status"]; $oid = $_POST["oid"]; // get cvv/avs codes from approval code $check_code = get_result_from_code($approval_code); if (!check_ccv_code($check_code)) { echo "<strong>CVV code was not verified, transaction could not be processed</strong><br><br>"; // echo "ACode: $approval_code<br>"; // echo "OID: $oid<br>"; report_blocked_transaction(); return; } if (!check_avs_code($check_code)) { echo "<strong>Address was not verified</strong>"; } // ok, we have valid transaction. echo "Processing transaction<br><br>"; // make postauth transaction $post_data['txntype'] = 'postauth'; $post_data['oid'] = $oid; // add passed params as well $post_data['chargetotal'] = $_POST["chargetotal"]; $post_data['userid'] = $_POST["userid"]; $post_data['itemid'] = $_POST["itemid"]; $post_data['x_payment'] = urldecode($_POST["x_payment"]); $post_data['x_addr'] = urldecode($_POST["x_addr"]); $post_data['x_aprcode'] = $approval_code; $post_data['x_email'] = urldecode($_POST["x_email"]); $post_data['x_ccshort'] = $_POST["x_ccshort"]; exec_shop_call($post_data); exit; }
//echo "expyear: " . $expyear . "<br>"; //echo "CVV Code: " . $CVVCode . "<br>"; echo "<br><br><br><br>Processing transaction. do not press any keys or back button to avoid double charges....<br><br><br><br><br>"; //create array of data to be posted $post_data['txntype'] = "preauth"; $post_data['chargetotal'] = $chargetotal; $post_data['userid'] = $userid; $post_data['itemid'] = $itemid; $ccn1 = substr($cardnumber, -4, 4); $post_data['x_payment'] = "{$cctype} ending in {$ccn1}<br>Expires {$expmonth}/{$expyear}"; $post_data['x_addr'] = "{$bname} ({$userid})<br>{$baddr1}<br>{$bcity}<br>{$bstate} {$bzip}<br>{$country}<br>"; $post_data['x_auth'] = 1; $post_data['x_email'] = $_POST['x_email']; $post_data['bname'] = $bname; $post_data['baddr1'] = $baddr1; $post_data['bcity'] = $bcity; $post_data['bzip'] = $bzip; if ($bcountry == "US") { $post_data['bstate'] = $bstate; } else { $post_data['bstate2'] = $bcountry; } $post_data['bcountry'] = $bcountry; $post_data['cctype'] = $cctype; $post_data['cardnumber'] = $cardnumber; $post_data['expmonth'] = $expmonth; $post_data['expyear'] = $expyear; $post_data['cvm'] = $CVVCode; $post_data['x_ccshort'] = substr($cardnumber, 0, 4) . ".." . substr($cardnumber, -4, 4); exec_shop_call($post_data);