@medipass/web-sdk 11.38.0 → 11.38.1-feature-typescript-claudia.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +95 -0
- package/babel.config.js +2 -1
- package/lib/index.d.ts +262 -0
- package/lib/index.js +83 -3
- package/lib/{regions-ed54f163.js → regions-a0a28864.js} +2 -2
- package/lib/resources/accounts.d.ts +215 -0
- package/lib/resources/accounts.js +3 -3
- package/lib/resources/actions.d.ts +13 -0
- package/lib/resources/actions.js +3 -3
- package/lib/resources/api-keys.d.ts +24 -0
- package/lib/resources/api-keys.js +3 -3
- package/lib/resources/applications.d.ts +31 -0
- package/lib/resources/applications.js +3 -3
- package/lib/resources/attachments.d.ts +32 -0
- package/lib/resources/attachments.js +3 -3
- package/lib/resources/auth.d.ts +59 -0
- package/lib/resources/auth.js +3 -3
- package/lib/resources/bulk-submits.d.ts +17 -0
- package/lib/resources/bulk-submits.js +3 -3
- package/lib/resources/bulk-uploads.d.ts +26 -0
- package/lib/resources/bulk-uploads.js +3 -3
- package/lib/resources/business-profiles.d.ts +18 -0
- package/lib/resources/business-profiles.js +3 -3
- package/lib/resources/businesses.d.ts +132 -0
- package/lib/resources/businesses.js +3 -3
- package/lib/resources/claim-items.d.ts +31 -0
- package/lib/resources/claim-items.js +3 -3
- package/lib/resources/devices.d.ts +11 -0
- package/lib/resources/devices.js +3 -3
- package/lib/resources/doc-accounts.d.ts +32 -0
- package/lib/resources/doc-accounts.js +3 -3
- package/lib/resources/documents.d.ts +90 -0
- package/lib/resources/documents.js +3 -3
- package/lib/resources/emails.d.ts +14 -0
- package/lib/resources/emails.js +3 -3
- package/lib/resources/form-application-templates.d.ts +20 -0
- package/lib/resources/form-application-templates.js +3 -3
- package/lib/resources/form-applications.d.ts +27 -0
- package/lib/resources/form-applications.js +3 -3
- package/lib/resources/forms.d.ts +100 -0
- package/lib/resources/forms.js +3 -3
- package/lib/resources/funder-services.d.ts +8 -0
- package/lib/resources/funder-services.js +3 -3
- package/lib/resources/funder-settings.d.ts +8 -0
- package/lib/resources/funder-settings.js +3 -3
- package/lib/resources/funders.d.ts +5 -0
- package/lib/resources/funders.js +3 -3
- package/lib/resources/futures.d.ts +85 -0
- package/lib/resources/futures.js +3 -3
- package/lib/resources/health-fund-accounts.d.ts +78 -0
- package/lib/resources/health-fund-accounts.js +3 -3
- package/lib/resources/health-fund-settings.d.ts +39 -0
- package/lib/resources/health-fund-settings.js +3 -3
- package/lib/resources/healthfunds.d.ts +64 -0
- package/lib/resources/healthfunds.js +3 -3
- package/lib/resources/icditems.d.ts +14 -0
- package/lib/resources/icditems.js +3 -3
- package/lib/resources/invoice-scans.d.ts +26 -0
- package/lib/resources/invoice-scans.js +3 -3
- package/lib/resources/jhcs.d.ts +7 -0
- package/lib/resources/jhcs.js +3 -3
- package/lib/resources/kyc.d.ts +109 -0
- package/lib/resources/kyc.js +3 -3
- package/lib/resources/logs.d.ts +16 -0
- package/lib/resources/logs.js +3 -3
- package/lib/resources/members.d.ts +92 -0
- package/lib/resources/members.js +3 -3
- package/lib/resources/message-mappings.d.ts +9 -0
- package/lib/resources/message-mappings.js +3 -3
- package/lib/resources/minions.d.ts +40 -0
- package/lib/resources/minions.js +3 -3
- package/lib/resources/modalities.d.ts +19 -0
- package/lib/resources/modalities.js +3 -3
- package/lib/resources/notes.d.ts +17 -0
- package/lib/resources/notes.js +3 -3
- package/lib/resources/onboarding-applications.d.ts +52 -0
- package/lib/resources/onboarding-applications.js +3 -3
- package/lib/resources/onboarding-requests.d.ts +39 -0
- package/lib/resources/onboarding-requests.js +3 -3
- package/lib/resources/ops.d.ts +60 -0
- package/lib/resources/ops.js +3 -3
- package/lib/resources/organisations.d.ts +7 -0
- package/lib/resources/organisations.js +3 -3
- package/lib/resources/partners.d.ts +50 -0
- package/lib/resources/partners.js +3 -3
- package/lib/resources/patients.d.ts +44 -0
- package/lib/resources/patients.js +3 -3
- package/lib/resources/payments.d.ts +155 -0
- package/lib/resources/payments.js +3 -3
- package/lib/resources/pms.d.ts +43 -0
- package/lib/resources/pms.js +3 -3
- package/lib/resources/practice-profiles.d.ts +20 -0
- package/lib/resources/practice-profiles.js +3 -3
- package/lib/resources/practice-types.d.ts +6 -0
- package/lib/resources/practice-types.js +3 -3
- package/lib/resources/practices.d.ts +137 -0
- package/lib/resources/practices.js +3 -3
- package/lib/resources/products.d.ts +23 -0
- package/lib/resources/products.js +3 -3
- package/lib/resources/professional-categories.d.ts +23 -0
- package/lib/resources/professional-categories.js +3 -3
- package/lib/resources/provider-number-types.d.ts +16 -0
- package/lib/resources/provider-number-types.js +3 -3
- package/lib/resources/provider-registration-types.d.ts +15 -0
- package/lib/resources/provider-registration-types.js +3 -3
- package/lib/resources/provider-requests.d.ts +17 -0
- package/lib/resources/provider-requests.js +3 -3
- package/lib/resources/provider-types.d.ts +6 -0
- package/lib/resources/provider-types.js +3 -3
- package/lib/resources/ref-sources.d.ts +6 -0
- package/lib/resources/ref-sources.js +3 -3
- package/lib/resources/risk.d.ts +13 -0
- package/lib/resources/risk.js +3 -3
- package/lib/resources/rnas.d.ts +43 -0
- package/lib/resources/rnas.js +3 -3
- package/lib/resources/roles.d.ts +7 -0
- package/lib/resources/roles.js +3 -3
- package/lib/resources/self-checkout-sessions.d.ts +134 -0
- package/lib/resources/self-checkout-sessions.js +3 -3
- package/lib/resources/services.d.ts +88 -0
- package/lib/resources/services.js +3 -3
- package/lib/resources/settlements.d.ts +37 -0
- package/lib/resources/settlements.js +3 -3
- package/lib/resources/sign-up.d.ts +5 -0
- package/lib/resources/sign-up.js +3 -3
- package/lib/resources/specialties.d.ts +23 -0
- package/lib/resources/specialties.js +3 -3
- package/lib/resources/staff-profiles.d.ts +20 -0
- package/lib/resources/staff-profiles.js +3 -3
- package/lib/resources/staff.d.ts +242 -0
- package/lib/resources/staff.js +3 -3
- package/lib/resources/statistics.d.ts +56 -0
- package/lib/resources/statistics.js +3 -3
- package/lib/resources/subscriptions.d.ts +32 -0
- package/lib/resources/subscriptions.js +3 -3
- package/lib/resources/terminals.d.ts +71 -0
- package/lib/resources/terminals.js +3 -3
- package/lib/resources/transaction-export.d.ts +18 -0
- package/lib/resources/transaction-export.js +3 -3
- package/lib/resources/transactions.d.ts +466 -0
- package/lib/resources/transactions.js +3 -3
- package/lib/resources/triggers.d.ts +20 -0
- package/lib/resources/triggers.js +3 -3
- package/lib/resources/vendors.d.ts +9 -0
- package/lib/resources/vendors.js +3 -3
- package/lib/resources/verify.d.ts +9 -0
- package/lib/resources/verify.js +3 -3
- package/lib/resources/workers.d.ts +3 -0
- package/lib/resources/workers.js +3 -3
- package/lib/resources/workflow-exceptions.d.ts +5 -0
- package/lib/resources/workflow-exceptions.js +3 -3
- package/lib/services/aws.d.ts +54 -0
- package/lib/services/aws.js +3 -3
- package/lib/services/storage.d.ts +28 -0
- package/lib/services/storage.js +126 -18
- package/lib/services/version.d.ts +21 -0
- package/lib/services/version.js +3 -3
- package/lib/{staff-f19eb168.js → staff-96febcd8.js} +188 -581
- package/lib/types/documents.d.ts +115 -0
- package/lib/types/documents.js +2 -0
- package/lib/types/forms.d.ts +67 -0
- package/lib/types/forms.js +2 -0
- package/lib/types/index.d.ts +42 -0
- package/lib/types/index.js +2 -0
- package/lib/types/message-mappings.d.ts +18 -0
- package/lib/types/message-mappings.js +2 -0
- package/lib/types/notes.d.ts +5 -0
- package/lib/types/notes.js +2 -0
- package/lib/types/products.d.ts +34 -0
- package/lib/types/products.js +2 -0
- package/lib/types/professional-categories.d.ts +20 -0
- package/lib/types/professional-categories.js +2 -0
- package/lib/types/specialties.d.ts +22 -0
- package/lib/types/specialties.js +2 -0
- package/lib/types/subscriptions.d.ts +52 -0
- package/lib/types/subscriptions.js +2 -0
- package/lib/utils/application.d.ts +1 -0
- package/lib/utils/application.js +3 -3
- package/lib/utils/base-urls/core.d.ts +19 -0
- package/lib/utils/base-urls/index.d.ts +37 -0
- package/lib/utils/base-urls/risk.d.ts +17 -0
- package/lib/utils/does-param-exist.d.ts +2 -0
- package/lib/utils/get-axios-error.d.ts +2 -0
- package/lib/utils/param-error.d.ts +3 -0
- package/lib/utils/professions.d.ts +3 -0
- package/lib/utils/professions.js +3 -3
- package/lib/utils/regions.d.ts +1 -0
- package/lib/utils/regions.js +2 -2
- package/lib/utils/request.d.ts +3 -0
- package/lib/utils/request.js +3 -3
- package/lib/utils/staff.d.ts +8 -0
- package/lib/utils/staff.js +3 -3
- package/package.json +19 -9
- package/tsconfig.json +33 -0
- package/types/globals.d.ts +7 -0
- package/types/index.d.ts +1 -0
- package/.eslintrc +0 -3
- package/lib/_types/documents.js.flow +0 -118
- package/lib/_types/forms.js.flow +0 -57
- package/lib/_types/index.js.flow +0 -47
- package/lib/_types/message-mappings.js.flow +0 -22
- package/lib/_types/notes.js.flow +0 -7
- package/lib/_types/products.js.flow +0 -40
- package/lib/_types/professional-categories.js.flow +0 -25
- package/lib/_types/specialties.js.flow +0 -27
- package/lib/_types/subscriptions.js.flow +0 -58
- package/lib/index.js.flow +0 -438
- package/lib/resources/accounts.js.flow +0 -445
- package/lib/resources/actions.js.flow +0 -25
- package/lib/resources/api-keys.js.flow +0 -54
- package/lib/resources/applications.js.flow +0 -60
- package/lib/resources/attachments.js.flow +0 -75
- package/lib/resources/auth.js.flow +0 -185
- package/lib/resources/bulk-submits.js.flow +0 -43
- package/lib/resources/bulk-uploads.js.flow +0 -56
- package/lib/resources/business-profiles.js.flow +0 -45
- package/lib/resources/businesses.js.flow +0 -267
- package/lib/resources/claim-items.js.flow +0 -76
- package/lib/resources/devices.js.flow +0 -64
- package/lib/resources/doc-accounts.js.flow +0 -61
- package/lib/resources/documents.js.flow +0 -216
- package/lib/resources/emails.js.flow +0 -96
- package/lib/resources/form-application-templates.js.flow +0 -52
- package/lib/resources/form-applications.js.flow +0 -62
- package/lib/resources/forms.js.flow +0 -222
- package/lib/resources/funder-services.js.flow +0 -17
- package/lib/resources/funder-settings.js.flow +0 -58
- package/lib/resources/funders.js.flow +0 -15
- package/lib/resources/futures.js.flow +0 -154
- package/lib/resources/health-fund-accounts.js.flow +0 -198
- package/lib/resources/health-fund-settings.js.flow +0 -104
- package/lib/resources/healthfunds.js.flow +0 -139
- package/lib/resources/icditems.js.flow +0 -36
- package/lib/resources/invoice-scans.js.flow +0 -56
- package/lib/resources/jhcs.js.flow +0 -20
- package/lib/resources/kyc.js.flow +0 -216
- package/lib/resources/logs.js.flow +0 -32
- package/lib/resources/members.js.flow +0 -196
- package/lib/resources/message-mappings.js.flow +0 -25
- package/lib/resources/minions.js.flow +0 -96
- package/lib/resources/modalities.js.flow +0 -46
- package/lib/resources/notes.js.flow +0 -112
- package/lib/resources/onboarding-applications.js.flow +0 -142
- package/lib/resources/onboarding-requests.js.flow +0 -97
- package/lib/resources/ops.js.flow +0 -116
- package/lib/resources/organisations.js.flow +0 -15
- package/lib/resources/partners.js.flow +0 -118
- package/lib/resources/patients.js.flow +0 -102
- package/lib/resources/payments.js.flow +0 -523
- package/lib/resources/pms.js.flow +0 -102
- package/lib/resources/practice-profiles.js.flow +0 -51
- package/lib/resources/practice-types.js.flow +0 -14
- package/lib/resources/practices.js.flow +0 -314
- package/lib/resources/products.js.flow +0 -48
- package/lib/resources/professional-categories.js.flow +0 -56
- package/lib/resources/provider-number-types.js.flow +0 -32
- package/lib/resources/provider-registration-types.js.flow +0 -32
- package/lib/resources/provider-requests.js.flow +0 -46
- package/lib/resources/provider-types.js.flow +0 -14
- package/lib/resources/ref-sources.js.flow +0 -16
- package/lib/resources/risk.js.flow +0 -29
- package/lib/resources/rnas.js.flow +0 -108
- package/lib/resources/roles.js.flow +0 -12
- package/lib/resources/self-checkout-sessions.js.flow +0 -382
- package/lib/resources/services.js.flow +0 -219
- package/lib/resources/settlements.js.flow +0 -97
- package/lib/resources/sign-up.js.flow +0 -15
- package/lib/resources/specialties.js.flow +0 -46
- package/lib/resources/staff-profiles.js.flow +0 -51
- package/lib/resources/staff.js.flow +0 -583
- package/lib/resources/statistics.js.flow +0 -147
- package/lib/resources/subscriptions.js.flow +0 -81
- package/lib/resources/terminals.js.flow +0 -161
- package/lib/resources/transaction-export.js.flow +0 -48
- package/lib/resources/transactions.js.flow +0 -1097
- package/lib/resources/triggers.js.flow +0 -36
- package/lib/resources/vendors.js.flow +0 -28
- package/lib/resources/verify.js.flow +0 -14
- package/lib/resources/workers.js.flow +0 -10
- package/lib/resources/workflow-exceptions.js.flow +0 -17
- package/lib/services/__mocks__/storage.js.flow +0 -30
- package/lib/services/aws.js.flow +0 -339
- package/lib/services/storage.js.flow +0 -92
- package/lib/services/version.js.flow +0 -73
- package/lib/storage-16fd26f8.js +0 -1268
- package/lib/utils/application.js.flow +0 -23
- package/lib/utils/base-urls/core.js.flow +0 -18
- package/lib/utils/base-urls/index.js.flow +0 -7
- package/lib/utils/base-urls/risk.js.flow +0 -16
- package/lib/utils/does-param-exist.js.flow +0 -23
- package/lib/utils/get-axios-error.js.flow +0 -8
- package/lib/utils/param-error.js.flow +0 -8
- package/lib/utils/professions.js.flow +0 -66
- package/lib/utils/regions.js.flow +0 -21
- package/lib/utils/request.js.flow +0 -36
- package/lib/utils/staff.js.flow +0 -81
|
@@ -1,1097 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import request from '../utils/request';
|
|
4
|
-
import doesParamExist from '../utils/does-param-exist';
|
|
5
|
-
import type { MedipassRequestOpts } from '../_types';
|
|
6
|
-
|
|
7
|
-
const pathBusinessTransactions = businessId => `/businesses/${businessId}/transactions`;
|
|
8
|
-
const pathBusinessTransaction = (businessId, transactionId) =>
|
|
9
|
-
`/businesses/${businessId}/transactions/${transactionId}`;
|
|
10
|
-
const pathBusinessTransactionRefund = (businessId, transactionId) =>
|
|
11
|
-
`/businesses/${businessId}/transactions/${transactionId}/refunds`;
|
|
12
|
-
const pathBusinessPracticeTransactions = (businessId, practiceId) =>
|
|
13
|
-
`/businesses/${businessId}/practices/${practiceId}/transactions`;
|
|
14
|
-
const pathBusinessPracticeStaffInvoices = (businessId, practiceId, staffId) =>
|
|
15
|
-
`/businesses/${businessId}/practices/${practiceId}/staff/${staffId}/invoices`;
|
|
16
|
-
const pathBusinessPracticeInvoices = (businessId, practiceId) =>
|
|
17
|
-
`/businesses/${businessId}/practices/${practiceId}/invoices`;
|
|
18
|
-
const pathBusinessTransactionQuotes = businessId => `/businesses/${businessId}/transactions/quotes`;
|
|
19
|
-
const pathBusinessPracticeStaffQuotes = (businessId, practiceId, staffId) =>
|
|
20
|
-
`/businesses/${businessId}/practices/${practiceId}/staff/${staffId}/quotes`;
|
|
21
|
-
const pathBusinessPracticeStaffTransactions = (businessId, practiceId, staffId) =>
|
|
22
|
-
`/businesses/${businessId}/practices/${practiceId}/staff/${staffId}/transactions`;
|
|
23
|
-
const pathBusinessTransactionsInvoiceReference = (businessId, invoiceReference) =>
|
|
24
|
-
`/businesses/${businessId}/transactions/invoicereference/${invoiceReference}`;
|
|
25
|
-
const pathHealthFundTransaction = (healthFundId, transactionId) =>
|
|
26
|
-
`/healthfunds/${healthFundId}/transactions/${transactionId}`;
|
|
27
|
-
const pathReplyQuote = transactionId => `/transactions/${transactionId}/replyquote`;
|
|
28
|
-
const pathTransactionApprove = transactionId => `/transactions/${transactionId}/approve`;
|
|
29
|
-
const pathTransactionSendReceipt = transactionId => `/transactions/${transactionId}/sendreceipt`;
|
|
30
|
-
const pathTransactionByTransactionId = transactionId => `/transactions/${transactionId}`;
|
|
31
|
-
const pathTransactionsForHealthFund = healthFundId => `/healthfunds/${healthFundId}/transactions`;
|
|
32
|
-
const pathHealthFundMemberTransactions = (healthFundId, memberId) =>
|
|
33
|
-
`/healthfunds/${healthFundId}/members/${memberId}/transactions`;
|
|
34
|
-
const pathHealthFundTransactionsAssign = healthFundId => `/healthfunds/${healthFundId}/transactions/assign`;
|
|
35
|
-
const pathTransactionsByMember = memberId => `/members/${memberId}/transactions`;
|
|
36
|
-
const pathTransactionTag = (transactionId, tagId) => `/transactions/${transactionId}/tags/${tagId}`;
|
|
37
|
-
const pathValidateTransaction = transactionId => `/transactions/${transactionId}/validate`;
|
|
38
|
-
const pathTransactionSubmitBridgeClaim = transactionId => `/transactions/${transactionId}/submitbridgeclaim`;
|
|
39
|
-
const pathTransactionSubmitBridgePayment = transactionId => `/transactions/${transactionId}/submitbridgepayment`;
|
|
40
|
-
const pathTransactionTriggerBridge = transactionId => `/transactions/${transactionId}/triggerbridge`;
|
|
41
|
-
const pathCreateInvoice = businessId => `/businesses/${businessId}/transactions/invoices`;
|
|
42
|
-
const pathCreateDraft = businessId => `/businesses/${businessId}/transactions/drafts`;
|
|
43
|
-
const pathConvertDraft = transactionId => `/transactions/${transactionId}/convertdrafts`;
|
|
44
|
-
const pathCreateSendClaim = transactionId => `/transactions/${transactionId}/claims`;
|
|
45
|
-
const pathCompleteTransaction = transactionId => `/transactions/${transactionId}/completes`;
|
|
46
|
-
const pathClaim = (transactionId, claimId) => `/transactions/${transactionId}/claims/${claimId}`;
|
|
47
|
-
const pathApproveClaim = (transactionId, claimId) => `/transactions/${transactionId}/claims/${claimId}/approves`;
|
|
48
|
-
const pathCancelClaim = (transactionId, claimId) => `/transactions/${transactionId}/claims/${claimId}/cancels`;
|
|
49
|
-
const pathSaveClaim = (transactionId, claimId) => `/transactions/${transactionId}/claims/${claimId}/savedetails`;
|
|
50
|
-
const pathSubmitClaim = (transactionId, claimId) => `/transactions/${transactionId}/claims/${claimId}/submits`;
|
|
51
|
-
const pathTransactionClaimPdf = (transactionId, claimId) => `/transactions/${transactionId}/claims/${claimId}/pdf`;
|
|
52
|
-
const pathTransactionClaimPdfV2 = '/transactions/pdfs';
|
|
53
|
-
const pathTransactionPays = transactionId => `/transactions/${transactionId}/pays`;
|
|
54
|
-
const pathTransactionProcessingRequests = transactionId => `/transactions/${transactionId}/processingrequests`;
|
|
55
|
-
const pathTransactionCancel = transactionId => `/transactions/${transactionId}/cancels`;
|
|
56
|
-
const pathTransactionPaymentLink = transactionId => `/transactions/${transactionId}/paymentlink`;
|
|
57
|
-
const pathTransactionRefund = transactionId => `/transactions/${transactionId}/refunds`;
|
|
58
|
-
const pathTransactionArchives = transactionId => `/transactions/${transactionId}/archives`;
|
|
59
|
-
const pathTransactionUnarchives = transactionId => `/transactions/${transactionId}/unarchives`;
|
|
60
|
-
const pathTransactionTerminalInput = transactionId => `/transactions/${transactionId}/terminalinput`;
|
|
61
|
-
const pathTransactionTerminalCancel = transactionId => `/transactions/${transactionId}/terminalcancel`;
|
|
62
|
-
const pathTransactionPaymentRefund = (transactionId, paymentId) =>
|
|
63
|
-
`/transactions/${transactionId}/payments/${paymentId}/refunds`;
|
|
64
|
-
const pathCreateEclipseInPatientInvoice = () => `/transactions/invoices/eclipse/imcw`;
|
|
65
|
-
const pathCreateEclipseOverseasInvoice = () => `/transactions/invoices/eclipse/ovsw`;
|
|
66
|
-
const pathCreateEclipseOnlineEligibilityCheckInvoice = () => `/transactions/invoices/eclipse/oecw`;
|
|
67
|
-
|
|
68
|
-
const pathReconcileClaim = (transactionId, claimId) => `/transactions/${transactionId}/claims/${claimId}/reconciles`;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Approve a transaction
|
|
72
|
-
* @param {String} transactionId - Transaction ID
|
|
73
|
-
* @param {Object} body - Request body
|
|
74
|
-
* @param {Object} opts - Additional options
|
|
75
|
-
*/
|
|
76
|
-
export const approveTransaction = async (
|
|
77
|
-
transactionId: string,
|
|
78
|
-
body: Object,
|
|
79
|
-
opts?: MedipassRequestOpts = {}
|
|
80
|
-
): Promise<Object> => {
|
|
81
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
82
|
-
return request({ ...opts, path: pathTransactionApprove(transactionId) }, { method: 'post', data: body });
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Assign health fund transactions
|
|
87
|
-
* @param {String} healthFundId - Health fund ID
|
|
88
|
-
* @param {Object} opts - Additional options
|
|
89
|
-
*/
|
|
90
|
-
export const assignHealthFundTransactions = async (
|
|
91
|
-
healthFundId: string,
|
|
92
|
-
body: Object,
|
|
93
|
-
opts?: MedipassRequestOpts = {}
|
|
94
|
-
): Promise<Object> => {
|
|
95
|
-
doesParamExist({ healthFundId }, opts.hyperMediaEndpoint);
|
|
96
|
-
return request({ ...opts, path: pathHealthFundTransactionsAssign(healthFundId) }, { method: 'post', data: body });
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Assign health fund transaction to self
|
|
101
|
-
* @param {String} healthFundId - Health fund ID
|
|
102
|
-
* @param {String} transactionId - Transaction ID
|
|
103
|
-
* @param {Object} opts - Additional options
|
|
104
|
-
*/
|
|
105
|
-
export const assignHealthFundTransactionToSelf = async (
|
|
106
|
-
healthFundId: string,
|
|
107
|
-
transactionId: string,
|
|
108
|
-
opts?: MedipassRequestOpts = {}
|
|
109
|
-
): Promise<Object> => {
|
|
110
|
-
doesParamExist({ transactionId, healthFundId }, opts.hyperMediaEndpoint);
|
|
111
|
-
return request(
|
|
112
|
-
{ ...opts, path: `${pathHealthFundTransaction(healthFundId, transactionId)}/assigntome` },
|
|
113
|
-
{ method: 'put' }
|
|
114
|
-
);
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Assign transaction to self
|
|
119
|
-
* @param {String} transactionId - Transaction ID
|
|
120
|
-
* @param {Object} opts - Additional options
|
|
121
|
-
*/
|
|
122
|
-
export const assignTransactionToSelf = async (
|
|
123
|
-
transactionId: string,
|
|
124
|
-
opts?: MedipassRequestOpts = {}
|
|
125
|
-
): Promise<Object> => {
|
|
126
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
127
|
-
return request({ ...opts, path: `${pathTransactionByTransactionId(transactionId)}/assigntome` }, { method: 'put' });
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Cancel a transaction
|
|
132
|
-
* @param {String} transactionId - Transaction ID
|
|
133
|
-
* @param {Object} opts - Additional options
|
|
134
|
-
*/
|
|
135
|
-
export const cancelTransaction = async (
|
|
136
|
-
transactionId: string,
|
|
137
|
-
body: Object,
|
|
138
|
-
opts?: MedipassRequestOpts = {}
|
|
139
|
-
): Promise<Object> => {
|
|
140
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
141
|
-
return request(
|
|
142
|
-
{ ...opts, path: `${pathTransactionByTransactionId(transactionId)}/cancellations` },
|
|
143
|
-
{ data: body, method: 'post' }
|
|
144
|
-
);
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Cancel a business transaction
|
|
149
|
-
* @param {String} businessId - Business ID
|
|
150
|
-
* @param {String} transactionId - Transaction ID
|
|
151
|
-
* @param {Object} opts - Additional options
|
|
152
|
-
*/
|
|
153
|
-
export const cancelBusinessTransaction = async (
|
|
154
|
-
businessId: string,
|
|
155
|
-
transactionId: string,
|
|
156
|
-
body: Object,
|
|
157
|
-
opts?: MedipassRequestOpts = {}
|
|
158
|
-
): Promise<Object> => {
|
|
159
|
-
doesParamExist({ transactionId, businessId }, opts.hyperMediaEndpoint);
|
|
160
|
-
return request(
|
|
161
|
-
{ ...opts, path: `${pathBusinessTransaction(businessId, transactionId)}/cancellations` },
|
|
162
|
-
{ data: body, method: 'post' }
|
|
163
|
-
);
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Create an invoice for a business
|
|
168
|
-
* @param {String} businessId - Business ID
|
|
169
|
-
* @param {String} practiceId - Practice ID
|
|
170
|
-
* @param {String} staffId - Staff ID
|
|
171
|
-
* @param {Object} body - Request body
|
|
172
|
-
* @param {Object} opts - Additional options
|
|
173
|
-
*/
|
|
174
|
-
export const createBusinessPracticeStaffMemberInvoice = async (
|
|
175
|
-
businessId: string,
|
|
176
|
-
practiceId: string,
|
|
177
|
-
staffId: string,
|
|
178
|
-
body: Object,
|
|
179
|
-
opts?: MedipassRequestOpts = {}
|
|
180
|
-
): Promise<Object> => {
|
|
181
|
-
doesParamExist({ businessId, practiceId, staffId }, opts.hyperMediaEndpoint);
|
|
182
|
-
return request(
|
|
183
|
-
{ ...opts, path: pathBusinessPracticeStaffInvoices(businessId, practiceId, staffId) },
|
|
184
|
-
{ method: 'post', data: body }
|
|
185
|
-
);
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Create an invoice for a business
|
|
190
|
-
* @param {String} businessId - Business ID
|
|
191
|
-
* @param {String} practiceId - Practice ID
|
|
192
|
-
* @param {Object} body - Request body
|
|
193
|
-
* @param {Object} opts - Additional options
|
|
194
|
-
*/
|
|
195
|
-
export const createBusinessPracticeInvoice = async (
|
|
196
|
-
businessId: string,
|
|
197
|
-
practiceId: string,
|
|
198
|
-
body: Object,
|
|
199
|
-
opts?: MedipassRequestOpts = {}
|
|
200
|
-
): Promise<Object> => {
|
|
201
|
-
doesParamExist({ businessId, practiceId }, opts.hyperMediaEndpoint);
|
|
202
|
-
return request(
|
|
203
|
-
{ ...opts, path: pathBusinessPracticeInvoices(businessId, practiceId) },
|
|
204
|
-
{ method: 'post', data: body }
|
|
205
|
-
);
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Create a quote for a business
|
|
210
|
-
* @param {String} businessId - Business ID
|
|
211
|
-
* @param {Object} body - Request body
|
|
212
|
-
* @param {Object} opts - Additional options
|
|
213
|
-
*/
|
|
214
|
-
export const createBusinessTransactionQuote = async (
|
|
215
|
-
businessId: string,
|
|
216
|
-
body: Object,
|
|
217
|
-
opts?: MedipassRequestOpts = {}
|
|
218
|
-
): Promise<Object> => {
|
|
219
|
-
doesParamExist({ businessId }, opts.hyperMediaEndpoint);
|
|
220
|
-
return request({ ...opts, path: pathBusinessTransactionQuotes(businessId) }, { method: 'post', data: body });
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Create a quote for a staff
|
|
225
|
-
* @param {String} businessId - Business ID
|
|
226
|
-
* @param {String} practiceId - Practice ID
|
|
227
|
-
* @param {String} staffId - Staff ID
|
|
228
|
-
* @param {Object} body - Request body
|
|
229
|
-
* @param {Object} opts - Additional options
|
|
230
|
-
*/
|
|
231
|
-
export const createBusinessPracticeStaffMemberQuote = async (
|
|
232
|
-
businessId: string,
|
|
233
|
-
practiceId: string,
|
|
234
|
-
staffId: string,
|
|
235
|
-
body: Object,
|
|
236
|
-
opts?: MedipassRequestOpts = {}
|
|
237
|
-
): Promise<Object> => {
|
|
238
|
-
doesParamExist({ businessId, practiceId, staffId }, opts.hyperMediaEndpoint);
|
|
239
|
-
return request(
|
|
240
|
-
{ ...opts, path: pathBusinessPracticeStaffQuotes(businessId, practiceId, staffId) },
|
|
241
|
-
{ method: 'post', data: body }
|
|
242
|
-
);
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Create a payment for a transaction
|
|
247
|
-
* @param {String} transactionId - TransactionId
|
|
248
|
-
* @param {String} source - Payment source (e.g. 'mastercard')
|
|
249
|
-
* @param {String} nonce - Nonce (or client token)
|
|
250
|
-
* @param {Object} body - Request body
|
|
251
|
-
* @param {Object} opts - Additional options
|
|
252
|
-
*/
|
|
253
|
-
export const createPayment = async (
|
|
254
|
-
transactionId: string,
|
|
255
|
-
source?: string,
|
|
256
|
-
nonce?: string,
|
|
257
|
-
body: Object,
|
|
258
|
-
opts?: MedipassRequestOpts = {}
|
|
259
|
-
): Promise<Object> => {
|
|
260
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
261
|
-
const newBody = {
|
|
262
|
-
...body
|
|
263
|
-
};
|
|
264
|
-
if (source && nonce) {
|
|
265
|
-
newBody.payment = { source, nonce };
|
|
266
|
-
}
|
|
267
|
-
return request(
|
|
268
|
-
{ ...opts, path: `${pathTransactionByTransactionId(transactionId)}/payments` },
|
|
269
|
-
{ method: 'post', data: newBody }
|
|
270
|
-
);
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* Create a payment request for a transaction
|
|
275
|
-
* @param {String} transactionId - TransactionId
|
|
276
|
-
* @param {Object} body - Request body
|
|
277
|
-
* @param {Object} opts - Additional options
|
|
278
|
-
*/
|
|
279
|
-
export const createPaymentRequest = async (
|
|
280
|
-
transactionId: string,
|
|
281
|
-
body: Object,
|
|
282
|
-
opts?: MedipassRequestOpts = {}
|
|
283
|
-
): Promise<Object> => {
|
|
284
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
285
|
-
return request(
|
|
286
|
-
{ ...opts, path: `${pathTransactionByTransactionId(transactionId)}/paymentrequests` },
|
|
287
|
-
{ method: 'post', data: body }
|
|
288
|
-
);
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* Complete a quote
|
|
293
|
-
* @param {String} transactionId - Transaction ID
|
|
294
|
-
* @param {Object} memberId - Member ID
|
|
295
|
-
* @param {Object} opts - Additional options
|
|
296
|
-
*/
|
|
297
|
-
export const completeQuote = async (
|
|
298
|
-
transactionId: string,
|
|
299
|
-
memberId: string,
|
|
300
|
-
opts?: MedipassRequestOpts = {}
|
|
301
|
-
): Promise<Object> => {
|
|
302
|
-
doesParamExist({ transactionId, memberId }, opts.hyperMediaEndpoint);
|
|
303
|
-
return request(
|
|
304
|
-
{ ...opts, path: `${pathTransactionByTransactionId(transactionId)}/completequote` },
|
|
305
|
-
{ method: 'post', data: { memberId } }
|
|
306
|
-
);
|
|
307
|
-
};
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* Delete a transaction tag
|
|
311
|
-
* @param {String} transactionId - Transaction ID
|
|
312
|
-
* @param {String} tagId - Tag ID
|
|
313
|
-
* @param {Object} opts - Additional options
|
|
314
|
-
*/
|
|
315
|
-
export const deleteTransactionTag = async (
|
|
316
|
-
transactionId: string,
|
|
317
|
-
tagId: string,
|
|
318
|
-
opts?: MedipassRequestOpts = {}
|
|
319
|
-
): Promise<Object> => {
|
|
320
|
-
doesParamExist({ transactionId, tagId }, opts.hyperMediaEndpoint);
|
|
321
|
-
return request({ ...opts, path: pathTransactionTag(transactionId, tagId) }, { method: 'delete' });
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Delete a transaction
|
|
326
|
-
* @param {String} transactionId - Transaction ID
|
|
327
|
-
* @param {Object} opts - Additional options
|
|
328
|
-
*/
|
|
329
|
-
export const deleteTransaction = async (transactionId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
330
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
331
|
-
return request({ ...opts, path: pathTransactionByTransactionId(transactionId) }, { method: 'delete' });
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Get business transactions
|
|
336
|
-
* @param {String} businessId - Business ID
|
|
337
|
-
* @param {Object} query - query parameters
|
|
338
|
-
* @param {Object} opts - Additional options
|
|
339
|
-
*/
|
|
340
|
-
export const getBusinessTransactions = async (
|
|
341
|
-
businessId: string,
|
|
342
|
-
query?: Object = {},
|
|
343
|
-
opts?: MedipassRequestOpts = {}
|
|
344
|
-
): Promise<Object> => {
|
|
345
|
-
doesParamExist({ businessId }, opts.hyperMediaEndpoint);
|
|
346
|
-
return request({ ...opts, path: pathBusinessTransactions(businessId) }, { method: 'get', params: query });
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Get business transaction
|
|
351
|
-
* @param {String} businessId - Business ID
|
|
352
|
-
* @param {String} transactionId - Transaction ID
|
|
353
|
-
* @param {Object} opts - Additional options
|
|
354
|
-
*/
|
|
355
|
-
export const getBusinessTransaction = async (
|
|
356
|
-
businessId: string,
|
|
357
|
-
transactionId: string,
|
|
358
|
-
query?: ?{ includeDeleted: boolean },
|
|
359
|
-
opts?: MedipassRequestOpts = {}
|
|
360
|
-
): Promise<Object> => {
|
|
361
|
-
doesParamExist({ businessId, transactionId }, opts.hyperMediaEndpoint);
|
|
362
|
-
return request(
|
|
363
|
-
{ ...opts, path: pathBusinessTransaction(businessId, transactionId) },
|
|
364
|
-
{ method: 'get', params: query }
|
|
365
|
-
);
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* Get business transaction by invoice reference
|
|
370
|
-
* @param {String} businessId - Business ID
|
|
371
|
-
* @param {String} invoiceReference - Invoice reference
|
|
372
|
-
* @param {Object} opts - Additional options
|
|
373
|
-
*/
|
|
374
|
-
export const getBusinessTransactionByInvoiceReference = async (
|
|
375
|
-
businessId: string,
|
|
376
|
-
invoiceReference: string,
|
|
377
|
-
opts?: MedipassRequestOpts = {}
|
|
378
|
-
): Promise<Object> => {
|
|
379
|
-
doesParamExist({ businessId, invoiceReference }, opts.hyperMediaEndpoint);
|
|
380
|
-
return request(
|
|
381
|
-
{ ...opts, path: pathBusinessTransactionsInvoiceReference(businessId, invoiceReference) },
|
|
382
|
-
{ method: 'get' }
|
|
383
|
-
);
|
|
384
|
-
};
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* Get business transaction payment report
|
|
388
|
-
* @param {String} businessId - Business ID
|
|
389
|
-
* @param {String} transactionId - Transaction ID
|
|
390
|
-
* @param {Object} opts - Additional options
|
|
391
|
-
*/
|
|
392
|
-
export const getBusinessTransactionPaymentReport = async (
|
|
393
|
-
businessId: string,
|
|
394
|
-
transactionId: string,
|
|
395
|
-
query: Object,
|
|
396
|
-
opts?: MedipassRequestOpts = {}
|
|
397
|
-
): Promise<Object> => {
|
|
398
|
-
doesParamExist({ businessId, transactionId }, opts.hyperMediaEndpoint);
|
|
399
|
-
return request(
|
|
400
|
-
{ ...opts, path: `${pathBusinessTransaction(businessId, transactionId)}/paymentreport` },
|
|
401
|
-
{ method: 'get', params: query }
|
|
402
|
-
);
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* Get business transaction processing report
|
|
407
|
-
* @param {String} businessId - Business ID
|
|
408
|
-
* @param {String} transactionId - Transaction ID
|
|
409
|
-
* @param {Object} opts - Additional options
|
|
410
|
-
*/
|
|
411
|
-
export const getBusinessTransactionProcessingReport = async (
|
|
412
|
-
businessId: string,
|
|
413
|
-
transactionId: string,
|
|
414
|
-
query: Object,
|
|
415
|
-
opts?: MedipassRequestOpts = {}
|
|
416
|
-
): Promise<Object> => {
|
|
417
|
-
doesParamExist({ businessId, transactionId }, opts.hyperMediaEndpoint);
|
|
418
|
-
return request(
|
|
419
|
-
{ ...opts, path: `${pathBusinessTransaction(businessId, transactionId)}/processingreport` },
|
|
420
|
-
{ method: 'get', params: query }
|
|
421
|
-
);
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* Get business practice transactions
|
|
426
|
-
* @param {String} businessId - Business ID
|
|
427
|
-
* @param {String} practiceId - Practice ID
|
|
428
|
-
* @param {Object} query - query parameters
|
|
429
|
-
* @param {Object} opts - Additional options
|
|
430
|
-
*/
|
|
431
|
-
export const getBusinessPracticeTransactions = async (
|
|
432
|
-
businessId: string,
|
|
433
|
-
practiceId: string,
|
|
434
|
-
query?: Object = {},
|
|
435
|
-
opts?: MedipassRequestOpts = {}
|
|
436
|
-
): Promise<Object> => {
|
|
437
|
-
doesParamExist({ businessId, practiceId }, opts.hyperMediaEndpoint);
|
|
438
|
-
return request(
|
|
439
|
-
{ ...opts, path: pathBusinessPracticeTransactions(businessId, practiceId) },
|
|
440
|
-
{ method: 'get', params: query }
|
|
441
|
-
);
|
|
442
|
-
};
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* Get business staff transactions
|
|
446
|
-
* @param {String} businessId - Business ID
|
|
447
|
-
* @param {String} practiceId - Practice ID
|
|
448
|
-
* @param {String} staffId - Staff ID
|
|
449
|
-
* @param {Object} query - query parameters
|
|
450
|
-
* @param {Object} opts - Additional options
|
|
451
|
-
*/
|
|
452
|
-
export const getBusinessPracticeStaffTransactions = async (
|
|
453
|
-
businessId: string,
|
|
454
|
-
practiceId: string,
|
|
455
|
-
staffId: string,
|
|
456
|
-
query?: Object = {},
|
|
457
|
-
opts?: MedipassRequestOpts = {}
|
|
458
|
-
): Promise<Object> => {
|
|
459
|
-
doesParamExist({ businessId, practiceId, staffId }, opts.hyperMediaEndpoint);
|
|
460
|
-
return request(
|
|
461
|
-
{ ...opts, path: pathBusinessPracticeStaffTransactions(businessId, practiceId, staffId) },
|
|
462
|
-
{ method: 'get', params: query }
|
|
463
|
-
);
|
|
464
|
-
};
|
|
465
|
-
|
|
466
|
-
/**
|
|
467
|
-
* Get transactions by health fund
|
|
468
|
-
* @param {String} healthFundId - Health fund ID
|
|
469
|
-
* @param {Object} query - query parameters
|
|
470
|
-
* @param {Object} opts - Additional options
|
|
471
|
-
*/
|
|
472
|
-
export const getTransactionsForHealthFund = async (
|
|
473
|
-
healthFundId: string,
|
|
474
|
-
query?: Object = {},
|
|
475
|
-
opts?: MedipassRequestOpts = {}
|
|
476
|
-
): Promise<Object> => {
|
|
477
|
-
doesParamExist({ healthFundId }, opts.hyperMediaEndpoint);
|
|
478
|
-
return request({ ...opts, path: pathTransactionsForHealthFund(healthFundId) }, { method: 'get', params: query });
|
|
479
|
-
};
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
* Get transaction by transaction ID and health fund ID
|
|
483
|
-
* @param {String} healthFundId - Health fund ID
|
|
484
|
-
* @param {String} transactionId - Transaction ID
|
|
485
|
-
* @param {Object} opts - Additional options
|
|
486
|
-
*/
|
|
487
|
-
export const getHealthFundTransaction = async (
|
|
488
|
-
healthFundId: string,
|
|
489
|
-
transactionId: string,
|
|
490
|
-
opts?: MedipassRequestOpts = {}
|
|
491
|
-
): Promise<Object> => {
|
|
492
|
-
doesParamExist({ healthFundId, transactionId }, opts.hyperMediaEndpoint);
|
|
493
|
-
return request({ ...opts, path: pathHealthFundTransaction(healthFundId, transactionId) }, { method: 'get' });
|
|
494
|
-
};
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* Get transactions by member
|
|
498
|
-
* @param {String} memberId - Health fund ID
|
|
499
|
-
* @param {Object} query - query parameters
|
|
500
|
-
* @param {Object} opts - Additional options
|
|
501
|
-
*/
|
|
502
|
-
export const getTransactionsByMember = async (
|
|
503
|
-
memberId: string,
|
|
504
|
-
query?: Object = {},
|
|
505
|
-
opts?: MedipassRequestOpts = {}
|
|
506
|
-
): Promise<Object> => {
|
|
507
|
-
doesParamExist({ memberId }, opts.hyperMediaEndpoint);
|
|
508
|
-
return request({ ...opts, path: pathTransactionsByMember(memberId) }, { method: 'get', params: query });
|
|
509
|
-
};
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
* Get health fund member transactions
|
|
513
|
-
* @param {String} healthFundId - Health fund ID
|
|
514
|
-
* @param {String} memberId - Member ID
|
|
515
|
-
* @param {Object} query - query parameters
|
|
516
|
-
* @param {Object} opts - Additional options
|
|
517
|
-
*/
|
|
518
|
-
export const getHealthFundMemberTransactions = async (
|
|
519
|
-
healthFundId: string,
|
|
520
|
-
memberId: string,
|
|
521
|
-
query?: Object = {},
|
|
522
|
-
opts?: MedipassRequestOpts = {}
|
|
523
|
-
): Promise<Object> => {
|
|
524
|
-
doesParamExist({ healthFundId }, opts.hyperMediaEndpoint);
|
|
525
|
-
return request(
|
|
526
|
-
{ ...opts, path: pathHealthFundMemberTransactions(healthFundId, memberId) },
|
|
527
|
-
{ method: 'get', params: query }
|
|
528
|
-
);
|
|
529
|
-
};
|
|
530
|
-
|
|
531
|
-
/**
|
|
532
|
-
* Get transaction by transaction ID.
|
|
533
|
-
* @param {String} transactionId - Transaction ID
|
|
534
|
-
* @param {Object} opts - Additional options
|
|
535
|
-
*/
|
|
536
|
-
export const getTransactionByTransactionId = async (
|
|
537
|
-
transactionId: string,
|
|
538
|
-
query?: ?{ includeDeleted: boolean },
|
|
539
|
-
opts?: MedipassRequestOpts = {}
|
|
540
|
-
): Promise<Object> => {
|
|
541
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
542
|
-
return request({ ...opts, path: pathTransactionByTransactionId(transactionId) }, { method: 'get', params: query });
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
* Get transaction PDF
|
|
547
|
-
* @param {String} transactionId - Transaction ID
|
|
548
|
-
* @param {Object} body - Request body
|
|
549
|
-
* @param {Object} opts - Additional options
|
|
550
|
-
*/
|
|
551
|
-
export const getTransactionPDF = async (
|
|
552
|
-
transactionId: string,
|
|
553
|
-
body: Object,
|
|
554
|
-
opts?: MedipassRequestOpts = {}
|
|
555
|
-
): Promise<Object> => {
|
|
556
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
557
|
-
return request(
|
|
558
|
-
{ ...opts, path: `${pathTransactionByTransactionId(transactionId)}/pdf` },
|
|
559
|
-
{ method: 'post', data: body, responseType: 'arraybuffer' }
|
|
560
|
-
);
|
|
561
|
-
};
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
* Get transaction claim PDF
|
|
565
|
-
* @param {String} transactionId - Transaction ID
|
|
566
|
-
* @param {String} claimId - Claim ID
|
|
567
|
-
* @param {Object} body - Request body
|
|
568
|
-
* @param {Object} opts - Additional options
|
|
569
|
-
*/
|
|
570
|
-
export const getTransactionClaimPDF = async (
|
|
571
|
-
transactionId: string,
|
|
572
|
-
claimId: string,
|
|
573
|
-
body: Object,
|
|
574
|
-
opts?: MedipassRequestOpts = {}
|
|
575
|
-
): Promise<Object> => {
|
|
576
|
-
doesParamExist({ claimId, transactionId }, opts.hyperMediaEndpoint);
|
|
577
|
-
return request(
|
|
578
|
-
{ ...opts, path: pathTransactionClaimPdf(transactionId, claimId) },
|
|
579
|
-
{ method: 'post', data: body, responseType: 'arraybuffer' }
|
|
580
|
-
);
|
|
581
|
-
};
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* TODO: Use this endpoint for all funder claims, once the funder is supported in the API,
|
|
585
|
-
* replacing the legacy `getTransactionClaimPDF`.
|
|
586
|
-
*
|
|
587
|
-
* Get Eclipse transaction claim PDF
|
|
588
|
-
* @param {Object} body - Request body including `transactionId` and `claimId`
|
|
589
|
-
* @param {Object} opts - Additional options
|
|
590
|
-
*/
|
|
591
|
-
export const getTransactionClaimPdfV2 = async (body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
592
|
-
return request(
|
|
593
|
-
{ ...opts, path: pathTransactionClaimPdfV2 },
|
|
594
|
-
{ method: 'post', data: body, responseType: 'arraybuffer' }
|
|
595
|
-
);
|
|
596
|
-
};
|
|
597
|
-
|
|
598
|
-
/**
|
|
599
|
-
* Reply to a quote
|
|
600
|
-
* @param {String} transactionId - TransactionId
|
|
601
|
-
* @param {Object} body - Request body
|
|
602
|
-
* @param {Object} opts - Additional options
|
|
603
|
-
*/
|
|
604
|
-
export const replyToQuote = async (
|
|
605
|
-
transactionId: string,
|
|
606
|
-
body: Object,
|
|
607
|
-
opts?: MedipassRequestOpts = {}
|
|
608
|
-
): Promise<Object> => {
|
|
609
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
610
|
-
return request({ ...opts, path: pathReplyQuote(transactionId) }, { method: 'post', data: body });
|
|
611
|
-
};
|
|
612
|
-
|
|
613
|
-
/**
|
|
614
|
-
* Send receipt
|
|
615
|
-
* @param {String} transactionId - TransactionId
|
|
616
|
-
* @param {Object} body - Request body
|
|
617
|
-
* @param {Object} opts - Additional options
|
|
618
|
-
*/
|
|
619
|
-
export const sendReceipt = async (
|
|
620
|
-
transactionId: string,
|
|
621
|
-
body: Object,
|
|
622
|
-
opts?: MedipassRequestOpts = {}
|
|
623
|
-
): Promise<Object> => {
|
|
624
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
625
|
-
return request({ ...opts, path: pathTransactionSendReceipt(transactionId) }, { method: 'post', data: body });
|
|
626
|
-
};
|
|
627
|
-
|
|
628
|
-
/**
|
|
629
|
-
* Submit an invoice
|
|
630
|
-
* @param {String} transactionId - TransactionId
|
|
631
|
-
* @param {Object} body - Request body
|
|
632
|
-
* @param {Object} opts - Additional options
|
|
633
|
-
*/
|
|
634
|
-
export const submitInvoice = async (
|
|
635
|
-
transactionId: string,
|
|
636
|
-
body: Object,
|
|
637
|
-
opts?: MedipassRequestOpts = {}
|
|
638
|
-
): Promise<Object> => {
|
|
639
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
640
|
-
return request(
|
|
641
|
-
{ ...opts, path: `${pathTransactionByTransactionId(transactionId)}/submitinvoice` },
|
|
642
|
-
{ method: 'post', data: body }
|
|
643
|
-
);
|
|
644
|
-
};
|
|
645
|
-
|
|
646
|
-
/**
|
|
647
|
-
* Update transaction
|
|
648
|
-
* @param {String} transactionId - TransactionId
|
|
649
|
-
* @param {Object} body - Request body
|
|
650
|
-
* @param {Object} opts - Additional options
|
|
651
|
-
*/
|
|
652
|
-
export const updateTransaction = async (
|
|
653
|
-
transactionId: string,
|
|
654
|
-
body: Object,
|
|
655
|
-
opts?: MedipassRequestOpts = {}
|
|
656
|
-
): Promise<Object> => {
|
|
657
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
658
|
-
return request({ ...opts, path: pathTransactionByTransactionId(transactionId) }, { method: 'put', data: body });
|
|
659
|
-
};
|
|
660
|
-
|
|
661
|
-
/**
|
|
662
|
-
* Validate a transaction
|
|
663
|
-
* @param {String} transactionId - TransactionId
|
|
664
|
-
* @param {Object} opts - Additional options
|
|
665
|
-
*/
|
|
666
|
-
export const validateTransaction = async (transactionId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
667
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
668
|
-
return request({ ...opts, path: pathValidateTransaction(transactionId) }, { method: 'post' });
|
|
669
|
-
};
|
|
670
|
-
|
|
671
|
-
/**
|
|
672
|
-
* Submits a Bridge's claim response to transaction
|
|
673
|
-
* @param {String} transactionId - TransactionId
|
|
674
|
-
* @param {Object} body - Request body
|
|
675
|
-
* @param {Object} opts - Additional options
|
|
676
|
-
*/
|
|
677
|
-
export const submitTransactionBridgeClaim = async (
|
|
678
|
-
transactionId: string,
|
|
679
|
-
body: Object,
|
|
680
|
-
opts?: MedipassRequestOpts = {}
|
|
681
|
-
): Promise<Object> => {
|
|
682
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
683
|
-
return request({ ...opts, path: pathTransactionSubmitBridgeClaim(transactionId) }, { method: 'post', data: body });
|
|
684
|
-
};
|
|
685
|
-
|
|
686
|
-
/**
|
|
687
|
-
* Submits a Bridge's payment response to transaction
|
|
688
|
-
* @param {String} transactionId - TransactionId
|
|
689
|
-
* @param {Object} body - Request body
|
|
690
|
-
* @param {Object} opts - Additional options
|
|
691
|
-
*/
|
|
692
|
-
export const submitTransactionBridgePayment = async (
|
|
693
|
-
transactionId: string,
|
|
694
|
-
body: Object,
|
|
695
|
-
opts?: MedipassRequestOpts = {}
|
|
696
|
-
): Promise<Object> => {
|
|
697
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
698
|
-
return request({ ...opts, path: pathTransactionSubmitBridgePayment(transactionId) }, { method: 'post', data: body });
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
/**
|
|
702
|
-
* Trigger's a bridge request for a transaction
|
|
703
|
-
* @param {String} transactionId - TransactionId
|
|
704
|
-
* @param {Object} body - Request body
|
|
705
|
-
* @param {Object} opts - Additional options
|
|
706
|
-
*/
|
|
707
|
-
export const triggerBridge = async (
|
|
708
|
-
transactionId: string,
|
|
709
|
-
body: Object,
|
|
710
|
-
opts?: MedipassRequestOpts = {}
|
|
711
|
-
): Promise<Object> => {
|
|
712
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
713
|
-
return request({ ...opts, path: pathTransactionTriggerBridge(transactionId) }, { method: 'post', data: body });
|
|
714
|
-
};
|
|
715
|
-
|
|
716
|
-
/**
|
|
717
|
-
* Create invoice
|
|
718
|
-
* @param {String} businessId - BusinessId
|
|
719
|
-
* @param {Object} body - Request body
|
|
720
|
-
* @param {Object} opts - Additional options
|
|
721
|
-
*/
|
|
722
|
-
export const createInvoice = async (
|
|
723
|
-
businessId: string,
|
|
724
|
-
body: Object,
|
|
725
|
-
opts?: MedipassRequestOpts = {}
|
|
726
|
-
): Promise<Object> => {
|
|
727
|
-
doesParamExist({ businessId }, opts.hyperMediaEndpoint);
|
|
728
|
-
return request({ ...opts, path: pathCreateInvoice(businessId) }, { method: 'post', data: body });
|
|
729
|
-
};
|
|
730
|
-
|
|
731
|
-
/**
|
|
732
|
-
* Create or send a claim
|
|
733
|
-
* @param {String} transactionId - TransactionId
|
|
734
|
-
* @param {Object} body - Request body
|
|
735
|
-
* @param {Object} opts - Additional options
|
|
736
|
-
*/
|
|
737
|
-
export const createSendClaim = async (
|
|
738
|
-
transactionId: string,
|
|
739
|
-
body: Object,
|
|
740
|
-
opts?: MedipassRequestOpts = {}
|
|
741
|
-
): Promise<Object> => {
|
|
742
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
743
|
-
return request({ ...opts, path: pathCreateSendClaim(transactionId) }, { method: 'post', data: body });
|
|
744
|
-
};
|
|
745
|
-
|
|
746
|
-
/**
|
|
747
|
-
* Update a claim
|
|
748
|
-
* @param {String} transactionId - TransactionId
|
|
749
|
-
* @param {String} claimId - ClaimId
|
|
750
|
-
* @param {Object} body - Request body
|
|
751
|
-
* @param {Object} opts - Additional options
|
|
752
|
-
*/
|
|
753
|
-
export const updateClaim = async (
|
|
754
|
-
transactionId: string,
|
|
755
|
-
claimId: string,
|
|
756
|
-
body: Object,
|
|
757
|
-
opts?: MedipassRequestOpts = {}
|
|
758
|
-
): Promise<Object> => {
|
|
759
|
-
doesParamExist({ claimId, transactionId }, opts.hyperMediaEndpoint);
|
|
760
|
-
return request({ ...opts, path: pathClaim(transactionId, claimId) }, { method: 'put', data: body });
|
|
761
|
-
};
|
|
762
|
-
|
|
763
|
-
/**
|
|
764
|
-
* Complete a transaction
|
|
765
|
-
* @param {String} transactionId - TransactionId
|
|
766
|
-
* @param {Object} opts - Additional options
|
|
767
|
-
*/
|
|
768
|
-
export const completeTransaction = async (transactionId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
769
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
770
|
-
return request({ ...opts, path: pathCompleteTransaction(transactionId) }, { method: 'post' });
|
|
771
|
-
};
|
|
772
|
-
|
|
773
|
-
/**
|
|
774
|
-
* Approves a claim
|
|
775
|
-
* @param {String} transactionId - TransactionId
|
|
776
|
-
* @param {String} claimId - ClaimId
|
|
777
|
-
* @param {Object} body - Request body
|
|
778
|
-
* @param {Object} opts - Additional options
|
|
779
|
-
*/
|
|
780
|
-
export const approveClaim = async (
|
|
781
|
-
transactionId: string,
|
|
782
|
-
claimId: string,
|
|
783
|
-
body: Object,
|
|
784
|
-
opts?: MedipassRequestOpts = {}
|
|
785
|
-
): Promise<Object> => {
|
|
786
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
787
|
-
return request({ ...opts, path: pathApproveClaim(transactionId, claimId) }, { method: 'post', data: body });
|
|
788
|
-
};
|
|
789
|
-
|
|
790
|
-
/**
|
|
791
|
-
* Cancels a claim
|
|
792
|
-
* @param {String} transactionId - Transaction ID
|
|
793
|
-
* @param {String} claimId - Claim ID
|
|
794
|
-
* @param {Object} opts - Additional options
|
|
795
|
-
*/
|
|
796
|
-
export const cancelClaim = async (
|
|
797
|
-
transactionId: string,
|
|
798
|
-
claimId: string,
|
|
799
|
-
body: Object,
|
|
800
|
-
opts?: MedipassRequestOpts = {}
|
|
801
|
-
): Promise<Object> => {
|
|
802
|
-
doesParamExist({ claimId, transactionId }, opts.hyperMediaEndpoint);
|
|
803
|
-
return request({ ...opts, path: pathCancelClaim(transactionId, claimId) }, { method: 'post', data: body });
|
|
804
|
-
};
|
|
805
|
-
|
|
806
|
-
/**
|
|
807
|
-
* Submit a claim
|
|
808
|
-
* @param {String} transactionId - TransactionId
|
|
809
|
-
* @param {String} claimId - ClaimId
|
|
810
|
-
* @param {Object} body - Request body
|
|
811
|
-
* @param {Object} opts - Additional options
|
|
812
|
-
*/
|
|
813
|
-
export const submitClaim = async (
|
|
814
|
-
transactionId: string,
|
|
815
|
-
claimId: string,
|
|
816
|
-
body: Object,
|
|
817
|
-
opts?: MedipassRequestOpts = {}
|
|
818
|
-
): Promise<Object> => {
|
|
819
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
820
|
-
return request({ ...opts, path: pathSubmitClaim(transactionId, claimId) }, { method: 'post', data: body });
|
|
821
|
-
};
|
|
822
|
-
|
|
823
|
-
/**
|
|
824
|
-
* Save claim details
|
|
825
|
-
* @param {String} transactionId - Transaction ID
|
|
826
|
-
* @param {String} claimId - Claim ID
|
|
827
|
-
* @param {Object} opts - Additional options
|
|
828
|
-
*/
|
|
829
|
-
export const saveClaimDetails = async (
|
|
830
|
-
transactionId: string,
|
|
831
|
-
claimId: string,
|
|
832
|
-
opts?: MedipassRequestOpts = {}
|
|
833
|
-
): Promise<Object> => {
|
|
834
|
-
doesParamExist({ claimId, transactionId }, opts.hyperMediaEndpoint);
|
|
835
|
-
return request({ ...opts, path: pathSaveClaim(transactionId, claimId) }, { method: 'post' });
|
|
836
|
-
};
|
|
837
|
-
|
|
838
|
-
/**
|
|
839
|
-
* Create payment
|
|
840
|
-
* @param {String} transactionId - Transaction ID
|
|
841
|
-
* @param {Object} body - Request body
|
|
842
|
-
* @param {Object} opts - Additional options
|
|
843
|
-
*/
|
|
844
|
-
export const pay = async (transactionId: string, body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
845
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
846
|
-
return request({ ...opts, path: pathTransactionPays(transactionId) }, { method: 'post', data: body });
|
|
847
|
-
};
|
|
848
|
-
|
|
849
|
-
/**
|
|
850
|
-
* Send a processing request
|
|
851
|
-
* @param {String} transactionId - TransactionId
|
|
852
|
-
* @param {Object} body - Request body
|
|
853
|
-
* @param {Object} opts - Additional options
|
|
854
|
-
*/
|
|
855
|
-
export const sendProcessingRequest = async (
|
|
856
|
-
transactionId: string,
|
|
857
|
-
body: Object,
|
|
858
|
-
opts?: MedipassRequestOpts = {}
|
|
859
|
-
): Promise<Object> => {
|
|
860
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
861
|
-
return request({ ...opts, path: pathTransactionProcessingRequests(transactionId) }, { method: 'post', data: body });
|
|
862
|
-
};
|
|
863
|
-
|
|
864
|
-
/**
|
|
865
|
-
* Cancel invoice
|
|
866
|
-
* @param {String} transactionId - TransactionId
|
|
867
|
-
* @param {Object} body - Request body
|
|
868
|
-
* @param {Object} opts - Additional options
|
|
869
|
-
*/
|
|
870
|
-
export const cancelInvoice = async (
|
|
871
|
-
transactionId: string,
|
|
872
|
-
body: Object,
|
|
873
|
-
opts?: MedipassRequestOpts = {}
|
|
874
|
-
): Promise<Object> => {
|
|
875
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
876
|
-
return request({ ...opts, path: pathTransactionCancel(transactionId) }, { method: 'post', data: body });
|
|
877
|
-
};
|
|
878
|
-
|
|
879
|
-
/**
|
|
880
|
-
* Get payment link
|
|
881
|
-
* @param {String} transactionId - TransactionId
|
|
882
|
-
* @param {Object} opts - Additional options
|
|
883
|
-
*/
|
|
884
|
-
export const getPaymentLink = async (transactionId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
885
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
886
|
-
return request({ ...opts, path: pathTransactionPaymentLink(transactionId) }, { method: 'get' });
|
|
887
|
-
};
|
|
888
|
-
|
|
889
|
-
/**
|
|
890
|
-
* Refund transaction
|
|
891
|
-
* @param {String} businessId - BusinessId
|
|
892
|
-
* @param {String} transactionId - TransactionId
|
|
893
|
-
* @param {Object} body - Request body
|
|
894
|
-
* @param {Object} opts - Additional options
|
|
895
|
-
*/
|
|
896
|
-
export const refundByBusiness = async (
|
|
897
|
-
businessId: string,
|
|
898
|
-
transactionId: string,
|
|
899
|
-
body: Object,
|
|
900
|
-
opts?: MedipassRequestOpts = {}
|
|
901
|
-
): Promise<Object> => {
|
|
902
|
-
doesParamExist({ businessId, transactionId }, opts.hyperMediaEndpoint);
|
|
903
|
-
return request(
|
|
904
|
-
{ ...opts, path: pathBusinessTransactionRefund(businessId, transactionId) },
|
|
905
|
-
{ method: 'post', data: body }
|
|
906
|
-
);
|
|
907
|
-
};
|
|
908
|
-
|
|
909
|
-
/**
|
|
910
|
-
* Refund transaction
|
|
911
|
-
* @param {String} transactionId - TransactionId
|
|
912
|
-
* @param {Object} body - Request body
|
|
913
|
-
* @param {Object} opts - Additional options
|
|
914
|
-
*/
|
|
915
|
-
export const refund = async (transactionId: string, body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
916
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
917
|
-
return request({ ...opts, path: pathTransactionRefund(transactionId) }, { method: 'post', data: body });
|
|
918
|
-
};
|
|
919
|
-
|
|
920
|
-
/**
|
|
921
|
-
* Save invoice as draft
|
|
922
|
-
* @param {String} businessId - BusinessId
|
|
923
|
-
* @param {Object} body - Request body
|
|
924
|
-
* @param {Object} opts - Additional options
|
|
925
|
-
*/
|
|
926
|
-
export const saveDraft = async (businessId: string, body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
927
|
-
doesParamExist({ businessId }, opts.hyperMediaEndpoint);
|
|
928
|
-
return request({ ...opts, path: pathCreateDraft(businessId) }, { method: 'post', data: body });
|
|
929
|
-
};
|
|
930
|
-
|
|
931
|
-
/**
|
|
932
|
-
* Convert draft to an invoice
|
|
933
|
-
* @param {String} transactionId - Transaction ID
|
|
934
|
-
* @param {Object} body - Request body
|
|
935
|
-
* @param {Object} opts - Additional options
|
|
936
|
-
*/
|
|
937
|
-
export const convertDraft = async (
|
|
938
|
-
transactionId: string,
|
|
939
|
-
body: Object,
|
|
940
|
-
opts?: MedipassRequestOpts = {}
|
|
941
|
-
): Promise<Object> => {
|
|
942
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
943
|
-
return request({ ...opts, path: pathConvertDraft(transactionId) }, { method: 'post', data: body });
|
|
944
|
-
};
|
|
945
|
-
|
|
946
|
-
/**
|
|
947
|
-
* Archive an invoice
|
|
948
|
-
* @param {String} transactionId - Transaction ID
|
|
949
|
-
* @param {Object} opts - Additional options
|
|
950
|
-
*/
|
|
951
|
-
export const archive = async (transactionId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
952
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
953
|
-
return request({ ...opts, path: pathTransactionArchives(transactionId) }, { method: 'put' });
|
|
954
|
-
};
|
|
955
|
-
|
|
956
|
-
/**
|
|
957
|
-
* Unarchive an invoice
|
|
958
|
-
* @param {String} transactionId - Transaction ID
|
|
959
|
-
* @param {Object} opts - Additional options
|
|
960
|
-
*/
|
|
961
|
-
export const unarchive = async (transactionId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
962
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
963
|
-
return request({ ...opts, path: pathTransactionUnarchives(transactionId) }, { method: 'put' });
|
|
964
|
-
};
|
|
965
|
-
|
|
966
|
-
/**
|
|
967
|
-
* Send terminal input
|
|
968
|
-
* @param {String} transactionId - Transaction ID
|
|
969
|
-
* @param {Object} body - Request body
|
|
970
|
-
* @param {Object} opts - Additional options
|
|
971
|
-
*/
|
|
972
|
-
export const terminalInput = async (
|
|
973
|
-
transactionId: string,
|
|
974
|
-
body: Object,
|
|
975
|
-
opts?: MedipassRequestOpts = {}
|
|
976
|
-
): Promise<Object> => {
|
|
977
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
978
|
-
return request({ ...opts, path: pathTransactionTerminalInput(transactionId) }, { method: 'post', data: body });
|
|
979
|
-
};
|
|
980
|
-
|
|
981
|
-
/**
|
|
982
|
-
* Send terminal cancellation
|
|
983
|
-
* @param {String} transactionId - Transaction ID
|
|
984
|
-
* @param {Object} body - Request body
|
|
985
|
-
* @param {Object} opts - Additional options
|
|
986
|
-
*/
|
|
987
|
-
export const terminalCancellation = async (
|
|
988
|
-
transactionId: string,
|
|
989
|
-
body: Object,
|
|
990
|
-
opts?: MedipassRequestOpts = {}
|
|
991
|
-
): Promise<Object> => {
|
|
992
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
993
|
-
return request({ ...opts, path: pathTransactionTerminalCancel(transactionId) }, { method: 'post', data: body });
|
|
994
|
-
};
|
|
995
|
-
|
|
996
|
-
/**
|
|
997
|
-
* Refund transaction's payment
|
|
998
|
-
* @param {String} transactionId - TransactionId
|
|
999
|
-
* @param {String} paymentId - PaymentId
|
|
1000
|
-
* @param {Object} body - Request body
|
|
1001
|
-
* @param {Object} opts - Additional options
|
|
1002
|
-
*/
|
|
1003
|
-
export const refundPayment = async (
|
|
1004
|
-
transactionId: string,
|
|
1005
|
-
paymentId: string,
|
|
1006
|
-
body: Object,
|
|
1007
|
-
opts?: MedipassRequestOpts = {}
|
|
1008
|
-
): Promise<Object> => {
|
|
1009
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
1010
|
-
return request(
|
|
1011
|
-
{ ...opts, path: pathTransactionPaymentRefund(transactionId, paymentId) },
|
|
1012
|
-
{ method: 'post', data: body }
|
|
1013
|
-
);
|
|
1014
|
-
};
|
|
1015
|
-
|
|
1016
|
-
/**
|
|
1017
|
-
* Create ECLIPSE invoice - In Patient
|
|
1018
|
-
* @param {Object} body - Request body
|
|
1019
|
-
* @param {Object} opts - Additional options
|
|
1020
|
-
*/
|
|
1021
|
-
export const createEclipseInPatientInvoice = async (body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
1022
|
-
return request({ ...opts, path: pathCreateEclipseInPatientInvoice() }, { method: 'post', data: body });
|
|
1023
|
-
};
|
|
1024
|
-
|
|
1025
|
-
/**
|
|
1026
|
-
* Create ECLIPSE invoice - Overseas
|
|
1027
|
-
* @param {Object} body - Request body
|
|
1028
|
-
* @param {Object} opts - Additional options
|
|
1029
|
-
*/
|
|
1030
|
-
export const createEclipseOverseasInvoice = async (body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
1031
|
-
return request({ ...opts, path: pathCreateEclipseOverseasInvoice() }, { method: 'post', data: body });
|
|
1032
|
-
};
|
|
1033
|
-
|
|
1034
|
-
/**
|
|
1035
|
-
* Create ECLIPSE invoice - Online Eligibility Check
|
|
1036
|
-
* @param {Object} body - Request body
|
|
1037
|
-
* @param {Object} opts - Additional options
|
|
1038
|
-
*/
|
|
1039
|
-
export const createEclipseOnlineEligibilityCheckInvoice = async (
|
|
1040
|
-
body: Object,
|
|
1041
|
-
opts?: MedipassRequestOpts = {}
|
|
1042
|
-
): Promise<Object> => {
|
|
1043
|
-
return request({ ...opts, path: pathCreateEclipseOnlineEligibilityCheckInvoice() }, { method: 'post', data: body });
|
|
1044
|
-
};
|
|
1045
|
-
|
|
1046
|
-
/**
|
|
1047
|
-
* Get business ECLIPSE transaction payment report
|
|
1048
|
-
* @param {String} businessId - Business ID
|
|
1049
|
-
* @param {String} transactionId - Transaction ID
|
|
1050
|
-
* @param {Object} opts - Additional options
|
|
1051
|
-
*/
|
|
1052
|
-
export const getBusinessEclipseTransactionPaymentReport = async (
|
|
1053
|
-
businessId: string,
|
|
1054
|
-
transactionId: string,
|
|
1055
|
-
query: Object,
|
|
1056
|
-
opts?: MedipassRequestOpts = {}
|
|
1057
|
-
): Promise<Object> => {
|
|
1058
|
-
doesParamExist({ businessId, transactionId }, opts.hyperMediaEndpoint);
|
|
1059
|
-
return request(
|
|
1060
|
-
{ ...opts, path: `${pathBusinessTransaction(businessId, transactionId)}/paymentreport/eclipse` },
|
|
1061
|
-
{ method: 'get', params: query }
|
|
1062
|
-
);
|
|
1063
|
-
};
|
|
1064
|
-
|
|
1065
|
-
/**
|
|
1066
|
-
* Get business ECLIPSE transaction processing report
|
|
1067
|
-
* @param {String} businessId - Business ID
|
|
1068
|
-
* @param {String} transactionId - Transaction ID
|
|
1069
|
-
* @param {Object} opts - Additional options
|
|
1070
|
-
*/
|
|
1071
|
-
export const getBusinessEclipseTransactionProcessingReport = async (
|
|
1072
|
-
businessId: string,
|
|
1073
|
-
transactionId: string,
|
|
1074
|
-
query: Object,
|
|
1075
|
-
opts?: MedipassRequestOpts = {}
|
|
1076
|
-
): Promise<Object> => {
|
|
1077
|
-
doesParamExist({ businessId, transactionId }, opts.hyperMediaEndpoint);
|
|
1078
|
-
return request(
|
|
1079
|
-
{ ...opts, path: `${pathBusinessTransaction(businessId, transactionId)}/processingreport/eclipse` },
|
|
1080
|
-
{ method: 'get', params: query }
|
|
1081
|
-
);
|
|
1082
|
-
};
|
|
1083
|
-
|
|
1084
|
-
/**
|
|
1085
|
-
* Reconciles a claim
|
|
1086
|
-
* @param {String} transactionId - TransactionId
|
|
1087
|
-
* @param {String} claimId - ClaimId
|
|
1088
|
-
* @param {Object} opts - Additional options
|
|
1089
|
-
*/
|
|
1090
|
-
export const reconcileClaim = async (
|
|
1091
|
-
transactionId: string,
|
|
1092
|
-
claimId: string,
|
|
1093
|
-
opts?: MedipassRequestOpts = {}
|
|
1094
|
-
): Promise<Object> => {
|
|
1095
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
1096
|
-
return request({ ...opts, path: pathReconcileClaim(transactionId, claimId) }, { method: 'post' });
|
|
1097
|
-
};
|