PaymentService
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()
staticcheckoutCompleteSession(data,config?):Promise<SCCheckoutSessionComplete>
Parameters
| Parameter | Type | 
|---|---|
| data | CheckoutSessionParams|FormData | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCCheckoutSessionComplete>
checkoutCreateSession()
staticcheckoutCreateSession(data,config?):Promise<SCCheckoutSession>
Parameters
| Parameter | Type | 
|---|---|
| data | CheckoutCreateSessionParams|FormData | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCCheckoutSession>
createPaymentProduct()
staticcreatePaymentProduct(data,config?):Promise<SCPaymentProduct>
Parameters
| Parameter | Type | 
|---|---|
| data | CreatePaymentProductParams|FormData | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaymentProduct>
getCheckoutSession()
staticgetCheckoutSession(params?,config?):Promise<SCCheckoutSessionDetail>
Parameters
| Parameter | Type | 
|---|---|
| params? | CheckoutSessionParams | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCCheckoutSessionDetail>
getPaymentContentStatus()
staticgetPaymentContentStatus(params?,config?):Promise<PaymentContentStatus>
Parameters
| Parameter | Type | 
|---|---|
| params? | PaymentContentStatusParams | 
| config? | AxiosRequestConfig | 
Returns
Promise<PaymentContentStatus>
getPaymentOrder()
staticgetPaymentOrder(id,config?):Promise<SCPaymentOrder>
Parameters
| Parameter | Type | 
|---|---|
| id | string|number | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaymentOrder>
getPaymentOrderPdf()
staticgetPaymentOrderPdf(id,config?):Promise<Blob>
Parameters
| Parameter | Type | 
|---|---|
| id | string|number | 
| config? | AxiosRequestConfig | 
Returns
Promise<Blob>
getPaymentProduct()
staticgetPaymentProduct(id,config?):Promise<SCPaymentProduct>
Parameters
| Parameter | Type | 
|---|---|
| id | string|number | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaymentProduct>
getPaymentProductPrices()
staticgetPaymentProductPrices(id,params?,config?):Promise<SCPaginatedResponse<SCPaymentPrice>>
Parameters
| Parameter | Type | 
|---|---|
| id | string|number | 
| params? | PaymentProductsParams | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaginatedResponse<SCPaymentPrice>>
getPaymentProducts()
staticgetPaymentProducts(params?,config?):Promise<SCPaginatedResponse<SCPaymentProduct>>
Parameters
| Parameter | Type | 
|---|---|
| params? | PaymentProductsParams | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaginatedResponse<SCPaymentProduct>>
getPaymentsCustomerPortal()
staticgetPaymentsCustomerPortal(data,config?):Promise<SCPaymentsCustomerPortalSession>
Parameters
| Parameter | Type | 
|---|---|
| data | CustomerPortalCreateSessionParams|FormData | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaymentsCustomerPortalSession>
getPaymentsOrder()
staticgetPaymentsOrder(params?,config?):Promise<SCPaginatedResponse<SCPaymentOrder>>
Parameters
| Parameter | Type | 
|---|---|
| params? | PaymentOrderParams | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaginatedResponse<SCPaymentOrder>>
getPaywalls()
staticgetPaywalls(params?,config?):Promise<SCPaginatedResponse<SCPaywall>>
Parameters
| Parameter | Type | 
|---|---|
| params? | PaymentProductsParams | 
| config? | AxiosRequestConfig | 
Returns
Promise<SCPaginatedResponse<SCPaywall>>