@lomi./sdk
Version:
Official TypeScript SDK for the lomi. API
211 lines • 6.95 kB
JavaScript
import { OpenAPI } from '../core/OpenAPI.js';
import { request as __request } from '../core/request.js';
export class CheckoutService {
/**
* List checkout sessions
* Checkout sessions - create hosted payment pages
* @returns any Successful response with paginated data
* @throws ApiError
*/
static listCheckoutSessions({ limit = 20, offset, sort, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/checkout_sessions',
query: {
'limit': limit,
'offset': offset,
'sort': sort,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Create checkout session
* Checkout sessions - create hosted payment pages
* @returns checkout_sessions Checkout_session successfully created
* @throws ApiError
*/
static createCheckoutSession({ requestBody, }) {
return __request(OpenAPI, {
method: 'POST',
url: '/checkout_sessions',
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad request - Invalid input`,
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Retrieve checkout session
* Retrieve a specific checkout session by its unique identifier.
* @returns checkout_sessions Checkout_session retrieved successfully
* @throws ApiError
*/
static retrieveCheckoutSession({ sessionId, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/checkout_sessions/{session_id}',
path: {
'session_id': sessionId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* Update checkout session
* Update a specific checkout session. Only provided fields will be updated.
* @returns checkout_sessions Checkout_session successfully updated
* @throws ApiError
*/
static updateCheckoutSession({ sessionId, requestBody, }) {
return __request(OpenAPI, {
method: 'PATCH',
url: '/checkout_sessions/{session_id}',
path: {
'session_id': sessionId,
},
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad request - Invalid input`,
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* Delete checkout session
* Delete a specific checkout session. This action cannot be undone.
* @returns void
* @throws ApiError
*/
static deleteCheckoutSession({ sessionId, }) {
return __request(OpenAPI, {
method: 'DELETE',
url: '/checkout_sessions/{session_id}',
path: {
'session_id': sessionId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* List payment links
* Payment links - shareable payment URLs
* @returns any Successful response with paginated data
* @throws ApiError
*/
static listPaymentLinks({ limit = 20, offset, sort, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/payment_links',
query: {
'limit': limit,
'offset': offset,
'sort': sort,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Create payment link
* Payment links - shareable payment URLs
* @returns payment_links Payment_link successfully created
* @throws ApiError
*/
static createPaymentLink({ requestBody, }) {
return __request(OpenAPI, {
method: 'POST',
url: '/payment_links',
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad request - Invalid input`,
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Retrieve payment link
* Retrieve a specific payment link by its unique identifier.
* @returns payment_links Payment_link retrieved successfully
* @throws ApiError
*/
static retrievePaymentLink({ linkId, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/payment_links/{link_id}',
path: {
'link_id': linkId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* Update payment link
* Update a specific payment link. Only provided fields will be updated.
* @returns payment_links Payment_link successfully updated
* @throws ApiError
*/
static updatePaymentLink({ linkId, requestBody, }) {
return __request(OpenAPI, {
method: 'PATCH',
url: '/payment_links/{link_id}',
path: {
'link_id': linkId,
},
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad request - Invalid input`,
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* Delete payment link
* Delete a specific payment link. This action cannot be undone.
* @returns void
* @throws ApiError
*/
static deletePaymentLink({ linkId, }) {
return __request(OpenAPI, {
method: 'DELETE',
url: '/payment_links/{link_id}',
path: {
'link_id': linkId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
}
//# sourceMappingURL=CheckoutService.js.map