Jump to content
Sign in to follow this  
Nelson Neoh

Service/Product renewal related questions

Recommended Posts

Hi there.

After a long search in Google and this community, I didn't really able to find a clue on how to handle this, if there is a product which upgrade will incurs a full charge, rather than default prorated charge in WHMCS.  Do you guys has any hints or workaround?

Here's the full list of issues I am experiencing now, hope will get any help from you here.  Thanks in advance.

1. What's the proper procedures to take, if there is a product/service renewal or upgrade will incurs a full charge rather than prorated according to remaining days?

2. When a product/service renewed (recurring auto CC charged or invoice paid), which hook or function in Addons/Provisions can use to trigger follow up actions?  Like post an API request to principle for such renewal action.

3. When a Renewal button being click, either on Admin/Client Panel, it will triggers invoice and charge directly on client deposited funds if sufficient fund available.  Which localAPI should I call?

4. I noticed if the Product/Service being created with recurring terms, for example monthly or annually, it will automatically triggered an invoice by WHMCS cron.  Wish to know if there is sufficient fund in client account, will the cron direct credited its balance and send a paid invoice?  Which hook should I use if the invoice send is a paid invoice?

Best Regards,
Nelson

Share this post


Link to post
Share on other sites

Here's something answer formally by WHMCS support and adding in some elaboration on my questions.  Please help to contribute some idea, or point a way for my research.  Will share here on any findings later.

Quote

1. What's the proper procedures to take, if there is a product/service renewal or upgrade will incurs a full charge rather than prorated according to remaining days?

Recently there is no such thing supported by WHMCS.  Am asking for any possible workaround.  If you do have some point to share, greatly appreciated.

Quote

2. When a product/service renewed (recurring auto CC charged or invoice paid), which hook or function in Addons/Provisions can use to trigger follow up actions?  Like post an API request to principle for such renewal action.

Asked support but they don't really captured what I am needed.  Pending for clues.

Quote

3. When a Renewal button being click, either on Admin/Client Panel, it will triggers invoice and charge directly on client deposited funds if sufficient fund available.  Which localAPI should I call?

It seems like no native "renewal" localAPI can use.  I am thinking just make a custom function to handle this, all by direct Models manipulation.

On 6/26/2021 at 4:14 PM, Nelson Neoh said:

4. I noticed if the Product/Service being created with recurring terms, for example monthly or annually, it will automatically triggered an invoice by WHMCS cron.  Wish to know if there is sufficient fund in client account, will the cron direct credited its balance and send a paid invoice?  Which hook should I use if the invoice send is a paid invoice?

Well... this one still have no clue.

 

Regards,
Nelson Neoh

Share this post


Link to post
Share on other sites
9 hours ago, Nelson Neoh said:

Here's something answer formally by WHMCS support and adding in some elaboration on my questions.  Please help to contribute some idea, or point a way for my research.  Will share here on any findings later.

Recently there is no such thing supported by WHMCS.  Am asking for any possible workaround.  If you do have some point to share, greatly appreciated.

Asked support but they don't really captured what I am needed.  Pending for clues.

It seems like no native "renewal" localAPI can use.  I am thinking just make a custom function to handle this, all by direct Models manipulation.

Well... this one still have no clue.

 

Regards,
Nelson Neoh

Hey Nelson, This is quite a commonly discussed issue with WHMCS - It's awful at billing prorata unfortunately, Not only are the amounts and logic used wrong - Those that tell you otherwise probably have an accountant that hates them 😛 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By Davor
      Hello,
      How to update the Credit Balance for a client after changing the Invoice and InvoiceItems?
      I'm using Paddle for processing my payments.
      When sending the invoice data to Paddle I send it without taxes. 
      Then Paddle handles the taxes and at the Subscription Payment Success webhook I get if there are any taxes.
      Then I change the Invoice Items and the Invoice.
      ((((Don't know if UpdateClientProduct autorecalc is not working in v8.2 or it is used for something else))))
      At the end I also update the Invoice with tax amount and the new total with taxes.
      I'm new with WHMCS (2 months now) and PHP (3 months).
      Now, I can't find the way how to update or trigger something to update the Credit Balance on the Summary for Client. It is still the old value that was before adding taxes to Invoices.
      Is there an API to update the Clients amounts, including Credit Balance and do I need to update something else after my changes to the Invoices?
       
      Here the part of the code that is doing this:
       
      $withoutTax = $fields['balance_fee'] + $fields['balance_earnings']; $taxAmount = $fields['balance_tax']; $withTax = $fields['balance_gross']; if ( $withoutTax <> 0 ) { $taxPercent = round(($taxAmount / $withoutTax) * 100, 2); } else { $taxPercent = 0; } if ( $taxPercent <> 0 ) { $itemTaxed = 1; } else { $itemTaxed = 0; } $command = 'GetInvoice'; $values = array( 'invoiceid' => $invoiceId, ); //$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later // Call the localAPI function $invoice = localAPI($command, $values, $adminUsername); logModuleCall('paddle_checkout_gateway_callback', 'UpdateInvoice_localAPI_invoice', $invoice, ""); if ($invoice['result'] == 'success') { foreach ($invoice['items']['item'] as $item) { //error_log($vars['invoiceid'].' item '.$item['id'].' has description of "'.$item['description'].'"'); $text = $item['description']; $updatedInfo = array( 'invoiceid' => $invoiceId, 'taxrate' => $taxPercent, 'itemdescription' => array($item['id'] => $text), 'itemamount' => array($item['id'] => $item['amount']), 'itemtaxed' => array($item['id'] => $itemTaxed) ); $updatedInvoice = localAPI('UpdateInvoice', $updatedInfo, $adminUsername); logModuleCall('paddle_checkout_gateway_callback', 'UpdateInvoice', $updatedInfo, $updatedInvoice); } } else { //echo "An Error Occurred: " . $results['result']; } // let's now trigger the recalculate of each hostingId from this updated invoiceid // I think that this is not working in v8.2 or the UpdateClientProduct autorecalc is used for something else $invoiceitems = Capsule::table('tblinvoiceitems') ->where('invoiceid', $invoiceId) ->where('type', 'Hosting')->get(); //->first(); foreach( $invoiceitems as $invoiceitem ){ //$invoiceitem->relid this is the id from the tblHosting table $resultOfAPI = localAPI('UpdateClientProduct', array('serviceid' => $invoiceitem->relid, 'autorecalc' => true), $adminUsername); logModuleCall('paddle_checkout_gateway_callback', 'recalculateProductItems', $invoiceitem->relid, $resultOfAPI); } // 20210927 maybe a bug in v8.2 // not updating the tax and the total amount of the invoice with UpdateClientProduct 'autorecalc' // manualy updating the table tblinvoices try { Capsule::table('tblinvoices') ->where('id', $invoiceId) ->update([ "tax" => $taxAmount, "total" => $withTax ]); } catch (\Exception $e) { logModuleCall('paddle_checkout_gateway_callback', 'recalculateProductItems_ERROR', "tax " .$taxAmount . " total " .$withtax ,$e); echo "Error in updating tblInvoices. {$e->getMessage()}"; }  
    • By mohd
      the problem is when the cust buys 2 item and only of them has promo but the invoice somehow calculate both it together in the same promo.
      this is not promotion setting problem. Can anyone help out? 
    • By mbparvez
      Hello.
      I need to set Annually & Biennially price of my hosting package with different renewal price. For example,
      - Annual price: $10
      - Biennially price: $18
      - Renewal price/year: $15
      Is there a way to do this? If no, then what could be the work around about this?
      Thank you in advance.
    • By Marcell
      Hello.

      As far as I know the pricing in the domains are not updated automatically via cron, you have to update it each time automatically. 

      Does WHMCS have any option to do so via cron or any special way?

      Thanks,
    • By Cartitarul
      Hi, i live in Romania and in our country is mandatory to have the total of the invoice in the local currency also for example if the total is 5 Euro, to display under the currency in RON also.
      Plz help me configure this invoice so i can start my buissnes.
       
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated