@oystehr/sdk
Version:
Oystehr SDK
87 lines (84 loc) • 3.23 kB
JavaScript
import { SDKResource } from '../../client/client.js';
// AUTOGENERATED -- DO NOT EDIT
class PaymentMethod extends SDKResource {
constructor(config) {
super(config);
}
#baseUrlThunk() {
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, request) {
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, request) {
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, request) {
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, request) {
return this.request('/payment/payment-method/list', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
}
export { PaymentMethod };
//# sourceMappingURL=paymentMethod.js.map