mirror of
https://github.com/andwati/cymelle.git
synced 2026-11-14 12:35:12 +00:00
paystack
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import { apiRequest } from "#/api/client";
|
||||
import type {
|
||||
CheckoutQuote,
|
||||
CheckoutQuoteRequest,
|
||||
PaystackInitializeRequest,
|
||||
PaystackInitializeResponse,
|
||||
PaystackVerifyResponse,
|
||||
} from "#/types/payment";
|
||||
|
||||
export function getCheckoutQuote(
|
||||
request: CheckoutQuoteRequest,
|
||||
signal?: AbortSignal,
|
||||
) {
|
||||
return apiRequest<CheckoutQuote>("/checkout/quote", {
|
||||
method: "POST",
|
||||
body: request,
|
||||
signal,
|
||||
});
|
||||
}
|
||||
|
||||
export function initializePaystackPayment(request: PaystackInitializeRequest) {
|
||||
return apiRequest<PaystackInitializeResponse>(
|
||||
"/payments/paystack/initialize",
|
||||
{
|
||||
method: "POST",
|
||||
body: request,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function verifyPaystackPayment(reference: string) {
|
||||
return apiRequest<PaystackVerifyResponse>(
|
||||
`/payments/paystack/verify/${encodeURIComponent(reference)}`,
|
||||
{
|
||||
method: "POST",
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user