Commit e98e561f authored by oskar's avatar oskar

correcting commit-mistake. fix #44

parent 5894bcba
......@@ -30,30 +30,6 @@ $items = PayPalHelper::getProducts();
$shippingId = $_SESSION['Versandart']->kVersandart;
/**
* shorten a long payment-name to 'nLimit', by inserting a placholder 'szPlaceHolder' and
* show the 'nLastShownChars' characters
*
* @param $szPaymentDesc string to shorten
* @return string string of length 'nLimit'
*/
function shortenPaymentName($szPaymentDesc) {
$nLimit = 25; // hard limit of the payment-wall (should not be altered)
$nLastShownChars = 0; // (maybe 3 looks good)
$szPlaceHolder = '...';
$szShortedDesc = $szPaymentDesc;
if ($nLimit < strlen($szPaymentDesc)) {
$szShortedDesc =
substr($szPaymentDesc, 0, ($nLimit - (strlen($szPlaceHolder) + $nLastShownChars)))
. $szPlaceHolder
. ($nLastShownChars ? substr($szPaymentDesc, - $nLastShownChars) : '')
;
}
return $szShortedDesc;
}
if ($api->isConfigured(false) && $api->isUseable($items, $shippingId)) {
$payment = $api->createPayment();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment