Skip to content

Commit

Permalink
remove credit field from billing_post()
Browse files Browse the repository at this point in the history
  • Loading branch information
antonraharja committed Jun 25, 2016
1 parent 9785e0d commit 162ca60
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion web/lib/fn_billing.php
Expand Up @@ -26,7 +26,7 @@
* @param float $credit
* @return boolean TRUE if posted
*/
function billing_post($smslog_id,$rate,$credit,$count,$charge) {
function billing_post($smslog_id,$rate,$count,$charge) {
$ret = core_call_hook();
return $ret;
}
Expand Down
8 changes: 4 additions & 4 deletions web/plugin/feature/simplebilling/fn.php
@@ -1,12 +1,12 @@
<?php
defined('_SECURE_') or die('Forbidden');

function simplebilling_hook_billing_post($smslog_id, $rate, $credit, $count, $charge) {
function simplebilling_hook_billing_post($smslog_id, $rate, $count, $charge) {
$ok = false;
_log("saving smslog_id:" . $smslog_id . " rate:" . $rate . " credit:" . $credit . " count:" . $count . " charge:" . $charge, 2, "simplebilling post");
$db_query = "INSERT INTO " . _DB_PREF_ . "_tblBilling (post_datetime,smslog_id,rate,credit,count,charge,status) VALUES ('" . core_get_datetime() . "','$smslog_id','$rate','$credit','$count','$charge','0')";
_log("saving smslog_id:" . $smslog_id . " rate:" . $rate . " count:" . $count . " charge:" . $charge, 2, "simplebilling_hook_billing_post");
$db_query = "INSERT INTO " . _DB_PREF_ . "_tblBilling (post_datetime,smslog_id,rate,count,charge,status) VALUES ('" . core_get_datetime() . "','$smslog_id','$rate','$count','$charge','0')";
if ($id = @dba_insert_id($db_query)) {
_log("saved smslog_id:" . $smslog_id . " id:" . $id, 2, "simplebilling post");
_log("saved smslog_id:" . $smslog_id . " id:" . $id, 2, "simplebilling_hook_billing_post");
$ok = true;
}
return $ok;
Expand Down
2 changes: 1 addition & 1 deletion web/plugin/feature/simplerate/fn.php
Expand Up @@ -179,7 +179,7 @@ function simplerate_hook_rate_deduct($smslog_id) {
$balance_parent = $credit_parent - $charge;
}

if (billing_post($smslog_id, $rate, $credit, $count, $charge)) {
if (billing_post($smslog_id, $rate, $count, $charge)) {
_log("deduct successful uid:" . $uid . " parent_uid:" . $parent_uid . " smslog_id:" . $smslog_id, 3, "simplerate_hook_rate_deduct");

// if balance under credit lowest limit and never been notified then notify admins, parent_uid and uid
Expand Down

0 comments on commit 162ca60

Please sign in to comment.