Skip to content

Commit

Permalink
Can set a dedicated message on payment forms
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Sep 9, 2017
1 parent c753773 commit 026f9d8
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 18 deletions.
17 changes: 11 additions & 6 deletions htdocs/core/lib/payments.lib.php
Expand Up @@ -96,9 +96,10 @@ function payment_supplier_prepare_head(Paiement $object) {
* @param Societe $fromcompany Third party
* @param Translate $langs Output language
* @param int $addformmessage Add the payment form message
* @param string $suffix Suffix to use on constants
* @return void
*/
function htmlPrintOnlinePaymentFooter($fromcompany,$langs,$addformmessage=0)
function htmlPrintOnlinePaymentFooter($fromcompany,$langs,$addformmessage=0,$suffix='')
{
global $conf;

Expand Down Expand Up @@ -152,16 +153,20 @@ function htmlPrintOnlinePaymentFooter($fromcompany,$langs,$addformmessage=0)

print '<br>';

print '<div class="center"><font style="font-size: 10px;">'."\n";
print '<div class="center">'."\n";
if ($addformmessage)
{
$key='ONLINE_PAYMENT_MESSAGE_FORM';
if (! empty($conf->global->$key)) print '<br>'.$conf->global->$key;
print '<br>';
$parammessageform='ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix;
if (! empty($conf->global->$parammessageform)) print $conf->global->$parammessageform;
else if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORM)) print $conf->global->ONLINE_PAYMENT_MESSAGE_FORM;
}

print '<br><hr>'."\n";
print '<font style="font-size: 10px;"><br><hr>'."\n";
print $fromcompany->name.'<br>';
print $line1.'<br>';
print $line1;
if (strlen($line1+$line2) > 50) print '<br>';
else print ' - ';
print $line2;
print '</font></div>'."\n";
}
2 changes: 1 addition & 1 deletion htdocs/public/paybox/newpayment.php
Expand Up @@ -802,7 +802,7 @@
print '<br>';


htmlPrintOnlinePaymentFooter($mysoc,$langs,1);
htmlPrintOnlinePaymentFooter($mysoc,$langs,1,$suffix);


llxFooter('', 'public');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/paybox/paymentko.php
Expand Up @@ -162,7 +162,7 @@
print "\n</div>\n";


htmlPrintOnlinePaymentFooter($mysoc,$langs);
htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix);


llxFooter('', 'public');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/paybox/paymentok.php
Expand Up @@ -193,7 +193,7 @@

print "\n</div>\n";

htmlPrintOnlinePaymentFooter($mysoc,$langs);
htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix);


llxFooter('', 'public');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/payment/newpayment.php
Expand Up @@ -1447,7 +1447,7 @@ function stripeTokenHandler(token) {



htmlPrintOnlinePaymentFooter($mysoc,$langs,1);
htmlPrintOnlinePaymentFooter($mysoc,$langs,1,$suffix);

llxFooter('', 'public');

Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/payment/paymentko.php
Expand Up @@ -244,7 +244,7 @@
print "\n</div>\n";


htmlPrintOnlinePaymentFooter($mysoc,$langs);
htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix);


llxFooter('', 'public');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/payment/paymentok.php
Expand Up @@ -443,7 +443,7 @@
print "\n</div>\n";


htmlPrintOnlinePaymentFooter($mysoc,$langs);
htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix);


llxFooter('', 'public');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/paypal/newpayment.php
Expand Up @@ -1015,7 +1015,7 @@



htmlPrintOnlinePaymentFooter($mysoc,$langs,1);
htmlPrintOnlinePaymentFooter($mysoc,$langs,1,$suffix);

llxFooter('', 'public');

Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/paypal/paymentko.php
Expand Up @@ -172,7 +172,7 @@
print "\n</div>\n";


htmlPrintOnlinePaymentFooter($mysoc,$langs);
htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix);


llxFooter('', 'public');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/paypal/paymentok.php
Expand Up @@ -328,7 +328,7 @@

print "\n</div>\n";

htmlPrintOnlinePaymentFooter($mysoc,$langs);
htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix);


llxFooter('', 'public');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/stripe/newpayment.php
Expand Up @@ -1229,7 +1229,7 @@ function stripeTokenHandler(token) {



htmlPrintOnlinePaymentFooter($mysoc,$langs,1);
htmlPrintOnlinePaymentFooter($mysoc,$langs,1,$suffix);

llxFooter('', 'public');

Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/stripe/paymentko.php
Expand Up @@ -159,7 +159,7 @@
print "\n</div>\n";


htmlPrintOnlinePaymentFooter($mysoc,$langs);
htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix);


llxFooter('', 'public');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/stripe/paymentok.php
Expand Up @@ -193,7 +193,7 @@
print "\n</div>\n";


htmlPrintOnlinePaymentFooter($mysoc,$langs);
htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix);


llxFooter('', 'public');
Expand Down

0 comments on commit 026f9d8

Please sign in to comment.