mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
feat(subscription): API и утилиты СБП-автопродления Platega
This commit is contained in:
@@ -12,6 +12,7 @@ import type {
|
||||
PurchaseSelection,
|
||||
PurchasePreview,
|
||||
AppConfig,
|
||||
SbpRecurringInfo,
|
||||
} from '../types';
|
||||
|
||||
/** Helper: build query params with optional subscription_id */
|
||||
@@ -349,6 +350,34 @@ export const subscriptionApi = {
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// ── SBP recurring (Platega) ───────────────────────────────────────────
|
||||
|
||||
getSbpRecurring: async (subscriptionId?: number): Promise<SbpRecurringInfo> => {
|
||||
const response = await apiClient.get<SbpRecurringInfo>(
|
||||
'/cabinet/subscription/platega-recurrent',
|
||||
withSubId(subscriptionId),
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
enableSbpRecurring: async (
|
||||
subscriptionId?: number,
|
||||
): Promise<{ status: string; redirect_url: string | null }> => {
|
||||
const response = await apiClient.post(
|
||||
'/cabinet/subscription/platega-recurrent/enable',
|
||||
...bodyWithSubId({}, subscriptionId),
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
cancelSbpRecurring: async (subscriptionId?: number): Promise<{ status: string }> => {
|
||||
const response = await apiClient.post(
|
||||
'/cabinet/subscription/platega-recurrent/cancel',
|
||||
...bodyWithSubId({}, subscriptionId),
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// ── Trial ───────────────────────────────────────────────────────────
|
||||
|
||||
getTrialInfo: async (): Promise<TrialInfo> => {
|
||||
|
||||
Reference in New Issue
Block a user