1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

direct the stripe endpoints to /api/stripe

This commit is contained in:
Sylvain 2021-04-12 10:48:30 +02:00
parent fd5c3a87ce
commit b3720d7f47

View File

@ -4,7 +4,7 @@ import { CartItems, IntentConfirmation, PaymentConfirmation, UpdateCardResponse
export default class StripeAPI {
static async confirm (stp_payment_method_id: string, cart_items: CartItems): Promise<PaymentConfirmation> {
const res: AxiosResponse = await apiClient.post(`/api/payments/confirm_payment`, {
const res: AxiosResponse = await apiClient.post(`/api/stripe/confirm_payment`, {
payment_method_id: stp_payment_method_id,
cart_items
});
@ -12,13 +12,13 @@ export default class StripeAPI {
}
static async setupIntent (user_id: number): Promise<IntentConfirmation> {
const res: AxiosResponse = await apiClient.get(`/api/payments/setup_intent/${user_id}`);
const res: AxiosResponse = await apiClient.get(`/api/stripe/setup_intent/${user_id}`);
return res?.data;
}
// TODO, type the response
static async confirmPaymentSchedule (setup_intent_id: string, cart_items: CartItems): Promise<any> {
const res: AxiosResponse = await apiClient.post(`/api/payments/confirm_payment_schedule`, {
const res: AxiosResponse = await apiClient.post(`/api/stripe/confirm_payment_schedule`, {
setup_intent_id,
cart_items
});
@ -26,7 +26,7 @@ export default class StripeAPI {
}
static async updateCard (user_id: number, stp_payment_method_id: string): Promise<UpdateCardResponse> {
const res: AxiosResponse = await apiClient.post(`/api/payments/update_card`, {
const res: AxiosResponse = await apiClient.post(`/api/stripe/update_card`, {
user_id,
payment_method_id: stp_payment_method_id,
});