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()
static
checkoutCompleteSession(data
,config?
):Promise
<SCCheckoutSessionComplete
>
Parameters
Parameter | Type |
---|---|
data | CheckoutSessionParams | FormData |
config? | AxiosRequestConfig |
Returns
Promise
<SCCheckoutSessionComplete
>
checkoutCreateSession()
static
checkoutCreateSession(data
,config?
):Promise
<SCCheckoutSession
>
Parameters
Parameter | Type |
---|---|
data | CheckoutCreateSessionParams | FormData |
config? | AxiosRequestConfig |
Returns
Promise
<SCCheckoutSession
>
createPaymentProduct()
static
createPaymentProduct(data
,config?
):Promise
<SCPaymentProduct
>
Parameters
Parameter | Type |
---|---|
data | CreatePaymentProductParams | FormData |
config? | AxiosRequestConfig |
Returns
Promise
<SCPaymentProduct
>
getCheckoutSession()
static
getCheckoutSession(params?
,config?
):Promise
<SCCheckoutSessionDetail
>
Parameters
Parameter | Type |
---|---|
params? | CheckoutSessionParams |
config? | AxiosRequestConfig |
Returns
Promise
<SCCheckoutSessionDetail
>
getPaymentContentStatus()
static
getPaymentContentStatus(params?
,config?
):Promise
<PaymentContentStatus
>
Parameters
Parameter | Type |
---|---|
params? | PaymentContentStatusParams |
config? | AxiosRequestConfig |
Returns
Promise
<PaymentContentStatus
>
getPaymentOrder()
static
getPaymentOrder(id
,config?
):Promise
<SCPaymentOrder
>
Parameters
Parameter | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig |
Returns
Promise
<SCPaymentOrder
>
getPaymentOrderPdf()
static
getPaymentOrderPdf(id
,config?
):Promise
<Blob
>
Parameters
Parameter | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig |
Returns
Promise
<Blob
>
getPaymentProduct()
static
getPaymentProduct(id
,config?
):Promise
<SCPaymentProduct
>
Parameters
Parameter | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig |
Returns
Promise
<SCPaymentProduct
>
getPaymentProductPrices()
static
getPaymentProductPrices(id
,params?
,config?
):Promise
<SCPaginatedResponse
<SCPaymentPrice
>>
Parameters
Parameter | Type |
---|---|
id | string | number |
params? | PaymentProductsParams |
config? | AxiosRequestConfig |
Returns
Promise
<SCPaginatedResponse
<SCPaymentPrice
>>
getPaymentProducts()
static
getPaymentProducts(params?
,config?
):Promise
<SCPaginatedResponse
<SCPaymentProduct
>>
Parameters
Parameter | Type |
---|---|
params? | PaymentProductsParams |
config? | AxiosRequestConfig |
Returns
Promise
<SCPaginatedResponse
<SCPaymentProduct
>>
getPaymentsCustomerPortal()
static
getPaymentsCustomerPortal(data
,config?
):Promise
<SCPaymentsCustomerPortalSession
>
Parameters
Parameter | Type |
---|---|
data | CustomerPortalCreateSessionParams | FormData |
config? | AxiosRequestConfig |
Returns
Promise
<SCPaymentsCustomerPortalSession
>
getPaymentsOrder()
static
getPaymentsOrder(params?
,config?
):Promise
<SCPaginatedResponse
<SCPaymentOrder
>>
Parameters
Parameter | Type |
---|---|
params? | PaymentOrderParams |
config? | AxiosRequestConfig |
Returns
Promise
<SCPaginatedResponse
<SCPaymentOrder
>>
getPaywalls()
static
getPaywalls(params?
,config?
):Promise
<SCPaginatedResponse
<SCPaywall
>>
Parameters
Parameter | Type |
---|---|
params? | PaymentProductsParams |
config? | AxiosRequestConfig |
Returns
Promise
<SCPaginatedResponse
<SCPaywall
>>