Jump to content

Error 500 - Call to undefined function recalcrecurringproductprice()


standej

Recommended Posts

Hi guys,

we are using Iframe payment gateway and if transaction is successful credit card provider call our callback file to tell us that transaction is successful and send all information needed to whmcs.

Like in docs:
https://developers.whmcs.com/payment-gateways/callbacks/
our callback file contain only this 4 helper methods:

  1. Validate the invoice ID the callback relates to using the checkCbInvoiceID helper method.
  2. Verify the transaction ID has not already been recorded using the checkCbTransID helper method.
  3. Log the transaction to the WHMCS Gateway Log using the logTransaction helper method.
  4. Apply the payment to the invoice using the addInvoicePayment helper method.

The callback file works fine when we don't use promo code that is recurring on upgrade. There is no error at all on other purchases and everything works fine. But if we check recurring promocode like on picture in attachment we get error that is saying 'Call to undefined function recalcrecurringproductprice()' in /var/www/app-il/includes/upgradefunctions.php' 
As you know we don't have access to whmcs source code in file /includes/upgradefunctions.php so we can not investigate why this happening.

Here is full error log:

[WHMCS Application] ERROR: exception 'Whoops\Exception\ErrorException' with message 'Call to undefined function recalcrecurringproductprice()' in /var/www/app-il/includes/upgradefunctions.php:0 Stack trace: #0 /var/www/app-il/vendor/whmcs/whmcs-foundation/lib/Utility/Error/Run.php(0): WHMCS\Utility\Error\Run->handleError(1, 'Call to undefin...', '/var/www/app-il...', 0) #1 [internal function]: WHMCS\Utility\Error\Run->handleShutdown() #2 {main} {"exception":"[object] (Whoops\\Exception\\ErrorException(code: 1): Call to undefined function recalcrecurringproductprice() at /var/www/app-stg/includes/upgradefunctions.php:0)"} []

Also note that in our callback file, first 3 helper methods (checkCbInvoiceID , checkCbTransID , logTransaction ) executes normal but fourth one addInvoicePayment start working but somewhere inside crash and trigger this error. When on promocode recurring is no checked, all 4 helper methods executes normal and no error.

Our callback file is very simple, we send to whmcs invoice id and amount and transactionid and few other stuff and whmcs needs to capture payment in the system for this specific invoice.

This is arguments we sending to addInvoicePayment helper method in our callback file.

addInvoicePayment(
$invoiceId,
$transactionId,
$paymentAmount,
$paymentFee,
$gatewayModuleName
);

I checked all arguments that we are sending to this helper method addInvoicePayment and they are correct.
When we send this data for invoice ID that does not have product with promo code on recurring everything works fine.
But, if invoice ID is with product that has promo code on recurring we get that strange error.

'Call to undefined function recalcrecurringproductprice()' in /var/www/app-il/includes/upgradefunctions.php'

Hope someone can help us fix this problem somehow.

Thanks in advance

 

recurring error.PNG

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • 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