$prompt) { if ($end_row) { $start_row = false; echo "\n"; } if (($i % 2) == 0) { $start_row = true; $end_row = false; echo "
\n". "
 
"; } $id=uniqid(); echo "
". " ".$obj->$field.''. "\n
"; $i++; if (($i % 2) == 0) { $end_row = true; } } if ($start_row) echo "\n
"; } function display_pending_form() { $str .= "
\n"; $str .= "
"; $str .= <<

Account Validation Pending

END_START_DIV3; $str .= '

Trial Transaction Trasmission In Progress

'; $str .= '

Note:You be able to enter the trial amounts in this space when they are ready.

'; $str .= "
"; $str .= "
"; $str .= <<

Three small amounts (each less than $1.00) are now being transmitted to the bank account number you provided. It can take about four business days for the transactions to appear in your account.

When these 3 amounts are listed in your bank account, enter all three to validate your agreement. Use the 0.00 format for your entries (10 cents would be entered as 0.10).

Contact your bank (or check on-line) for these recent transactions.

END_INS; $str .= " "; return $str; } function build_authorization_details($type, $flds, $title,$fee, $current_option,$acct) { if ($acct['authorization_vars']->status == 'Pending' ) $details = display_pending_form(); else if ($acct['authorization_vars']->status == 'Waiting' ) $details = display_validation_form(); else if ($acct['authorization_vars']->status == 'Authorized') $details = display_payment_details(); global $payee; global $account_id; $str = "
\n"; $str .= <<

$title Payment Authorization Details

For Your Files
To save a PDF copy of your current Account Authorization agreement:

Download Agreement
Note: To change your current Authorization, you must Revoke your existing Authorization before entering a new one. After revocation a new Authorization Agreement screen will appear.
- To Revoke your Authorization for $current_option select the button below.
Revoke $current_option Authorization
$details
END_START_DIV2; return $str; } function display_payment_details() { $obj = getResource('payment_account'); if (is_object($obj)) $payment_account = get_object_vars($obj); else $payment_account = $obj; $str .= "
\n"; $str .= "
"; $str .= <<

Current Account Authorization

END_START_DIV4; foreach($payment_account as $key=>$value) { if ($value->name) { $str .= "
\n"; $str .= "
"; $str .= "".$value->name.""; $str .= "
\n"; $str .= "
"; $str .= $value->value; $str .= "
\n"; $str .= "
\n"; } } $str .= "
\n"; return $str; } function display_validation_form() { global $payee; global $business_name; global $account_id; $str .= "
\n"; $str .= "
"; $str .= <<

Account Validation

END_START_DIV3; $str .= "
\n"; $str .= "
\n"; $str .= "
"; $str.= ""; $str .= "\n
\n"; $str .= "
"; $str.= ""; $str .= "\n
\n"; $str .= "
"; $str.= ""; $str .= "\n
\n"; $str .= << Validate END_BUTTON; if (! $start_row) $str .= "\n
\n"; $str .= "
"; $str .= '

It is important that you wait until all three transactions have been confirmed by your bank.

'; $str .= "
"; $str .= "
"; $str .= <<

Three small amounts (each less than $1.00) have been transmitted to the bank account number you provided. It can take about four business days for the all of these transactions to appear in your account.

When these 3 amounts are listed in your bank account, enter all three to validate your agreement. Use the 0.00 format for your entries (10 cents would be entered as 0.10).

Contact your bank (or check on-line) for these recent transactions.

END_INS; $str .= " "; return $str; } function build_authorization_form($type, $flds, $title,$fee, $config_option) { global $payee; global $business_name; global $account_id; $str = "
\n"; $str .= <<

$title Payment Authorization Details

END_START_DIV; $str .= "

Please provide the following payment account details so you can receive your automatic payments via $title.
"; if ($fee) { $fee = trim($fee,'$'); if (is_numeric($fee) && $fee > 0) { $fee = number_format($fee,2); $str .= " (A processing fee of $$fee will be deducted from your payment for this option).

"; } } $str .= "

\n"; $str .= "\n"; $str .= ''; $str .= ''; // $str .= "

$payee will be the designated Payee.

"; $str .= "

The agreement below is between $payee (Payee) and $business_name (The Company) .

"; $str .= ''; $str .= ''; // $str .= "\n"; $start_row = false; $col_count = 1; $cols_span = "span_12_of_12"; foreach($flds as $key=>$value) { $post_name ='_'.$key.'_'; if (is_array($value)) { $name = $value[0]; $validator = $value[1]; if ($validator == 'fixed') continue; if ($name == 'row') { $start_row = true; $col_count = $value[1]; if ($col_count == 1) $cols_span = "span_12_of_12"; else $cols_span = "span_1_of_$col_count"; $str .= "
\n"; continue; } if ($name == 'end_row') { $start_row = false; $col_count = 1; $str .= "\n
\n"; $cols_span = "span_12_of_12"; continue; } if ($name == 'text') { $value = $value[1]; if (! $start_row) $str .= "
\n"; $str .= "
"; $str .= $value; $str .= "\n
\n"; if (! $start_row) $str .= "\n
\n"; continue; } if ($validator == 'text' || $validator == 'masked') { if ($validator == 'text') $validator_class = $value[2]; else $validator_class = $value[3]; $input_id = uniqid(); if (! $start_row) $str .= "
\n"; $str .= "
"; $str.= ""; $str .= "\n
\n"; if (! $start_row) $str .= "\n
\n"; continue; } if ($validator == 'choice') { $sel_id = uniqid(); if (! $start_row) $str .= "
\n"; $str .= "
"; $str .= " "; $choices = $value[2]; $choices = explode(',',$choices); $str .= ""; $str .= "\n
\n"; if (! $start_row) $str .= "\n
\n"; continue; } } else { $name = $value; } $input_id = uniqid(); if (! $start_row) $str .= "
\n"; $str .= "
"; $str.= ""; $str .= "\n
\n"; if (! $start_row) $str .= "\n
\n"; } // $str .= "
\n"; // $str .= ""; $str .= 'I Wish to Recieve Payments Via: '.$title.' '; $str .= "

By submitting this form you are agreeing to receive future payments to the account or address information described above.

All pending and future payments will be sent, as described above, until the agreement is revoked.

"; $str .= "
"; $str .= "\n
\n\n"; return $str; } function send_pdf() { $obj = getResource('payment_account'); $payment_account = get_object_vars($obj); // We'll be outputting a PDF header('HTTP/1.1 200 OK'); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header('Date: ' . date("D M j G:i:s T Y")); header('Last-Modified: ' . date("D M j G:i:s T Y")); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); // required for certain browsers header("Pragma: public"); header('Content-type: application/pdf'); $pdf = $payment_account['authorization_vars']->authorization_snapshot; $pdf = base64_decode($pdf); header("Content-Length: " . strlen($pdf)); header("Content-Transfer-Encoding: Binary"); // add header('Content-Disposition: attachment; filename="authorization.pdf"'); print $pdf; } function validate_payment_account() { $obj = getResource('payment_account'); $payment_account = get_object_vars($obj); $auth = $payment_account['authorization_vars']; $trial[] = $auth->trial_amt_1; $trial[] = $auth->trial_amt_2; $trial[] = $auth->trial_amt_3; $amt = $_POST['_amt_']; sort($amt); sort($trial); // error_log('amt :'.var_export($amt,true)); error_log('trial :'.var_export($trial,true)); // foreach($amt as $key=>$value) { if ($trial[$key] != $value) return "NO MATCH"; } error_log("Got past ... "); return postResource('payment_account/validation'); } function build_summary_table($summary_data) { $id=uniqid('tbl_'); $str = ''; $str .= "\n"; $str .= "\n"; foreach($summary_data as $obj) { $str .= "". "\n"; } $str .= '
Target Payment DateAmountPayment TypeStatusMedia Source
$obj->duedate$$obj->payment$obj->payment_type$obj->payment_status$obj->custom_tracking
'; $str .= << var oTable = jQuery('#$id').dataTable( { "bJQueryUI": true, "sPaginationType": "full_numbers", "sDom": '<"H"RlCfr>t<"F"ip>', "oColVis": { "sSize": "css" } } ); END_IT; return $str; } function build_payment_table($payment_data) { $id=uniqid('tbl_'); $str = ''; $str .= "\n"; $str .= "\n"; foreach($payment_data as $obj) { $str .= "". "\n"; } $str .= '
Settlement DateAmountPayment TypeMedia Source
$obj->complete_date$$obj->payment$obj->payment_type$obj->custom_tracking
'; $str .= << var oTable = jQuery('#$id').dataTable( { "bJQueryUI": true, "sPaginationType": "full_numbers", "sDom": '<"H"RlCfr>t<"F"ip>', "oColVis": { "sSize": "css" } } ); END_IT; return $str; } ?>