Jump to content

Force Payment Gatewat depending on Invoice Balance


Kian

Recommended Posts

It doesn't matter what payment method you use. It can be PayPal, Stripe, Skrill or Credit Card. The typical gateway charges absurdly high fees to manage your money. Billing Extension helps you saving up to 18% on transaction fees but such costs can be lowered even further.

Let's face it. In an ideal world we would be receiving money just with Bank Transfer (aka Wire Transfer) since it doesn't cost you anything. The following hook can be used to force the most convenient gateway you have depending on invoice balance. For example if invoice balance >= 1000 euro force banktransfer. Let's do some math.

  • PayPal charges 3.4% + 0.35 € per transaction meaning that receiving 1000 € costs you 35.35 €
  • Let's suppose on a yearly basis you receive 10 payments of 1000 €
  • At the end of the year you gave to PayPal 353.5 €

With this hook you can keep this money for you. As if it wasn't enough, the hook can be customized to force the payment gateway depending on customers' country. For example you can use the hook just for specific countries (eg. IT, FR, DE) and/or European Union. Don't worry about multiple currencies. The script automatically handles currency conversion when needed.

Get the Code »

Link to comment
Share on other sites

  • Kian locked and unlocked this topic

Updated.

It is worth to say that the hook allows administrators to lift restrictions on specific invoices. All you all you need is changing the payment method from Options tab (Invoice View). This will add the following note Payment Method Unlocked by Administratror that serves as a way to let customers freely choose their gateway.

Of course we don't want such note to be visible in front-end hence the hook automatically removes it from the HTML version invoices. As for the PDF version, you'll need to place a small piece of code right above if ($notes) statement in your invoicepdf.tpl as follows:

# Notes
$notes = str_replace('Payment Method Unlocked by Administratror', '', $notes);
$notes = ($notes ? $notes : false);
if ($notes) {
    $pdf->Ln(5);
    $pdf->SetFont($pdfFont, '', 8);
    $pdf->MultiCell(170, 5, Lang::trans('invoicesnotes') . ': ' . $notes);
}

 

Link to comment
Share on other sites

  • 4 weeks later...
On 18.08.2020 at 14:03, Kian said:

Nu contează ce metodă de plată utilizați. Poate fi PayPal, Stripe, Skrill sau Card de credit. Gateway-ul tipic percepe taxe absurd de mari pentru a vă gestiona banii. Extinderea facturării vă ajută să economisiți până la 18% din taxele de tranzacție, dar astfel de costuri pot fi reduse și mai mult.

Hai sa recunoastem. Într-o lume ideală, am primi bani doar prin Transfer bancar (aka Transfer bancar), deoarece nu vă costă nimic. Următorul cârlig poate fi utilizat pentru a forța cel mai convenabil gateway pe care îl aveți în funcție de soldul facturii. De exemplu, dacă soldul facturii> = 1000 euro forțează transferul bancar . Hai să facem niște calcule.

  • PayPal percepe 3,4% + 0,35 € per tranzacție, ceea ce înseamnă că primirea a 1000 € vă costă 35,35 €
  • Să presupunem că, anual, primiți 10 plăți de 1000 €
  • La sfârșitul anului ați dat PayPal 353,5 €

Cu acest cârlig puteți păstra acești bani pentru dvs. Ca și cum nu ar fi suficient, cârligul poate fi personalizat pentru a forța gateway-ul de plată în funcție de țara clienților. De exemplu, puteți utiliza cârligul doar pentru anumite țări (de exemplu, IT, FR, DE) și / sau Uniunea Europeană. Nu vă faceți griji cu privire la mai multe valute. Scriptul gestionează automat conversia valutară atunci când este necesar.

Obțineți codul »

 

where and how and in what folder or how to add these codes I put the code in invoicepdf.tpl but there is no change that must be done exactly step by step

Link to comment
Share on other sites

You can find all details about action hooks here. Here's a step-by-step guide:

  1. Go here and click File > Save page as...
  2. Your browser will download a file named ForcePaymentGatewayDependingOnInvoiceBalance.php
  3. Use an FTP client to upload this file in includes/hooks directory
  4. Edit the file you have just uploaded with a text editor
  5. Configure it according to your needs, save, upload and confirm you want to overwrite
Link to comment
Share on other sites

×
×
  • 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