@cometh/checkout-sdk
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -300,2 +300,9 @@ export declare const $LydiaSettings: { | ||
}; | ||
readonly webhookEndpoint: { | ||
readonly description: "URL of the endpoint which should be notified for webhook events"; | ||
readonly type: "string"; | ||
readonly format: "uri"; | ||
readonly nullable: true; | ||
readonly example: "https://example.com/my-webhook"; | ||
}; | ||
}; | ||
@@ -327,2 +334,7 @@ }; | ||
}; | ||
readonly crypto: { | ||
readonly description: "Instead of using a fiat PSP, use crypto for payments"; | ||
readonly type: "boolean"; | ||
readonly default: false; | ||
}; | ||
readonly userAddress: { | ||
@@ -377,2 +389,43 @@ readonly description: "Wallet which would receive the purchased NFT"; | ||
}; | ||
export declare const $Permit2Request: { | ||
readonly additionalProperties: false; | ||
readonly description: "`Permit2` data with signature"; | ||
readonly type: "object"; | ||
readonly required: readonly ["transactionId", "nonce", "deadline", "signature"]; | ||
readonly properties: { | ||
readonly transactionId: { | ||
readonly type: "string"; | ||
readonly nullable: false; | ||
}; | ||
readonly nonce: { | ||
readonly type: "string"; | ||
readonly nullable: false; | ||
}; | ||
readonly deadline: { | ||
readonly type: "string"; | ||
readonly nullable: false; | ||
}; | ||
readonly signature: { | ||
readonly type: "string"; | ||
readonly nullable: false; | ||
}; | ||
}; | ||
}; | ||
export declare const $CryptoPurchaseTransactionToSign: { | ||
readonly additionalProperties: false; | ||
readonly properties: { | ||
readonly to: { | ||
readonly type: "string"; | ||
readonly nullable: false; | ||
}; | ||
readonly data: { | ||
readonly type: "string"; | ||
readonly nullable: false; | ||
}; | ||
readonly value: { | ||
readonly type: "string"; | ||
readonly nullable: false; | ||
}; | ||
}; | ||
}; | ||
export declare const $PageLimit: { | ||
@@ -396,3 +449,3 @@ readonly type: "number"; | ||
readonly type: "object"; | ||
readonly required: readonly ["id", "productId", "price", "fees", "vatPrice", "taxCalculationId", "fullPrice", "currency", "chainId", "status", "userAddress", "txHash", "createdAt"]; | ||
readonly required: readonly ["id", "productId", "pspType", "pspIdentifier", "price", "fees", "vatPrice", "taxCalculationId", "fullPrice", "currency", "chainId", "status", "userAddress", "pspPublicInfos", "txHash", "createdAt"]; | ||
readonly properties: { | ||
@@ -410,2 +463,13 @@ readonly id: { | ||
}; | ||
readonly pspType: { | ||
readonly type: "string"; | ||
readonly enum: readonly ["Lydia", "Stripe", "Crypto"]; | ||
readonly readOnly: true; | ||
}; | ||
readonly pspIdentifier: { | ||
readonly description: "Identifier specific to the PSP"; | ||
readonly type: "string"; | ||
readonly readOnly: true; | ||
readonly example: "12097878"; | ||
}; | ||
readonly price: { | ||
@@ -463,2 +527,8 @@ readonly $ref: "#/components/schemas/Price"; | ||
}; | ||
readonly pspPublicInfos: { | ||
readonly description: "Any public data specific to the checkout session for this PSP"; | ||
readonly type: "object"; | ||
readonly readOnly: true; | ||
readonly additionalProperties: true; | ||
}; | ||
readonly txHash: { | ||
@@ -498,3 +568,3 @@ readonly description: "Hash of the transaction on the blockchain"; | ||
readonly type: "object"; | ||
readonly required: readonly ["email", "pspType", "pspIdentifier", "pspInfos", "relayedTxnId"]; | ||
readonly required: readonly ["email", "pspInfos", "relayedTxnId"]; | ||
readonly properties: { | ||
@@ -508,13 +578,2 @@ readonly email: { | ||
}; | ||
readonly pspType: { | ||
readonly type: "string"; | ||
readonly enum: readonly ["Lydia", "Stripe"]; | ||
readonly readOnly: true; | ||
}; | ||
readonly pspIdentifier: { | ||
readonly description: "Identifier specific to the PSP"; | ||
readonly type: "string"; | ||
readonly readOnly: true; | ||
readonly example: "12097878"; | ||
}; | ||
readonly pspInfos: { | ||
@@ -568,2 +627,8 @@ readonly description: "Any data specific to the checkout session for this PSP"; | ||
}; | ||
readonly customerIp: { | ||
readonly description: "IP address of the customer"; | ||
readonly type: "string"; | ||
readonly readOnly: true; | ||
readonly example: "8.8.8.8"; | ||
}; | ||
}; | ||
@@ -806,11 +871,7 @@ }]; | ||
}; | ||
export declare const $ProjectFees: { | ||
export declare const $ProjectStripeFees: { | ||
readonly additionalProperties: false; | ||
readonly type: "object"; | ||
readonly required: readonly ["projectId", "feePercentage", "minimumFee", "includeStripeFee", "createdAt", "updatedAt"]; | ||
readonly required: readonly ["feePercentage", "minimumFee", "includeStripeFee"]; | ||
readonly properties: { | ||
readonly projectId: { | ||
readonly type: "string"; | ||
readonly description: "Project ID"; | ||
}; | ||
readonly feePercentage: { | ||
@@ -831,2 +892,31 @@ readonly type: "integer"; | ||
}; | ||
}; | ||
}; | ||
export declare const $ProjectCryptoFees: { | ||
readonly additionalProperties: false; | ||
readonly type: "object"; | ||
readonly required: readonly ["feePercentage"]; | ||
readonly properties: { | ||
readonly feePercentage: { | ||
readonly type: "integer"; | ||
readonly description: "Project fee in base point. 1050 means 10.50%"; | ||
readonly example: 1050; | ||
}; | ||
}; | ||
}; | ||
export declare const $ProjectFees: { | ||
readonly additionalProperties: false; | ||
readonly type: "object"; | ||
readonly required: readonly ["projectId", "createdAt", "updatedAt"]; | ||
readonly properties: { | ||
readonly projectId: { | ||
readonly type: "string"; | ||
readonly description: "Project ID"; | ||
}; | ||
readonly stripe: { | ||
readonly $ref: "#/components/schemas/ProjectStripeFees"; | ||
}; | ||
readonly crypto: { | ||
readonly $ref: "#/components/schemas/ProjectCryptoFees"; | ||
}; | ||
readonly createdAt: { | ||
@@ -849,19 +939,10 @@ readonly type: "string"; | ||
readonly type: "object"; | ||
readonly required: readonly ["feePercentage", "minimumFee", "includeStripeFee"]; | ||
readonly required: readonly ["stripe", "crypto"]; | ||
readonly properties: { | ||
readonly feePercentage: { | ||
readonly type: "integer"; | ||
readonly description: "Project fee in base point. 1050 means 10.50%"; | ||
readonly example: 1050; | ||
readonly stripe: { | ||
readonly $ref: "#/components/schemas/ProjectStripeFees"; | ||
}; | ||
readonly minimumFee: { | ||
readonly type: "integer"; | ||
readonly description: "Minimum fee in cents. 125 means $1.25"; | ||
readonly example: 125; | ||
readonly crypto: { | ||
readonly $ref: "#/components/schemas/ProjectCryptoFees"; | ||
}; | ||
readonly includeStripeFee: { | ||
readonly type: "boolean"; | ||
readonly description: "Include Stripe fee in the project fee"; | ||
readonly example: false; | ||
}; | ||
}; | ||
@@ -868,0 +949,0 @@ }; |
@@ -306,2 +306,9 @@ // This file is auto-generated by @hey-api/openapi-ts | ||
example: 'to' | ||
}, | ||
webhookEndpoint: { | ||
description: 'URL of the endpoint which should be notified for webhook events', | ||
type: 'string', | ||
format: 'uri', | ||
nullable: true, | ||
example: 'https://example.com/my-webhook' | ||
} | ||
@@ -334,2 +341,7 @@ } | ||
}, | ||
crypto: { | ||
description: 'Instead of using a fiat PSP, use crypto for payments', | ||
type: 'boolean', | ||
default: false | ||
}, | ||
userAddress: { | ||
@@ -384,2 +396,43 @@ description: 'Wallet which would receive the purchased NFT', | ||
}; | ||
export const $Permit2Request = { | ||
additionalProperties: false, | ||
description: `\`Permit2\` data with signature`, | ||
type: 'object', | ||
required: ['transactionId', 'nonce', 'deadline', 'signature'], | ||
properties: { | ||
transactionId: { | ||
type: 'string', | ||
nullable: false | ||
}, | ||
nonce: { | ||
type: 'string', | ||
nullable: false | ||
}, | ||
deadline: { | ||
type: 'string', | ||
nullable: false | ||
}, | ||
signature: { | ||
type: 'string', | ||
nullable: false | ||
} | ||
} | ||
}; | ||
export const $CryptoPurchaseTransactionToSign = { | ||
additionalProperties: false, | ||
properties: { | ||
to: { | ||
type: 'string', | ||
nullable: false | ||
}, | ||
data: { | ||
type: 'string', | ||
nullable: false | ||
}, | ||
value: { | ||
type: 'string', | ||
nullable: false | ||
} | ||
} | ||
}; | ||
export const $PageLimit = { | ||
@@ -403,3 +456,3 @@ type: 'number', | ||
type: 'object', | ||
required: ['id', 'productId', 'price', 'fees', 'vatPrice', 'taxCalculationId', 'fullPrice', 'currency', 'chainId', 'status', 'userAddress', 'txHash', 'createdAt'], | ||
required: ['id', 'productId', 'pspType', 'pspIdentifier', 'price', 'fees', 'vatPrice', 'taxCalculationId', 'fullPrice', 'currency', 'chainId', 'status', 'userAddress', 'pspPublicInfos', 'txHash', 'createdAt'], | ||
properties: { | ||
@@ -417,2 +470,13 @@ id: { | ||
}, | ||
pspType: { | ||
type: 'string', | ||
enum: ['Lydia', 'Stripe', 'Crypto'], | ||
readOnly: true | ||
}, | ||
pspIdentifier: { | ||
description: 'Identifier specific to the PSP', | ||
type: 'string', | ||
readOnly: true, | ||
example: '12097878' | ||
}, | ||
price: { | ||
@@ -470,2 +534,8 @@ '$ref': '#/components/schemas/Price', | ||
}, | ||
pspPublicInfos: { | ||
description: 'Any public data specific to the checkout session for this PSP', | ||
type: 'object', | ||
readOnly: true, | ||
additionalProperties: true | ||
}, | ||
txHash: { | ||
@@ -511,3 +581,3 @@ description: 'Hash of the transaction on the blockchain', | ||
type: 'object', | ||
required: ['email', 'pspType', 'pspIdentifier', 'pspInfos', 'relayedTxnId'], | ||
required: ['email', 'pspInfos', 'relayedTxnId'], | ||
properties: { | ||
@@ -521,13 +591,2 @@ email: { | ||
}, | ||
pspType: { | ||
type: 'string', | ||
enum: ['Lydia', 'Stripe'], | ||
readOnly: true | ||
}, | ||
pspIdentifier: { | ||
description: 'Identifier specific to the PSP', | ||
type: 'string', | ||
readOnly: true, | ||
example: '12097878' | ||
}, | ||
pspInfos: { | ||
@@ -580,2 +639,8 @@ description: 'Any data specific to the checkout session for this PSP', | ||
example: false | ||
}, | ||
customerIp: { | ||
description: 'IP address of the customer', | ||
type: 'string', | ||
readOnly: true, | ||
example: '8.8.8.8' | ||
} | ||
@@ -822,11 +887,7 @@ } | ||
}; | ||
export const $ProjectFees = { | ||
export const $ProjectStripeFees = { | ||
additionalProperties: false, | ||
type: 'object', | ||
required: ['projectId', 'feePercentage', 'minimumFee', 'includeStripeFee', 'createdAt', 'updatedAt'], | ||
required: ['feePercentage', 'minimumFee', 'includeStripeFee'], | ||
properties: { | ||
projectId: { | ||
type: 'string', | ||
description: 'Project ID' | ||
}, | ||
feePercentage: { | ||
@@ -846,3 +907,32 @@ type: 'integer', | ||
example: false | ||
} | ||
} | ||
}; | ||
export const $ProjectCryptoFees = { | ||
additionalProperties: false, | ||
type: 'object', | ||
required: ['feePercentage'], | ||
properties: { | ||
feePercentage: { | ||
type: 'integer', | ||
description: 'Project fee in base point. 1050 means 10.50%', | ||
example: 1050 | ||
} | ||
} | ||
}; | ||
export const $ProjectFees = { | ||
additionalProperties: false, | ||
type: 'object', | ||
required: ['projectId', 'createdAt', 'updatedAt'], | ||
properties: { | ||
projectId: { | ||
type: 'string', | ||
description: 'Project ID' | ||
}, | ||
stripe: { | ||
'$ref': '#/components/schemas/ProjectStripeFees' | ||
}, | ||
crypto: { | ||
'$ref': '#/components/schemas/ProjectCryptoFees' | ||
}, | ||
createdAt: { | ||
@@ -865,18 +955,9 @@ type: 'string', | ||
type: 'object', | ||
required: ['feePercentage', 'minimumFee', 'includeStripeFee'], | ||
required: ['stripe', 'crypto'], | ||
properties: { | ||
feePercentage: { | ||
type: 'integer', | ||
description: 'Project fee in base point. 1050 means 10.50%', | ||
example: 1050 | ||
stripe: { | ||
'$ref': '#/components/schemas/ProjectStripeFees' | ||
}, | ||
minimumFee: { | ||
type: 'integer', | ||
description: 'Minimum fee in cents. 125 means $1.25', | ||
example: 125 | ||
}, | ||
includeStripeFee: { | ||
type: 'boolean', | ||
description: 'Include Stripe fee in the project fee', | ||
example: false | ||
crypto: { | ||
'$ref': '#/components/schemas/ProjectCryptoFees' | ||
} | ||
@@ -883,0 +964,0 @@ } |
import type { CancelablePromise } from './core/CancelablePromise'; | ||
import type { BaseHttpRequest } from './core/BaseHttpRequest'; | ||
import type { GetProjectSettingsResponse, SetProjectSettingsData, SetProjectSettingsResponse, UpdateProjectSettingsData, UpdateProjectSettingsResponse, GetPublicProjectSettingsResponse, GetProductsResponse, CreateProductData, CreateProductResponse, GetProductByIdData, GetProductByIdResponse, UpdateProductData, UpdateProductResponse, DeleteProductData, DeleteProductResponse, CreateCheckoutSessionData, CreateCheckoutSessionResponse, GetTransactionsData, GetTransactionsResponse, GetTransactionByIdData, GetTransactionByIdResponse, RetryTransactionByIdData, RetryTransactionByIdResponse, GetPublicTransactionByIdData, GetPublicTransactionByIdResponse, LydiaHandleEventData, LydiaHandleEventResponse, StripeCreateConnectAccountData, StripeCreateConnectAccountResponse, StripeLinkConnectAccountData, StripeLinkConnectAccountResponse, StripeHandleEventData, StripeHandleEventResponse, WhitelistClientContractData, WhitelistClientContractResponse, GetWhitelistedContractsOfProjectData, GetWhitelistedContractsOfProjectResponse, DeleteFromWhitelistOfProjectData, DeleteFromWhitelistOfProjectResponse, UpdateWhitelistContractData, UpdateWhitelistContractResponse, GetProjectFeePercentagesResponse, UpdateProjectFeePercentageData, UpdateProjectFeePercentageResponse, AddContractToReviewData, AddContractToReviewResponse, GetWhitelistedContractsResponse } from './types.gen'; | ||
import type { GetProjectSettingsResponse, SetProjectSettingsData, SetProjectSettingsResponse, UpdateProjectSettingsData, UpdateProjectSettingsResponse, GetPublicProjectSettingsResponse, GetProductsResponse, CreateProductData, CreateProductResponse, GetProductByIdData, GetProductByIdResponse, UpdateProductData, UpdateProductResponse, DeleteProductData, DeleteProductResponse, CreateCheckoutSessionData, CreateCheckoutSessionResponse, GetCrypto2CryptoTransactionToSignData, GetCrypto2CryptoTransactionToSignResponse, GetTransactionsData, GetTransactionsResponse, GetTransactionByIdData, GetTransactionByIdResponse, RetryTransactionByIdData, RetryTransactionByIdResponse, GetPublicTransactionByIdData, GetPublicTransactionByIdResponse, LydiaHandleEventData, LydiaHandleEventResponse, StripeCreateConnectAccountData, StripeCreateConnectAccountResponse, StripeLinkConnectAccountData, StripeLinkConnectAccountResponse, StripeHandleEventData, StripeHandleEventResponse, WhitelistClientContractData, WhitelistClientContractResponse, GetWhitelistedContractsOfProjectData, GetWhitelistedContractsOfProjectResponse, DeleteFromWhitelistOfProjectData, DeleteFromWhitelistOfProjectResponse, UpdateWhitelistContractData, UpdateWhitelistContractResponse, GetProjectFeePercentagesResponse, UpdateProjectFeePercentageData, UpdateProjectFeePercentageResponse, AddContractToReviewData, AddContractToReviewResponse, GetWhitelistedContractsResponse } from './types.gen'; | ||
export declare class SettingsService { | ||
@@ -100,2 +100,11 @@ readonly httpRequest: BaseHttpRequest; | ||
createCheckoutSession(data: CreateCheckoutSessionData): CancelablePromise<CreateCheckoutSessionResponse>; | ||
/** | ||
* Get transaction the user has to sign | ||
* Only for crypto purchases. | ||
* @param data The data for the request. | ||
* @param data.requestBody | ||
* @returns CryptoPurchaseTransactionToSign URL where to redirect user to begin the purchase funnel | ||
* @throws ApiError | ||
*/ | ||
getCrypto2CryptoTransactionToSign(data: GetCrypto2CryptoTransactionToSignData): CancelablePromise<GetCrypto2CryptoTransactionToSignResponse>; | ||
} | ||
@@ -102,0 +111,0 @@ export declare class TransactionsService { |
@@ -240,6 +240,31 @@ // This file is auto-generated by @hey-api/openapi-ts | ||
422: 'Unprocessable entity.', | ||
500: 'Internal server error' | ||
500: 'Internal server error', | ||
503: 'Service unavailable error' | ||
} | ||
}); | ||
} | ||
/** | ||
* Get transaction the user has to sign | ||
* Only for crypto purchases. | ||
* @param data The data for the request. | ||
* @param data.requestBody | ||
* @returns CryptoPurchaseTransactionToSign URL where to redirect user to begin the purchase funnel | ||
* @throws ApiError | ||
*/ | ||
getCrypto2CryptoTransactionToSign(data) { | ||
return this.httpRequest.request({ | ||
method: 'POST', | ||
url: '/checkout-sessions/crypto', | ||
body: data.requestBody, | ||
mediaType: 'application/json', | ||
errors: { | ||
400: 'Invalid input, object invalid.', | ||
403: 'Resource is access restricted.', | ||
404: 'Ressource not found.', | ||
422: 'Unprocessable entity.', | ||
500: 'Internal server error', | ||
503: 'Service unavailable error' | ||
} | ||
}); | ||
} | ||
} | ||
@@ -246,0 +271,0 @@ export class TransactionsService { |
@@ -190,2 +190,6 @@ export type LydiaSettings = { | ||
recipientParamName: string | null; | ||
/** | ||
* URL of the endpoint which should be notified for webhook events | ||
*/ | ||
webhookEndpoint?: string | null; | ||
}; | ||
@@ -206,2 +210,6 @@ /** | ||
/** | ||
* Instead of using a fiat PSP, use crypto for payments | ||
*/ | ||
crypto?: boolean; | ||
/** | ||
* Wallet which would receive the purchased NFT | ||
@@ -239,2 +247,16 @@ */ | ||
/** | ||
* `Permit2` data with signature | ||
*/ | ||
export type Permit2Request = { | ||
transactionId: string; | ||
nonce: string; | ||
deadline: string; | ||
signature: string; | ||
}; | ||
export type CryptoPurchaseTransactionToSign = { | ||
to?: string; | ||
data?: string; | ||
value?: string; | ||
}; | ||
/** | ||
* The number of items to return per request. If limit is 0, then no limit is applied. | ||
@@ -250,2 +272,7 @@ */ | ||
readonly productId: number; | ||
readonly pspType: 'Lydia' | 'Stripe' | 'Crypto'; | ||
/** | ||
* Identifier specific to the PSP | ||
*/ | ||
readonly pspIdentifier: string; | ||
readonly price: Price; | ||
@@ -279,2 +306,8 @@ /** | ||
/** | ||
* Any public data specific to the checkout session for this PSP | ||
*/ | ||
readonly pspPublicInfos: { | ||
[key: string]: unknown; | ||
}; | ||
/** | ||
* Hash of the transaction on the blockchain | ||
@@ -292,2 +325,8 @@ */ | ||
}; | ||
export type pspType = 'Lydia' | 'Stripe' | 'Crypto'; | ||
export declare const pspType: { | ||
readonly LYDIA: "Lydia"; | ||
readonly STRIPE: "Stripe"; | ||
readonly CRYPTO: "Crypto"; | ||
}; | ||
/** | ||
@@ -323,8 +362,3 @@ * Status of the transaction | ||
readonly email: string | null; | ||
readonly pspType: 'Lydia' | 'Stripe'; | ||
/** | ||
* Identifier specific to the PSP | ||
*/ | ||
readonly pspIdentifier: string; | ||
/** | ||
* Any data specific to the checkout session for this PSP | ||
@@ -363,8 +397,7 @@ */ | ||
includeStripeFee?: boolean; | ||
/** | ||
* IP address of the customer | ||
*/ | ||
readonly customerIp?: string; | ||
}; | ||
export type pspType = 'Lydia' | 'Stripe'; | ||
export declare const pspType: { | ||
readonly LYDIA: "Lydia"; | ||
readonly STRIPE: "Stripe"; | ||
}; | ||
export type PaginatedTransactions = { | ||
@@ -483,8 +516,4 @@ /** | ||
}; | ||
export type ProjectFees = { | ||
export type ProjectStripeFees = { | ||
/** | ||
* Project ID | ||
*/ | ||
projectId: string; | ||
/** | ||
* Project fee in base point. 1050 means 10.50% | ||
@@ -501,3 +530,17 @@ */ | ||
includeStripeFee: boolean; | ||
}; | ||
export type ProjectCryptoFees = { | ||
/** | ||
* Project fee in base point. 1050 means 10.50% | ||
*/ | ||
feePercentage: number; | ||
}; | ||
export type ProjectFees = { | ||
/** | ||
* Project ID | ||
*/ | ||
projectId: string; | ||
stripe?: ProjectStripeFees; | ||
crypto?: ProjectCryptoFees; | ||
/** | ||
* Creation date | ||
@@ -512,14 +555,4 @@ */ | ||
export type ProjectFeeUpdateRequest = { | ||
/** | ||
* Project fee in base point. 1050 means 10.50% | ||
*/ | ||
feePercentage: number; | ||
/** | ||
* Minimum fee in cents. 125 means $1.25 | ||
*/ | ||
minimumFee: number; | ||
/** | ||
* Include Stripe fee in the project fee | ||
*/ | ||
includeStripeFee: boolean; | ||
stripe: ProjectStripeFees; | ||
crypto: ProjectCryptoFees; | ||
}; | ||
@@ -569,2 +602,6 @@ export type ReviewWhitelistRequest = { | ||
export type CreateCheckoutSessionResponse = CheckoutSessionResponse; | ||
export type GetCrypto2CryptoTransactionToSignData = { | ||
requestBody: Permit2Request; | ||
}; | ||
export type GetCrypto2CryptoTransactionToSignResponse = CryptoPurchaseTransactionToSign; | ||
export type GetTransactionsData = { | ||
@@ -1075,5 +1112,61 @@ limit?: PageLimit; | ||
}; | ||
/** | ||
* Service unavailable error | ||
*/ | ||
503: { | ||
message?: string; | ||
errors?: unknown[]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
'/checkout-sessions/crypto': { | ||
post: { | ||
req: GetCrypto2CryptoTransactionToSignData; | ||
res: { | ||
/** | ||
* URL where to redirect user to begin the purchase funnel | ||
*/ | ||
200: CryptoPurchaseTransactionToSign; | ||
/** | ||
* Invalid input, object invalid. | ||
*/ | ||
400: { | ||
message?: string; | ||
}; | ||
/** | ||
* Resource is access restricted. | ||
*/ | ||
403: { | ||
message?: string; | ||
}; | ||
/** | ||
* Ressource not found. | ||
*/ | ||
404: { | ||
message?: string; | ||
}; | ||
/** | ||
* Unprocessable entity. | ||
*/ | ||
422: { | ||
message?: string; | ||
}; | ||
/** | ||
* Internal server error | ||
*/ | ||
500: { | ||
message?: string; | ||
errors?: unknown[]; | ||
}; | ||
/** | ||
* Service unavailable error | ||
*/ | ||
503: { | ||
message?: string; | ||
errors?: unknown[]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
'/transactions': { | ||
@@ -1080,0 +1173,0 @@ get: { |
@@ -36,2 +36,7 @@ // This file is auto-generated by @hey-api/openapi-ts | ||
}; | ||
export const pspType = { | ||
LYDIA: 'Lydia', | ||
STRIPE: 'Stripe', | ||
CRYPTO: 'Crypto' | ||
}; | ||
/** | ||
@@ -50,6 +55,2 @@ * Status of the transaction | ||
}; | ||
export const pspType = { | ||
LYDIA: 'Lydia', | ||
STRIPE: 'Stripe' | ||
}; | ||
export const businessType = { | ||
@@ -56,0 +57,0 @@ COMPANY: 'company', |
{ | ||
"name": "@cometh/checkout-sdk", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "SDK to use Cometh Checkout API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
# @cometh/checkout-sdk | ||
This is a TypeScript SDK for interacting with the Fiat Minting API. It simplifies the process of making requests to the API by providing convenient methods for various operations related to NFTs (Non-Fungible Tokens). These operations include managing and searching for assets, handling collections, and analyzing NFT data. | ||
This is a TypeScript SDK for interacting with the Checkout API. | ||
@@ -34,3 +34,3 @@ | ||
```ts | ||
const fiatApi = new CheckoutAPI(); | ||
const chekout = new CheckoutAPI(); | ||
``` |
@@ -324,2 +324,9 @@ // This file is auto-generated by @hey-api/openapi-ts | ||
example: 'to' | ||
}, | ||
webhookEndpoint: { | ||
description: 'URL of the endpoint which should be notified for webhook events', | ||
type: 'string', | ||
format: 'uri', | ||
nullable: true, | ||
example: 'https://example.com/my-webhook' | ||
} | ||
@@ -355,2 +362,7 @@ } | ||
}, | ||
crypto: { | ||
description: 'Instead of using a fiat PSP, use crypto for payments', | ||
type: 'boolean', | ||
default: false | ||
}, | ||
userAddress: { | ||
@@ -407,2 +419,45 @@ description: 'Wallet which would receive the purchased NFT', | ||
export const $Permit2Request = { | ||
additionalProperties: false, | ||
description: `\`Permit2\` data with signature`, | ||
type: 'object', | ||
required: ['transactionId', 'nonce', 'deadline', 'signature'], | ||
properties: { | ||
transactionId: { | ||
type: 'string', | ||
nullable: false | ||
}, | ||
nonce: { | ||
type: 'string', | ||
nullable: false | ||
}, | ||
deadline: { | ||
type: 'string', | ||
nullable: false | ||
}, | ||
signature: { | ||
type: 'string', | ||
nullable: false | ||
} | ||
} | ||
} as const; | ||
export const $CryptoPurchaseTransactionToSign = { | ||
additionalProperties: false, | ||
properties: { | ||
to: { | ||
type: 'string', | ||
nullable: false | ||
}, | ||
data: { | ||
type: 'string', | ||
nullable: false | ||
}, | ||
value: { | ||
type: 'string', | ||
nullable: false | ||
} | ||
} | ||
} as const; | ||
export const $PageLimit = { | ||
@@ -428,3 +483,3 @@ type: 'number', | ||
type: 'object', | ||
required: ['id', 'productId', 'price', 'fees', 'vatPrice', 'taxCalculationId', 'fullPrice', 'currency', 'chainId', 'status', 'userAddress', 'txHash', 'createdAt'], | ||
required: ['id', 'productId', 'pspType', 'pspIdentifier', 'price', 'fees', 'vatPrice', 'taxCalculationId', 'fullPrice', 'currency', 'chainId', 'status', 'userAddress', 'pspPublicInfos', 'txHash', 'createdAt'], | ||
properties: { | ||
@@ -442,2 +497,13 @@ id: { | ||
}, | ||
pspType: { | ||
type: 'string', | ||
enum: ['Lydia', 'Stripe', 'Crypto'], | ||
readOnly: true | ||
}, | ||
pspIdentifier: { | ||
description: 'Identifier specific to the PSP', | ||
type: 'string', | ||
readOnly: true, | ||
example: '12097878' | ||
}, | ||
price: { | ||
@@ -495,2 +561,8 @@ '$ref': '#/components/schemas/Price', | ||
}, | ||
pspPublicInfos: { | ||
description: 'Any public data specific to the checkout session for this PSP', | ||
type: 'object', | ||
readOnly: true, | ||
additionalProperties: true | ||
}, | ||
txHash: { | ||
@@ -538,3 +610,3 @@ description: 'Hash of the transaction on the blockchain', | ||
type: 'object', | ||
required: ['email', 'pspType', 'pspIdentifier', 'pspInfos', 'relayedTxnId'], | ||
required: ['email', 'pspInfos', 'relayedTxnId'], | ||
properties: { | ||
@@ -548,13 +620,2 @@ email: { | ||
}, | ||
pspType: { | ||
type: 'string', | ||
enum: ['Lydia', 'Stripe'], | ||
readOnly: true | ||
}, | ||
pspIdentifier: { | ||
description: 'Identifier specific to the PSP', | ||
type: 'string', | ||
readOnly: true, | ||
example: '12097878' | ||
}, | ||
pspInfos: { | ||
@@ -607,2 +668,8 @@ description: 'Any data specific to the checkout session for this PSP', | ||
example: false | ||
}, | ||
customerIp: { | ||
description: 'IP address of the customer', | ||
type: 'string', | ||
readOnly: true, | ||
example: '8.8.8.8' | ||
} | ||
@@ -862,11 +929,7 @@ } | ||
export const $ProjectFees = { | ||
export const $ProjectStripeFees = { | ||
additionalProperties: false, | ||
type: 'object', | ||
required: ['projectId', 'feePercentage', 'minimumFee', 'includeStripeFee', 'createdAt', 'updatedAt'], | ||
required: ['feePercentage', 'minimumFee', 'includeStripeFee'], | ||
properties: { | ||
projectId: { | ||
type: 'string', | ||
description: 'Project ID' | ||
}, | ||
feePercentage: { | ||
@@ -886,3 +949,34 @@ type: 'integer', | ||
example: false | ||
} | ||
} | ||
} as const; | ||
export const $ProjectCryptoFees = { | ||
additionalProperties: false, | ||
type: 'object', | ||
required: ['feePercentage'], | ||
properties: { | ||
feePercentage: { | ||
type: 'integer', | ||
description: 'Project fee in base point. 1050 means 10.50%', | ||
example: 1050 | ||
} | ||
} | ||
} as const; | ||
export const $ProjectFees = { | ||
additionalProperties: false, | ||
type: 'object', | ||
required: ['projectId', 'createdAt', 'updatedAt'], | ||
properties: { | ||
projectId: { | ||
type: 'string', | ||
description: 'Project ID' | ||
}, | ||
stripe: { | ||
'$ref': '#/components/schemas/ProjectStripeFees' | ||
}, | ||
crypto: { | ||
'$ref': '#/components/schemas/ProjectCryptoFees' | ||
}, | ||
createdAt: { | ||
@@ -906,18 +1000,9 @@ type: 'string', | ||
type: 'object', | ||
required: ['feePercentage', 'minimumFee', 'includeStripeFee'], | ||
required: ['stripe', 'crypto'], | ||
properties: { | ||
feePercentage: { | ||
type: 'integer', | ||
description: 'Project fee in base point. 1050 means 10.50%', | ||
example: 1050 | ||
stripe: { | ||
'$ref': '#/components/schemas/ProjectStripeFees' | ||
}, | ||
minimumFee: { | ||
type: 'integer', | ||
description: 'Minimum fee in cents. 125 means $1.25', | ||
example: 125 | ||
}, | ||
includeStripeFee: { | ||
type: 'boolean', | ||
description: 'Include Stripe fee in the project fee', | ||
example: false | ||
crypto: { | ||
'$ref': '#/components/schemas/ProjectCryptoFees' | ||
} | ||
@@ -924,0 +1009,0 @@ } |
@@ -5,3 +5,3 @@ // This file is auto-generated by @hey-api/openapi-ts | ||
import type { BaseHttpRequest } from './core/BaseHttpRequest'; | ||
import type { GetProjectSettingsResponse, SetProjectSettingsData, SetProjectSettingsResponse, UpdateProjectSettingsData, UpdateProjectSettingsResponse, GetPublicProjectSettingsResponse, GetProductsResponse, CreateProductData, CreateProductResponse, GetProductByIdData, GetProductByIdResponse, UpdateProductData, UpdateProductResponse, DeleteProductData, DeleteProductResponse, CreateCheckoutSessionData, CreateCheckoutSessionResponse, GetTransactionsData, GetTransactionsResponse, GetTransactionByIdData, GetTransactionByIdResponse, RetryTransactionByIdData, RetryTransactionByIdResponse, GetPublicTransactionByIdData, GetPublicTransactionByIdResponse, LydiaHandleEventData, LydiaHandleEventResponse, StripeCreateConnectAccountData, StripeCreateConnectAccountResponse, StripeLinkConnectAccountData, StripeLinkConnectAccountResponse, StripeHandleEventData, StripeHandleEventResponse, WhitelistClientContractData, WhitelistClientContractResponse, GetWhitelistedContractsOfProjectData, GetWhitelistedContractsOfProjectResponse, DeleteFromWhitelistOfProjectData, DeleteFromWhitelistOfProjectResponse, UpdateWhitelistContractData, UpdateWhitelistContractResponse, GetProjectFeePercentagesResponse, UpdateProjectFeePercentageData, UpdateProjectFeePercentageResponse, AddContractToReviewData, AddContractToReviewResponse, GetWhitelistedContractsResponse } from './types.gen'; | ||
import type { GetProjectSettingsResponse, SetProjectSettingsData, SetProjectSettingsResponse, UpdateProjectSettingsData, UpdateProjectSettingsResponse, GetPublicProjectSettingsResponse, GetProductsResponse, CreateProductData, CreateProductResponse, GetProductByIdData, GetProductByIdResponse, UpdateProductData, UpdateProductResponse, DeleteProductData, DeleteProductResponse, CreateCheckoutSessionData, CreateCheckoutSessionResponse, GetCrypto2CryptoTransactionToSignData, GetCrypto2CryptoTransactionToSignResponse, GetTransactionsData, GetTransactionsResponse, GetTransactionByIdData, GetTransactionByIdResponse, RetryTransactionByIdData, RetryTransactionByIdResponse, GetPublicTransactionByIdData, GetPublicTransactionByIdResponse, LydiaHandleEventData, LydiaHandleEventResponse, StripeCreateConnectAccountData, StripeCreateConnectAccountResponse, StripeLinkConnectAccountData, StripeLinkConnectAccountResponse, StripeHandleEventData, StripeHandleEventResponse, WhitelistClientContractData, WhitelistClientContractResponse, GetWhitelistedContractsOfProjectData, GetWhitelistedContractsOfProjectResponse, DeleteFromWhitelistOfProjectData, DeleteFromWhitelistOfProjectResponse, UpdateWhitelistContractData, UpdateWhitelistContractResponse, GetProjectFeePercentagesResponse, UpdateProjectFeePercentageData, UpdateProjectFeePercentageResponse, AddContractToReviewData, AddContractToReviewResponse, GetWhitelistedContractsResponse } from './types.gen'; | ||
@@ -254,3 +254,4 @@ export class SettingsService { | ||
422: 'Unprocessable entity.', | ||
500: 'Internal server error' | ||
500: 'Internal server error', | ||
503: 'Service unavailable error' | ||
} | ||
@@ -260,2 +261,27 @@ }); | ||
/** | ||
* Get transaction the user has to sign | ||
* Only for crypto purchases. | ||
* @param data The data for the request. | ||
* @param data.requestBody | ||
* @returns CryptoPurchaseTransactionToSign URL where to redirect user to begin the purchase funnel | ||
* @throws ApiError | ||
*/ | ||
public getCrypto2CryptoTransactionToSign(data: GetCrypto2CryptoTransactionToSignData): CancelablePromise<GetCrypto2CryptoTransactionToSignResponse> { | ||
return this.httpRequest.request({ | ||
method: 'POST', | ||
url: '/checkout-sessions/crypto', | ||
body: data.requestBody, | ||
mediaType: 'application/json', | ||
errors: { | ||
400: 'Invalid input, object invalid.', | ||
403: 'Resource is access restricted.', | ||
404: 'Ressource not found.', | ||
422: 'Unprocessable entity.', | ||
500: 'Internal server error', | ||
503: 'Service unavailable error' | ||
} | ||
}); | ||
} | ||
} | ||
@@ -262,0 +288,0 @@ |
157
types.gen.ts
@@ -216,2 +216,6 @@ // This file is auto-generated by @hey-api/openapi-ts | ||
recipientParamName: string | null; | ||
/** | ||
* URL of the endpoint which should be notified for webhook events | ||
*/ | ||
webhookEndpoint?: string | null; | ||
}; | ||
@@ -235,2 +239,6 @@ | ||
/** | ||
* Instead of using a fiat PSP, use crypto for payments | ||
*/ | ||
crypto?: boolean; | ||
/** | ||
* Wallet which would receive the purchased NFT | ||
@@ -270,2 +278,18 @@ */ | ||
/** | ||
* `Permit2` data with signature | ||
*/ | ||
export type Permit2Request = { | ||
transactionId: string; | ||
nonce: string; | ||
deadline: string; | ||
signature: string; | ||
}; | ||
export type CryptoPurchaseTransactionToSign = { | ||
to?: string; | ||
data?: string; | ||
value?: string; | ||
}; | ||
/** | ||
* The number of items to return per request. If limit is 0, then no limit is applied. | ||
@@ -283,2 +307,7 @@ */ | ||
readonly productId: number; | ||
readonly pspType: 'Lydia' | 'Stripe' | 'Crypto'; | ||
/** | ||
* Identifier specific to the PSP | ||
*/ | ||
readonly pspIdentifier: string; | ||
readonly price: Price; | ||
@@ -312,2 +341,8 @@ /** | ||
/** | ||
* Any public data specific to the checkout session for this PSP | ||
*/ | ||
readonly pspPublicInfos: { | ||
[key: string]: unknown; | ||
}; | ||
/** | ||
* Hash of the transaction on the blockchain | ||
@@ -326,2 +361,10 @@ */ | ||
export type pspType = 'Lydia' | 'Stripe' | 'Crypto'; | ||
export const pspType = { | ||
LYDIA: 'Lydia', | ||
STRIPE: 'Stripe', | ||
CRYPTO: 'Crypto' | ||
} as const; | ||
/** | ||
@@ -360,8 +403,3 @@ * Status of the transaction | ||
readonly email: string | null; | ||
readonly pspType: 'Lydia' | 'Stripe'; | ||
/** | ||
* Identifier specific to the PSP | ||
*/ | ||
readonly pspIdentifier: string; | ||
/** | ||
* Any data specific to the checkout session for this PSP | ||
@@ -400,11 +438,8 @@ */ | ||
includeStripeFee?: boolean; | ||
/** | ||
* IP address of the customer | ||
*/ | ||
readonly customerIp?: string; | ||
}; | ||
export type pspType = 'Lydia' | 'Stripe'; | ||
export const pspType = { | ||
LYDIA: 'Lydia', | ||
STRIPE: 'Stripe' | ||
} as const; | ||
export type PaginatedTransactions = { | ||
@@ -538,8 +573,4 @@ /** | ||
export type ProjectFees = { | ||
export type ProjectStripeFees = { | ||
/** | ||
* Project ID | ||
*/ | ||
projectId: string; | ||
/** | ||
* Project fee in base point. 1050 means 10.50% | ||
@@ -556,3 +587,19 @@ */ | ||
includeStripeFee: boolean; | ||
}; | ||
export type ProjectCryptoFees = { | ||
/** | ||
* Project fee in base point. 1050 means 10.50% | ||
*/ | ||
feePercentage: number; | ||
}; | ||
export type ProjectFees = { | ||
/** | ||
* Project ID | ||
*/ | ||
projectId: string; | ||
stripe?: ProjectStripeFees; | ||
crypto?: ProjectCryptoFees; | ||
/** | ||
* Creation date | ||
@@ -568,14 +615,4 @@ */ | ||
export type ProjectFeeUpdateRequest = { | ||
/** | ||
* Project fee in base point. 1050 means 10.50% | ||
*/ | ||
feePercentage: number; | ||
/** | ||
* Minimum fee in cents. 125 means $1.25 | ||
*/ | ||
minimumFee: number; | ||
/** | ||
* Include Stripe fee in the project fee | ||
*/ | ||
includeStripeFee: boolean; | ||
stripe: ProjectStripeFees; | ||
crypto: ProjectCryptoFees; | ||
}; | ||
@@ -644,2 +681,8 @@ | ||
export type GetCrypto2CryptoTransactionToSignData = { | ||
requestBody: Permit2Request; | ||
}; | ||
export type GetCrypto2CryptoTransactionToSignResponse = CryptoPurchaseTransactionToSign; | ||
export type GetTransactionsData = { | ||
@@ -1180,5 +1223,61 @@ limit?: PageLimit; | ||
}; | ||
/** | ||
* Service unavailable error | ||
*/ | ||
503: { | ||
message?: string; | ||
errors?: unknown[]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
'/checkout-sessions/crypto': { | ||
post: { | ||
req: GetCrypto2CryptoTransactionToSignData; | ||
res: { | ||
/** | ||
* URL where to redirect user to begin the purchase funnel | ||
*/ | ||
200: CryptoPurchaseTransactionToSign; | ||
/** | ||
* Invalid input, object invalid. | ||
*/ | ||
400: { | ||
message?: string; | ||
}; | ||
/** | ||
* Resource is access restricted. | ||
*/ | ||
403: { | ||
message?: string; | ||
}; | ||
/** | ||
* Ressource not found. | ||
*/ | ||
404: { | ||
message?: string; | ||
}; | ||
/** | ||
* Unprocessable entity. | ||
*/ | ||
422: { | ||
message?: string; | ||
}; | ||
/** | ||
* Internal server error | ||
*/ | ||
500: { | ||
message?: string; | ||
errors?: unknown[]; | ||
}; | ||
/** | ||
* Service unavailable error | ||
*/ | ||
503: { | ||
message?: string; | ||
errors?: unknown[]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
'/transactions': { | ||
@@ -1185,0 +1284,0 @@ get: { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
291771
9116