Any required claim or payment attributes are handled within the self-contained UI, such as practice, practitioner, patient and charges. You can also handle success, error & cancel events with an onSuccess, onErrorand onCancel callbacks. We also recommend setting a webhook to obtain transaction status changes post submission.
In the most basic mode, you direct users to the Transaction SDK which prompts users to enter all attributes required to process a claim or payment request. Once the transaction is complete, the status and payment reconciliation references are returned which can be recorded in your system. In this mode, users are required to input all attributes of a transaction – even if those details have already been entered in your system.
You can pre-populate some or all attributes required to process a transaction.
For Virtual Terminal transactions, attributes include:
For Funder claims and transactions, common attributes include:
Prepopulating transaction attributes makes for a much simpler user experience, as it removes double keying of information and users are only prompted for additional attributes or corrections as required.
Transaction payload options differ between funders. To simplify your development experience, we’ve created a “PMS Playground” to interactively generate sample transaction payloads. We expose options available for every funder and for Virtual Terminal transactions with the corresponding JSON payload or URL.
Access the Playground via https://playground.medipass.io.
Note: A valid API key and App ID is required. Playground is set to a non-production environment.
A patient refId
is your own unique reference to the patient for matching. Medipass will use the refId
to store patient details.
The first time a transaction is created for a patient, you should send all elements of the patient object.
On subsequent transactions you can send only the refId
and we will prepopulate patient information. However, if you provide other patient attributes (like first name, last name, etc), we will update those against the patient's refId
.
The first time you create a transaction, your patient could look like this:
medipassSDK.renderCreateTransaction({
// ...
patient: {
refId: '0001',
firstName: 'Claudia',
lastName: 'Connor',
dob: '1996-08-20',
},
// ...
});
On subsequent transactions, your patient could look like this:
medipassSDK.renderCreateTransaction({
// ...
patient: {
refId: '0001',
},
// ...
});
However, you can still provide the original patient values, and the patient will be updated only when neccessary (when one of the patient values change).
Callbacks are functions that you can provide to a method in the SDK which will give you feedback when an event occurs.
They can be useful when you want to record data & attributes at a particular stage of a transaction.
You can provide a set of callback events to the second parameter of renderCreateTransaction
.
A list of callbacks provided can be viewed here.
import medipassSDK from '@medipass/partner-sdk';
medipassSDK.renderCreateTransaction(
{
// ... transaction attributes
},
{
onSuccess: function(transaction) {
console.log(transaction);
// -> { _id: '123', created: '2020-06-22T23:18:30.329', items: [...], claims: [...], ... }
},
onError: function(error) {
console.log(error);
// -> { message: 'An error occured.' }
},
onCancel: function() {
console.log('Transaction cancelled.');
},
onCloseModal: function({ transaction, error, status }) {
if (status === 'success') {
console.log(transaction);
// -> { _id: '123', created: '2020-06-22T23:18:30.329', items: [...], claims: [...], ... }
} else if (status === 'error') {
console.log(error);
// -> { message: 'An error occured.' }
} else if (status === 'cancelled') {
console.log('Transaction cancelled.');
}
},
onTransactionCreated: function(transaction) {
console.log('Transaction created', transaction);
},
onTransactionUpdated: function(transaction) {
console.log('Transaction updated', transaction);
},
}
);
Whilst the majority of transactions are processed in real-time with an immediate outcome, some transaction outcomes may be delayed by hours or days. For example, some Medicare transactions may require manual review with an outcome 2-3 days post submission. Likewise, a Virtual Terminal transaction with a patient SMS request may take minutes or hours for action.
You can get transaction updates in two ways:
We recommend using the webhook method.
A list of webhooks provided can be viewed here.
To set a webhook, use the webhooks
attribute and provide:
medipassTransactionSDK.renderCreateTransaction({
// ...
webhooks: [
{
url: 'https://your-site.com/transactions/your-transactionId/success',
event: 'healthFundApprovedInvoice',
method: 'POST',
headers: { sessionKey: 'Hello world' }
},
{
url: 'https://your-site.com/transactions/your-transactionId/failure',
event: 'healthFundRejectedInvoice',
method: 'POST',
headers: { sessionKey: 'Hello world' }
}
]
// ...
})