fix stripe payment flow

This commit is contained in:
2026-04-09 22:52:57 -06:00
parent 1010d57b79
commit 39e4a3896e
8 changed files with 66 additions and 40 deletions

View File

@@ -73,12 +73,21 @@ export async function apiApplyCoupon(token, storeId, couponCode) {
return handleResponse(res);
}
export async function apiCheckout(token, { storeId, paymentMethodId }) {
export async function apiCheckout(token, { storeId }) {
const res = await fetch(`${BASE}/checkout`, {
method: "POST",
headers: authHeaders(token),
body: JSON.stringify({ storeId, paymentMethodId }),
body: JSON.stringify({ storeId }),
});
return handleResponse(res);
}
export async function apiCompleteCheckout(token, paymentIntentId) {
const res = await fetch(`${BASE}/checkout/complete?paymentIntentId=${encodeURIComponent(paymentIntentId)}`, {
method: "POST",
headers: authHeaders(token),
});
return handleResponse(res);
}