mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
feat: integrate Stripe for page purchases and reconciliation tasks
This commit is contained in:
parent
17642493eb
commit
a9fd45844d
31 changed files with 1948 additions and 166 deletions
30
surfsense_web/lib/apis/stripe-api.service.ts
Normal file
30
surfsense_web/lib/apis/stripe-api.service.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import {
|
||||
type CreateCheckoutSessionRequest,
|
||||
type CreateCheckoutSessionResponse,
|
||||
createCheckoutSessionResponse,
|
||||
type GetPagePurchasesResponse,
|
||||
getPagePurchasesResponse,
|
||||
type StripeStatusResponse,
|
||||
stripeStatusResponse,
|
||||
} from "@/contracts/types/stripe.types";
|
||||
import { baseApiService } from "./base-api.service";
|
||||
|
||||
class StripeApiService {
|
||||
createCheckoutSession = async (
|
||||
request: CreateCheckoutSessionRequest
|
||||
): Promise<CreateCheckoutSessionResponse> => {
|
||||
return baseApiService.post("/api/v1/stripe/create-checkout-session", createCheckoutSessionResponse, {
|
||||
body: request,
|
||||
});
|
||||
};
|
||||
|
||||
getPurchases = async (): Promise<GetPagePurchasesResponse> => {
|
||||
return baseApiService.get("/api/v1/stripe/purchases", getPagePurchasesResponse);
|
||||
};
|
||||
|
||||
getStatus = async (): Promise<StripeStatusResponse> => {
|
||||
return baseApiService.get("/api/v1/stripe/status", stripeStatusResponse);
|
||||
};
|
||||
}
|
||||
|
||||
export const stripeApiService = new StripeApiService();
|
||||
Loading…
Add table
Add a link
Reference in a new issue