// Now try to run the card processor
$ccResult = $CcProcessor->processPayment( $payment, $billing );
+ // echo '<pre>$ccResult: ' . print_r( $ccResult, true ) . '</pre>';
// If successful submission - say we're complete
if ( is_array( $ccResult ) && isset( $ccResult['status'] ) && $ccResult['status'] == 1 ) {
$payment_id = implode( '-', $invoices );
$result = $this->processPayment( $account_id, $payment_id, $amount );
// echo '<pre>$result: ' . print_r( $result, true ) . '</pre>';
+
if ( $result['status'] === 1 ) {
// Need to record the payment.
// Set transaction_time to current time.
$_REQUEST['transaction_time'] = date( 'Y-m-d H:i:s' );
+ $ccProcessor = $this->config['billing_settings']['proc_methods'];
+
// Create new payment.
$payment_id = $this->createPayment( $account_id, $amount, 'Credit Card' );
// Make the Payment using Billing Support Class
$errors = $BillingSupport->makePayment( $account_id, $invoices, $amount );
- echo '<pre>$errors: ' . print_r( $errors, true ) . '</pre>';
+ // echo '<pre>$errors: ' . print_r( $errors, true ) . '</pre>';
// Errors will be an array
if ( isset( $errors ) && !empty( $errors ) ) {
{/if}
- <form id="PaymentForm" action="{$thisUrl}?page={$thisPage}&glm_action=billing&option=makePayment" method="post">
+ <form {if $billing_settings.proc_methods == 4} id="nonce-form"{else} id="PaymentForm"{/if} action="{$thisUrl}?page={$thisPage}&glm_action=billing&option=makePayment" method="post">
<input type="hidden" name="page" value="{$thisPage}" />
<input type="hidden" name="glm_action" value="billing" />
<input type="hidden" name="option" value="createPayment" />
{* Only if payments types are setup *}
{include file='common/billing/paymentForm.html'}
- <input class="button button-primary" type="submit" value="Make Payment">
+ <input class="button button-primary" type="submit" value="Make Payment" {if $billing_settings.proc_methods == 4} onclick="onGetCardNonce(event)"{/if}>
{else}
You don't have any unpaid invoices!
</div>
<script>
+{if $billing_settings.proc_methods == 4}
+ var billingFieldsReq = [
+ { fieldName: 'invoice_number', fieldLabel: 'Invoice Number' },
+ {if $settings.billing_contact_name_enabled}
+ { fieldName: 'billing_contact_name', fieldLabel: 'Billing Contact Name' },
+ {else}
+ { fieldName: 'billing_fname', fieldLabel: 'Billing First Name' },
+ { fieldName: 'billing_lname', fieldLabel: 'Billing Last Name' },
+ {/if}
+ { fieldName: 'billing_addr1', fieldLabel: 'Billing Address' },
+ { fieldName: 'billing_city', fieldLabel: 'Billing City' },
+ { fieldName: 'billing_state', fieldLabel: 'Billing State' },
+ { fieldName: 'billing_zip', fieldLabel: 'Billing Zip' },
+ { fieldName: 'email', fieldLabel: 'Email Address' },
+ { fieldName: 'amount', fieldLabel: 'You have to select at least one invoice with an amount due' },
+ ];
+{/if}
jQuery(document).ready(function($){
$('#billing-invoice-select').change(function(){