Jump to content
Sign in to follow this  

Dynamically regenerate payment data

Recommended Posts



Im wondering if there is a simple way to re-generate payment data for an invoice. (Im asking for PHP code).


My example case:

I have a addon created, that lists payments of a certain gateway that generates payment details for the ATM machine.


Now if I didnt have the module, the normal procedure would be:

1º When the payment details expire in order to renew them I have to delete the payment data from the DB table of the payment.

2º Go to the invoice, click on the "View as Client" and it would re-generate the payment details.


With my addon, I wanted to simplify the steps, because not all admin users have DB knowledge for this, so on my addon page, it would list all invoices (unpaid) and the steps for re-generating payment details are:

1º Click button delete

This will delete the payment data from the DB - Working!

Now I would need to re-generate it, something like calling: gateway_link() function form my addon page.


Is there a simple way to do this?




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.

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 steven99
      WHMCS Addon - Staff Knowledgebase
      Knowledgebases are great for storing and sharing information, how to guides, company information, basic server layouts, etc, but some articles should not be available to the public. With the staff knowledgebase addon module for WHMCS, you are able to keep your internal KB articles separate and private from your public WHMCS knowledgebase.   No need for hidden but still publicly available categories as there is no client side access to the articles in this knowledgebase.
      Categories – organize all your articles in to buckets Sub categories – buckets within buckets Articles can be assigned to multiple categories Parent articles – have an article that extends another article? The parent article links one article to another and the parent article is shown on “child” article’s page. Uses the same text editor as the native WHMCS knowledgebase, which allows you to setup lists, bold text, or increase font sizes without using html markup. No client side access Search keywords in the body or title of the articles with partial or exact matches on keywords Requires:
      WHMCS 7.6+ and works with 8.0+ PHP 7.2 and above Don’t delay, get KBing today!
      WHMCS Marketplace Listing: https://marketplace.whmcs.com/product/4767-whmcs-staff-knowledgebase
    • By steven99
      When clients sign up for your services, you may use configurable options to customize their services. Those options show up within the WHMCS cart's product configuration page. Sometimes it isn't clear what a configurable option is for based on the label. With this module, you can now add descriptions to configurable options so visitors have as much info as they need. You can even hide inputs on the product configuration page in the cart.
      Order now: $25 / yearly |
      View on the Marketplace

      Add descriptions to configurable options for visitors to see Hide inputs within the product configuration page in the cart Descriptions are displayed within: A tooltip that is shown when the input is hovered over A specified class - such as the bootstrap alert classes or any other CSS class Resize input containers to make those inputs larger or smaller - based on the input's container Input options can apply to all products or specific products
    • By Marcos
      Hi All
      First of all, I cannot locate any hook that is triggered upon changing a Client's Ownership.  UserEdit is fired but seemingly BEFORE the User is assigned the Client, and no Client details are passed to the hook (I access them directly via de DB).
      Any suggestions on how to trap this event?
      Thank you in advance.
    • By BOF007
      Hello all, 
      I was testing my licensing addon, and i deleted the product associated with a assigned license.
      It was removed from the test client portal, but now under addons>license manager, i have a license i cant remove since there is no remove/delete button.
      Am i missing something or is there another step i must do to remove the inactive license ?
      Thanks for your time,
    • By lamjed001
      I made my own payment gateway and used this for currency conversion but I have a problem, the amount remains the same after the conversion
      For example product price is 5$ with usd currency and 4€ for euro currency
      and in callback i posted 5$ and currency=USD but my account is using euro currency
      and the result is 5 not 4 please give me solution and thanks ♥
      <?php require_once __DIR__ . '/../../../init.php'; require_once __DIR__ . '/../../../includes/gatewayfunctions.php'; require_once __DIR__ . '/../../../includes/invoicefunctions.php'; $gatewayModuleName = basename(__FILE__, '.php'); $gatewayParams = getGatewayVariables($gatewayModuleName); $paymentAmount=5.00; $invoiceId=1; $invoice = WHMCS\Billing\Invoice::find($invoiceId); $userCurrency = getCurrency($invoice->clientId); if ($userCurrency["code"] != "EUR") { $paymentCurrencyID = WHMCS\Database\Capsule::table("tblcurrencies")->where("code", "EUR")->value("id"); if (is_null($paymentCurrencyID)) { logTransaction($gatewayParams['name'], $_POST, "Unsuccessful - Invalid Currency"); exit; } $paymentAmount = convertCurrency($paymentAmount, $paymentCurrencyID, $userCurrency["id"]); //Here the result is the same amount sent } ?>  
  • 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