autumn-js
Version:
Autumn JS Library
54 lines (50 loc) • 1.53 kB
JavaScript
"use client";
import {
toSnakeCase
} from "./chunk-KQT5G3HT.mjs";
// src/libraries/react/client/clientGenMethods.ts
async function checkoutMethod(params) {
let snakeParams = toSnakeCase(params);
const res = await this.post(`${this.prefix}/checkout`, snakeParams);
return res;
}
async function attachMethod(params) {
let snakeParams = toSnakeCase(params, ["checkoutSessionparams"]);
const res = await this.post(`${this.prefix}/attach`, snakeParams);
return res;
}
async function setupPaymentMethod(params) {
let snakeParams = toSnakeCase(params, ["checkoutSessionParams"]);
const res = await this.post(`${this.prefix}/setup_payment`, snakeParams);
return res;
}
async function cancelMethod(params) {
let snakeParams = toSnakeCase(params);
const res = await this.post(`${this.prefix}/cancel`, snakeParams);
return res;
}
async function checkMethod(params) {
let { dialog, ...rest } = params;
let snakeParams = toSnakeCase(rest);
const res = await this.post(`${this.prefix}/check`, snakeParams);
return res;
}
async function trackMethod(params) {
let snakeParams = toSnakeCase(params);
const res = await this.post(`${this.prefix}/track`, snakeParams);
return res;
}
async function openBillingPortalMethod(params) {
let snakeParams = toSnakeCase(params || {});
const res = await this.post(`${this.prefix}/billing_portal`, snakeParams);
return res;
}
export {
checkoutMethod,
attachMethod,
setupPaymentMethod,
cancelMethod,
checkMethod,
trackMethod,
openBillingPortalMethod
};