# Payment link missing "ref" field

**URL:** <https://www.dolibarr.org/forum/t/payment-link-missing-ref-field/24325>\
**Category:** Other native modules\
**Created:** [September 24, 2023, 5:12pm UTC](https://www.dolibarr.org/forum/t/payment-link-missing-ref-field/24325 "2023-09-24T17:12:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mancusoa](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/m/8e8cbc/32.png) [@mancusoa](https://www.dolibarr.org/forum/u/mancusoa)\
**Post date:** [September 24, 2023, 5:12pm UTC](https://www.dolibarr.org/forum/t/payment-link-missing-ref-field/24325/1 "2023-09-24T17:12:07Z")

</div>

Hi,  
I just activated and configured Paypal and Stripe modules for payments.  
I also enabled, in Settings/PDF, the flag to add into the invoice the payment link but when the link is generated the ref value is missing and the page shown says “Wrong parameters - ref” .  
The invoice is Convalidated.

Example:  
[http://mycompany/public/payment/newpayment.php?source=invoice&ref=](http://mycompany/public/payment/newpayment.php?source=invoice&ref=)

I use Dolibarr 17.0.1  
Thanks.

---

<div class="post-metadata">

**Author:** ![nsohani](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/n/e480ec/32.png) [@nsohani](https://www.dolibarr.org/forum/u/nsohani)\
**Post date:** [November 11, 2023, 1:54am UTC](https://www.dolibarr.org/forum/t/payment-link-missing-ref-field/24325/2 "2023-11-11T01:54:03Z")

</div>

I have similar issue, in version18.0.3. After validation of the invoice, the payment link created for Strip works fine, but the embedded url in the pdf invoice has the the same “Bad parameters - ref”, the url stops at ref. there is nothing beyond that like invoice number etc as is in the payment lin.

---

<div class="post-metadata">

**Author:** ![nsohani](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/n/e480ec/32.png) [@nsohani](https://www.dolibarr.org/forum/u/nsohani)\
**Post date:** [November 12, 2023, 7:18pm UTC](https://www.dolibarr.org/forum/t/payment-link-missing-ref-field/24325/3 "2023-11-12T19:18:20Z")

</div>

Look at this link

> <https://github.com/Dolibarr/dolibarr/issues/25835>
>
> \### Bug
> 
> in pdf\_sponge\_modules.php 
> missing argument for the mode :
> \`$paieme…nt\_url = getOnlinePaymentUrl('', 'invoice', $object-\>ref, '', '', '');\`
> ref will allways be null and printed pdf ref will too.
> 
> Exemple:
> \`$paiement\_url = getOnlinePaymentUrl(0, 'invoice', $object-\>ref, '', '', '');\`
> 
> in core/libs/paiments.lib.php :
> \`\`\`
> ...
> elseif ($type == 'invoice') {
> $out = $urltouse.'/public/payment/newpayment.php?source='.$type.'&ref='.($mode ? '\<span style="color: #666666"\>' : '');
> if ($mode == 1) {
> $out .= 'invoice\_ref';
> }
> if ($mode == 0) {
> $out .= urlencode($ref);
> }
> \`\`\`
> actually : 
> \`$paiement\_url = getOnlinePaymentUrl('', 'invoice', $object-\>ref, '', '', '');\`
> The first argument to \`getOnlinePaymentUrl\` in \`pdf\_sponge\_modules.php\`, which is \`$mode\`, will never give a valid reference because \`''\` is defined and not an expected \`$mode\` defined by the \`payment\_url logic\` in \`pdf\_sponge\_modules.php\`
> 
> \### Environment Version
> 
> 18.0.1
> 
> \### Environment OS
> 
> Debian
> 
> \### Environment Web server
> 
> \_No response\_
> 
> \### Environment PHP
> 
> 8.2.1
> 
> \### Environment Database
> 
> \_No response\_
> 
> \### Environment URL(s)
> 
> \_No response\_
> 
> \### Expected and actual behavior
> 
> \_No response\_
> 
> \### Steps to reproduce the behavior
> 
> \_No response\_
> 
> \### Attached files
> 
> \_No response\_

---

<div class="post-metadata">

**Author:** ![nsohani](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/n/e480ec/32.png) [@nsohani](https://www.dolibarr.org/forum/u/nsohani)\
**Post date:** [November 12, 2023, 10:15pm UTC](https://www.dolibarr.org/forum/t/payment-link-missing-ref-field/24325/4 "2023-11-12T22:15:51Z")

</div>

With PHP Version 7.4, it works fine. With PHP V8.1 the stripe payment link on invoice stops at “ref” and give url does not work!

---

<div class="post-metadata">

**Author:** ![mancusoa](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/m/8e8cbc/32.png) [@mancusoa](https://www.dolibarr.org/forum/u/mancusoa)\
**Post date:** [November 13, 2023, 10:27am UTC](https://www.dolibarr.org/forum/t/payment-link-missing-ref-field/24325/5 "2023-11-13T10:27:21Z")

</div>

@nsohani Thanks for you reply and for the topic link.  
So, do you suggest su downgrade to PHP v7.4?

---

<div class="post-metadata">

**Author:** ![nsohani](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/n/e480ec/32.png) [@nsohani](https://www.dolibarr.org/forum/u/nsohani)\
**Post date:** [November 13, 2023, 9:10pm UTC](https://www.dolibarr.org/forum/t/payment-link-missing-ref-field/24325/6 "2023-11-13T21:10:19Z")

</div>

I have tried several time PHP 8 and the payment link is incomplete. Same process I repeated with PHP 7.4. It worked all the time. the payment link printed on the PDF is complete and works! It could be the compatibility or Database Driver. I am using Maria Data base, which is fully compatible to Mysql.So try yourself rolling back to PHP 7.4
