@oystehr/sdk
Version:
Oystehr SDK
95 lines (92 loc) • 3.6 kB
text/typescript
// AUTOGENERATED -- DO NOT EDIT
import {
OystehrClientRequest,
PaymentMethodDeleteParams,
PaymentMethodListParams,
PaymentMethodListResponse,
PaymentMethodSetDefaultParams,
PaymentMethodSetUpParams,
PaymentMethodSetUpResponse,
} from '../..';
import { SDKResource } from '../../client/client';
import { OystehrConfig } from '../../config';
export class PaymentMethod extends SDKResource {
constructor(config: OystehrConfig) {
super(config);
}
#baseUrlThunk(): string {
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
}
/**
* Enter a new credit card or other payment method for the user.
*
* Access Policy Requirements:
* Action: `Payment:Setup`
* Access Policy Resource: `Payment:PaymentMethod`
* Actions: `FHIR:Read,FHIR:Create,FHIR:Update`
* Access Policy Resource: `FHIR:Coverage:*`
* Action: `FHIR:Read,FHIR:Create,FHIR:Update`
* Access Policy Resource: `FHIR:Account:*`
*
* Also need to be able to read the patients' details. For example:
* Action: `FHIR:Read`
* Access Policy Resource: `FHIR:Patient`
*/
setUp(params: PaymentMethodSetUpParams, request?: OystehrClientRequest): Promise<PaymentMethodSetUpResponse> {
return this.request('/payment/payment-method/setup', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Set a specified payment method for the user as default.
*
* Access Policy Requirements:
* Action: `Payment:SetDefault`
* Access Policy Resource: `Payment:PaymentMethod`
* Actions: `FHIR:Read,FHIR:Create,FHIR:Update`
* Access Policy Resource: `FHIR:Coverage:*`
* Action: `FHIR:Read,FHIR:Create,FHIR:Update`
* Access Policy Resource: `FHIR:Account:*`
*
* Also need to be able to read the patients' details. For example:
* Action: `FHIR:Read`
* Access Policy Resource: `FHIR:Patient`
*/
setDefault(params: PaymentMethodSetDefaultParams, request?: OystehrClientRequest): Promise<void> {
return this.request('/payment/payment-method/set-default', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Delete a specified payment method for the beneficiary.
*
* Access Policy Requirements:
* Action: `Payment:Delete`
* Access Policy Resource: `Payment:PaymentMethod`
* Actions: `FHIR:Read,FHIR:Create,FHIR:Update`
* Access Policy Resource: `FHIR:Coverage:*`
* Action: `FHIR:Read,FHIR:Create,FHIR:Update`
* Access Policy Resource: `FHIR:Account:*`
*
* Also need to be able to read the patients' details. For example:
* Action: `FHIR:Read`
* Access Policy Resource: `FHIR:Patient`
*/
delete(params: PaymentMethodDeleteParams, request?: OystehrClientRequest): Promise<void> {
return this.request('/payment/payment-method', 'delete', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* List all payment methods for the patient.
*
* Access Policy Requirements:
* Action: `Payment:Setup`
* Access Policy Resource: `Payment:PaymentMethod`
* Actions: `FHIR:Read,FHIR:Create,FHIR:Update`
* Access Policy Resource: `FHIR:Coverage:*`
* Action: `FHIR:Read,FHIR:Create,FHIR:Update`
* Access Policy Resource: `FHIR:Account:*`
*
* Also need to be able to read the patients' details. For example:
* Action: `FHIR:Read`
* Access Policy Resource: `FHIR:Patient`
*/
list(params: PaymentMethodListParams, request?: OystehrClientRequest): Promise<PaymentMethodListResponse> {
return this.request('/payment/payment-method/list', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
}