SellYourSaas icon indicating copy to clipboard operation
SellYourSaas copied to clipboard

Data too long for column 'ext_payment_id' at row 1 ,

Open rycks opened this issue 2 years ago • 1 comments

Describe the bug Return from stripe payment (test mode) :

Success to charge card (pi_3L8JqLHU6nqAr7bd0YGuXWKq with pk_test_51Ks45eHU6nqAr7bd3mFZKVBOmbYOBzo61HkZjxlPMa6nbAmpzkkGyt35mGm99FtQwiiY2RP27xfCc2tQfGmCxWZR0057qOFe38),
Data too long for column 'ext_payment_id' at row 1 ,
Email sent to thirdparty (to xxx@xxxx without any attached document, language = fr_FR)

Screenshots

image

image

"my" solution was to change in sellyoursaasutils.class.php line 1236

$paiement->ext_payment_id = $charge->id.':'.$customer->id.'@'.$stripearrayofkeys['publishable_key'];

to

$paiement->ext_payment_id = $charge->id;//.':'.$customer->id.'@'.$stripearrayofkeys['publishable_key'];

rycks avatar Jun 08 '22 08:06 rycks

In v16, field is now 255 instead of 128. Still may not be enough, so a better fix would be to do $paiement->ext_payment_id = dol_trunc($charge->id.':'.$customer->id.'@'.$stripearrayofkeys['publishable_key'], 250); So we keep max of information.

eldy avatar Jun 09 '22 11:06 eldy