fix stripe payment flow
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user