mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: init stripe utils
This commit is contained in:
parent
412651e817
commit
416c3a4afc
8 changed files with 315 additions and 41 deletions
|
|
@ -21,7 +21,7 @@ export async function createPaymentConfig(orgId: number, data: any, access_token
|
|||
|
||||
export async function updatePaymentConfig(orgId: number, id: string, data: any, access_token: string) {
|
||||
const result = await fetch(
|
||||
`${getAPIUrl()}payments/${orgId}/config`,
|
||||
`${getAPIUrl()}payments/${orgId}/config?id=${id}`,
|
||||
RequestBodyWithAuthHeader('PUT', data, null, access_token)
|
||||
);
|
||||
const res = await errorHandling(result);
|
||||
|
|
@ -30,7 +30,7 @@ export async function updatePaymentConfig(orgId: number, id: string, data: any,
|
|||
|
||||
export async function deletePaymentConfig(orgId: number, id: string, access_token: string) {
|
||||
const result = await fetch(
|
||||
`${getAPIUrl()}payments/${orgId}/config/${id}`,
|
||||
`${getAPIUrl()}payments/${orgId}/config?id=${id}`,
|
||||
RequestBodyWithAuthHeader('DELETE', null, null, access_token)
|
||||
);
|
||||
const res = await errorHandling(result);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export async function updateProduct(orgId: number, productId: string, data: any,
|
|||
return res;
|
||||
}
|
||||
|
||||
export async function deleteProduct(orgId: number, productId: string, access_token: string) {
|
||||
export async function archiveProduct(orgId: number, productId: string, access_token: string) {
|
||||
const result = await fetch(
|
||||
`${getAPIUrl()}payments/${orgId}/products/${productId}`,
|
||||
RequestBodyWithAuthHeader('DELETE', null, null, access_token)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue