0.2.1 • Published 6 months ago
@kohortpay/sdk v0.2.1
kohortPay/sdk
🏗 Welcome to your new SDK! 🏗
It has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps:
- 🛠 Make your SDK feel handcrafted by customizing it
- ♻️ Refine your SDK quickly by iterating locally with the Speakeasy CLI
- 🎁 Publish your SDK to package managers by configuring automatic publishing
- ✨ When ready to productionize, delete this section from the README
SDK Installation
NPM
npm add @kohortpay/sdk
Yarn
yarn add @kohortpay/sdk
SDK Example Usage
import { KohortPay } from "@kohortpay/sdk";
import { CheckoutSessionsControllerCreateSecurity } from "@kohortpay/sdk/dist/sdk/models/operations";
(async () => {
const sdk = new KohortPay();
const operationSecurity: CheckoutSessionsControllerCreateSecurity = {
basic: {
password: "",
username: "",
},
};
const res = await sdk.checkoutSessionsAPI.checkoutSessionsControllerCreate(
{
cancelUrl: "https://cancel.example.com",
customerEmail: "customer@example.com",
customerFirstName: "John",
customerId: "user_xxxxxxxxxxxxxxxx",
customerLastName: "Doe",
expiresAt: new Date("2023-10-02T14:30:00.000Z"),
lineItems: [
{
description: "Item Description",
imageUrl: "https://example.com/image.jpg",
name: "Item Name",
price: 100,
quantity: 1,
},
],
metadata: {},
successUrl: "https://success.example.com",
},
operationSecurity
);
if (res.statusCode == 200) {
// handle response
}
})();
Available Resources and Operations
checkoutSessionsAPI
- checkoutSessionsControllerCreate - Create a new checkout session.
- checkoutSessionsControllerExpire - Expire a checkout session by ID for the current organization and livemode.
- checkoutSessionsControllerFindAll - Retrieve all checkout sessions for the current organization and livemode.
- checkoutSessionsControllerFindOne - Retrieve a checkout session by ID for the current organization and livemode.
organizations
- organizationsControllerFindCheckoutSettings - Retrieve checkout settings for a specified organization ID.
- organizationsControllerFindPaymentGroupSettings
- organizationsControllerUpdate - Update the details of a specified organization.
- organizationsControllerUpdateCheckoutSettings - Update checkout settings for a specified organization ID.
- organizationsControllerUpdatePaymentGroupSettings - Update an organization by ID.
- organizationsFindOne - Retrieve an organization by ID or Clerk ID.
paymentGroups
- paymentGroupsControllerCancel - Cancel a payment group by id
- paymentGroupsControllerCreate - Create a new payment group
- paymentGroupsControllerExpire - Expire a payment group by id
- paymentGroupsControllerFindAll - Retrieve all payment groups
- paymentGroupsControllerFindOne - Retrieve a payment group by id
- paymentGroupsControllerParticipants - Retrieve participants of a payment group by id
- paymentGroupsControllerUpdate - Update a payment group by id
- paymentGroupsControllerValidate - Validate a payment group by id
paymentGroupSettingsAPI
- paymentGroupSettingsControllerFindOne - Retrieve payment group settings by ID.
- paymentGroupSettingsControllerUpdate - Update payment group settings by ID.
paymentIntents
- paymentIntentsControllerCancel - Cancel a Payment Intent by ID
- paymentIntentsControllerCreate - Create a new Payment Intent
- paymentIntentsControllerFindAll - Retrieve all Payment Intents
- paymentIntentsControllerFindOne - Retrieve a Payment Intent by ID
Development
Maturity
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
Contributions
While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!