0.4.0 • Published 6 months ago

kohortpay-checkout v0.4.0

Weekly downloads
-
License
-
Repository
github
Last release
6 months ago

kohortpay-checkout

SDK Installation

NPM

npm add kohortpay-checkout

Yarn

yarn add kohortpay-checkout

SDK Example Usage

import { Kohortpay } from "kohortpay-checkout";
import { CheckoutSessionsControllerCreateSecurity } from "kohortpay-checkout/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

organizations

paymentGroups

paymentGroupSettingsAPI

paymentIntents

Pagination

Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the returned response object will have a next method that can be called to pull down the next group of results. If the return value of next is null, then there are no more pages to be fetched.

Here's an example of one such pagination call:

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!

SDK Created by Speakeasy

0.4.0

6 months ago

0.3.0

7 months ago

0.2.1

7 months ago

0.2.0

7 months ago

0.1.6

7 months ago

0.1.5

7 months ago

0.1.4

7 months ago

0.1.3

7 months ago

0.1.2

7 months ago

0.1.1

7 months ago

0.1.0

7 months ago