Skip to content

Commit

Permalink
Cleans up pay later billing [#975]
Browse files Browse the repository at this point in the history
  • Loading branch information
dleffler committed Apr 17, 2013
1 parent 8628849 commit 27c0675
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
11 changes: 6 additions & 5 deletions framework/modules/ecommerce/billingcalculators/cash.php
Expand Up @@ -63,9 +63,10 @@ function process($method, $opts, $params, $invoice_number) {
$object->errorCode = 0;
$opts->result = $object;
// $opts->result->payment_status = "Pending";
$opts->result->payment_status = gt("Payment Due");
$opts->result->payment_status = gt("complete");
if ($opts->cash_amount < $order->grand_total) $opts->result->payment_status = gt("payment due");
$method->update(array('billing_options' => serialize($opts)));
$this->createBillingTransaction($method, number_format($order->grand_total, 2, '.', ''), $opts->result, 'pending');
$this->createBillingTransaction($method, number_format($order->grand_total, 2, '.', ''), $opts->result, $opts->result->payment_status);
return $object;
}

Expand Down Expand Up @@ -135,15 +136,15 @@ function showOptions() {
}

function getAVSAddressVerified($billingmethod) {
return 'X';
return '';
}

function getAVSZipVerified($billingmethod) {
return 'X';
return '';
}

function getCVVMatched($billingmethod) {
return 'X';
return '';
}
}

Expand Down
16 changes: 8 additions & 8 deletions framework/modules/ecommerce/billingcalculators/paylater.php
Expand Up @@ -62,15 +62,15 @@ function process($method, $opts, $params, $invoice_number) {
$object = new stdClass();
$object->errorCode = 0;
$opts->result = $object;
// $opts->result->payment_status = "Pending";
$opts->result->payment_status = gt("Payment Due");
$method->update(array('billing_options' => serialize($opts)));
$this->createBillingTransaction($method, number_format($order->grand_total, 2, '.', ''), $opts->result, 'pending');
$opts->result->payment_status = gt("complete");
if ($opts->cash_amount < $order->grand_total) $opts->result->payment_status = gt("payment due");
$method->update(array('billing_options' => serialize($opts),'transaction_state'=>$opts->result, $opts->result->payment_status));
$this->createBillingTransaction($method, number_format($order->grand_total, 2, '.', ''), $opts->result, $opts->result->payment_status);
return $object;
}

function userForm($config_object = null, $user_data = null) {
$form = '<h4>'.gt('I plan to pay for this purchase later.').'</h4>';
$form = '<h4>'.gt('I will pay for this purchase later.').'</h4>';

$cash_amount = new hiddenfieldcontrol(0, 20, false, 20, "money", true);
$cash_amount->filter = 'money';
Expand Down Expand Up @@ -135,15 +135,15 @@ function showOptions() {
}

function getAVSAddressVerified($billingmethod) {
return 'X';
return '';
}

function getAVSZipVerified($billingmethod) {
return 'X';
return '';
}

function getCVVMatched($billingmethod) {
return 'X';
return '';
}
}

Expand Down
Expand Up @@ -31,7 +31,7 @@
{icon class=add controller="ecomconfig" action="edit_discount" text="Create a New Store Discount"|gettext}

{if $page|@count > 0}
<h2>{"Modify existing group discount"|gettext}</h2>
<h2>{"Modify existing discount"|gettext}</h2>
{pagelinks paginate=$page top=1}
<table id="discounts" class="exp-skin-table">
<thead>
Expand Down

0 comments on commit 27c0675

Please sign in to comment.