Skip to main content

PaymentService

Payment service can be used in the following way:
1. Import the service from our library:

import {PaymentService} from "@selfcommunity/api-services";
2. Create a function and put the service inside it!
The async function `getPaymentProducts` will return the events matching the search query.

async getPaymentProducts() {
return await PaymentService.getPaymentProducts({...});
}
In case of required `params`, just add them inside the brackets.

async getPaymentPrices(eventId) {
return await PaymentService.getProductPrices(id);
}
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).

1. Declare it(or declare them, it is possible to add multiple params)

const headers = headers: {Authorization: `Bearer ${yourToken}`}

2. Add it inside the brackets and pass it to the function, as shown in the previous example!

Constructors

Constructor

new PaymentService(): PaymentService

Returns

PaymentService

Methods

checkoutCompleteSession()

static checkoutCompleteSession(data, config?): Promise<SCCheckoutSessionComplete>

Parameters

ParameterType
dataCheckoutSessionParams | FormData
config?AxiosRequestConfig

Returns

Promise<SCCheckoutSessionComplete>


checkoutCreateSession()

static checkoutCreateSession(data, config?): Promise<SCCheckoutSession>

Parameters

ParameterType
dataCheckoutCreateSessionParams | FormData
config?AxiosRequestConfig

Returns

Promise<SCCheckoutSession>


createPaymentProduct()

static createPaymentProduct(data, config?): Promise<SCPaymentProduct>

Parameters

ParameterType
dataCreatePaymentProductParams | FormData
config?AxiosRequestConfig

Returns

Promise<SCPaymentProduct>


getCheckoutSession()

static getCheckoutSession(params?, config?): Promise<SCCheckoutSessionDetail>

Parameters

ParameterType
params?CheckoutSessionParams
config?AxiosRequestConfig

Returns

Promise<SCCheckoutSessionDetail>


getPaymentContentStatus()

static getPaymentContentStatus(params?, config?): Promise<PaymentContentStatus>

Parameters

ParameterType
params?PaymentContentStatusParams
config?AxiosRequestConfig

Returns

Promise<PaymentContentStatus>


getPaymentOrder()

static getPaymentOrder(id, config?): Promise<SCPaymentOrder>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCPaymentOrder>


getPaymentOrderPdf()

static getPaymentOrderPdf(id, config?): Promise<Blob>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig

Returns

Promise<Blob>


getPaymentProduct()

static getPaymentProduct(id, config?): Promise<SCPaymentProduct>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig

Returns

Promise<SCPaymentProduct>


getPaymentProductPrices()

static getPaymentProductPrices(id, params?, config?): Promise<SCPaginatedResponse<SCPaymentPrice>>

Parameters

ParameterType
idstring | number
params?PaymentProductsParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCPaymentPrice>>


getPaymentProducts()

static getPaymentProducts(params?, config?): Promise<SCPaginatedResponse<SCPaymentProduct>>

Parameters

ParameterType
params?PaymentProductsParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCPaymentProduct>>


getPaymentsCustomerPortal()

static getPaymentsCustomerPortal(data, config?): Promise<SCPaymentsCustomerPortalSession>

Parameters

ParameterType
dataCustomerPortalCreateSessionParams | FormData
config?AxiosRequestConfig

Returns

Promise<SCPaymentsCustomerPortalSession>


getPaymentsOrder()

static getPaymentsOrder(params?, config?): Promise<SCPaginatedResponse<SCPaymentOrder>>

Parameters

ParameterType
params?PaymentOrderParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCPaymentOrder>>


getPaywalls()

static getPaywalls(params?, config?): Promise<SCPaginatedResponse<SCPaywall>>

Parameters

ParameterType
params?PaymentProductsParams
config?AxiosRequestConfig

Returns

Promise<SCPaginatedResponse<SCPaywall>>