mirror of
https://github.com/myronblair/tomsjavajive
synced 2026-06-30 17:50:32 -05:00
Fix Stripe checkout: wrong column name stripe_checkout_session → stripe_session_id
DB column is stripe_session_id but code was writing to stripe_checkout_session, causing a 500 on checkout and breaking payment status checks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -103,7 +103,7 @@ try {
|
|||||||
|
|
||||||
// Store checkout session ID
|
// Store checkout session ID
|
||||||
db()->update('orders',
|
db()->update('orders',
|
||||||
['stripe_checkout_session' => $session['id']],
|
['stripe_session_id' => $session['id']],
|
||||||
'order_id = :id',
|
'order_id = :id',
|
||||||
['id' => $orderId]
|
['id' => $orderId]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ if (!empty($orderId)) {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$order = db()->fetch(
|
$order = db()->fetch(
|
||||||
"SELECT * FROM orders WHERE stripe_checkout_session = :session OR stripe_payment_intent = :session",
|
"SELECT * FROM orders WHERE stripe_session_id = :session OR stripe_payment_intent = :session",
|
||||||
['session' => $sessionId]
|
['session' => $sessionId]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -60,9 +60,9 @@ if (!isStripeConfigured()) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Check with Stripe
|
// Check with Stripe
|
||||||
if (!empty($order['stripe_checkout_session'])) {
|
if (!empty($order['stripe_session_id'])) {
|
||||||
// Check checkout session status
|
// Check checkout session status
|
||||||
$session = stripe()->getCheckoutSession($order['stripe_checkout_session']);
|
$session = stripe()->getCheckoutSession($order['stripe_session_id']);
|
||||||
|
|
||||||
if ($session['payment_status'] === 'paid') {
|
if ($session['payment_status'] === 'paid') {
|
||||||
// Update order
|
// Update order
|
||||||
|
|||||||
Reference in New Issue
Block a user