Reputation: 48
I am integrating a payment gateway. On localhost everything works correctly, i make request to payment provider and got response with order id in return. Hover ever when i moved to live server now instead of order id such as this 3104632297 a huge negative value such as this -1190334960 is stored in DB.
for code part no big magic in there. This is the part where i update the order.:
$order->update([
'order_id' => $response->json['id'],
]);
return $response;
I have also debuged the values coming from the gateway and they are actually correct.
Does anyone has a clue what might be wrong? After manually changing the negative value to proper id it works so i do not get it at all.
Upvotes: 0
Views: 82
Reputation: 5270
Just change your table column defined as VARCHAR(as_your_id_length)
Upvotes: 0
Reputation: 8947
Please update Type of order_id in your table.
If you are expecting only digits then then use Type = BIGINT
and Attributes = UNSIGNED
. If the order_id consist of characters as well then simple VARCHAR(40)
of a specific length will suffice.
Upvotes: 1