UNPKG

tickethead-sdk

Version:

SDK for the Tickethead API

89 lines 4.15 kB
import { AxiosInstance } from 'axios'; import { HealthStatus, StringIdParam } from '../common/types'; import { IPayout, IPayoutData, StripeConfig, CryptoPayment, PaymentAmount, CryptoPaymentMeta, CreatePaymentQuery, PaymentIntentResponse, OpenPaymentResponse, OpenPaymentMeta, OpenPaymentOrderQuery, OpenPaymentOrderData, OpenPaymentStatus, BraintreeToken, BraintreeOrderData, BraintreePayment, ConfirmOrderBody } from './types'; /** * Service class for payment API calls. Requires an organizer to be set (call to `useOrganizer`) */ export declare class PaymentService { readonly client: AxiosInstance; readonly version: string; constructor(client: AxiosInstance, version: string); /** * Returns true if the service is reachable * Currently the * * @returns Services' online status */ health(): Promise<HealthStatus>; getPublishableKey(): Promise<StripeConfig>; /** * Creates a Stripe Payment Intent for the specified order. * Fails if the order is not in a payable state, or if the booking of seats fails. * Confirms immediately if the order only contains free items. * * @param orderData contains the order id and the desired payment type * @throws `BadRequestError` */ createStripePaymentForOrder(orderData: CreatePaymentQuery): Promise<PaymentIntentResponse>; /** * Creates a payment intent with a custom amount. * Throws for zero and below as amounts. * * @param data contains the order id and the desired payment type * @throws `BadRequestError` */ createStripePayment(data: PaymentAmount<CreatePaymentQuery>): Promise<PaymentIntentResponse>; /** * Creates a crypto payment for the specified order. * Fails if the order is not in a payable state, or if the booking of seats fails. * Confirms immediately if the order only contains free items. * * @param orderData contains the order id and the desired redirection URLs * @throws `BadRequestError` */ createCryptoPaymentForOrder(orderData: CreatePaymentQuery, meta?: CryptoPaymentMeta): Promise<CryptoPayment>; /** * Creates a crypto payment with a custom amount. * Throws for zero and below as amounts. * * @param data contains the amounts and currencies, with metadata * @throws `BadRequestError` */ createCryptoPayment(data: PaymentAmount<CryptoPaymentMeta>): Promise<CryptoPayment>; /** * Creates a payment for an order. * Uses OpenPayment/Hobex for the payment. * * @param data contains the amount and additional optional metadata, if you want to prefill the payment form * @returns the payment id and timestamp, which can be used for instantiating the payment form */ createOpenPaymentForOrder(order: OpenPaymentOrderQuery, data: OpenPaymentOrderData): Promise<OpenPaymentResponse>; /** * Creates a payment intent with a custom amount. * Uses OpenPayment/Hobex for the payment. * Throws for zero and below as amounts. * * @param data contains the amount and additional optional metadata, if you want to prefill the payment form * @returns the payment id and timestamp, which can be used for instantiating the payment form */ createOpenPayment(data: PaymentAmount<OpenPaymentMeta>): Promise<OpenPaymentResponse>; /** Checks the current status of the payment */ checkOpenPaymentStatus(id: StringIdParam): Promise<OpenPaymentStatus>; /** Returns the Braintree token */ getBraintreeToken(): Promise<BraintreeToken>; createBraintreePaymentForOrder(data: BraintreeOrderData): Promise<BraintreePayment>; /** * Create a PayPal payout. Only available to the orderbook service ATM. * * @param data contains the data for the emails and amounts to pay out * @throws `BadRequestError` */ createPayout(data: IPayoutData): Promise<IPayout>; /** * Manually confirms order * * @param data.id ID of the order to manually confirm */ confirmOrderManually(data: ConfirmOrderBody): Promise<void>; } //# sourceMappingURL=service.d.ts.map