Providers status example

Retrieve the business' providers and their status. Optionally include a provider number as a query param to filter the results and retrieve only a single provider.

by joshpiper_medipass

HTML

<script src="https://unpkg.com/@medipass/partner-sdk/umd/@medipass/partner-sdk.min.js"></script>
<div id="providers">
  gh
</div>

JavaScript

// import MedipassTransactionSDK from '@medipass/partner-sdk';
// const MedipassTransactionSDK = require('@medipass/partner-sdk');


/**
 * Retrieve a business' provider by provider number.
 *
 * Example response:
 * {
 *   "providers": [
 *     {
 *         "providerNumber": "1234567A",
 *         "funders": [
 *             {
 *                 "displayName": "Example 1",
 *                 "code": "exmpl1"
 *             }
 *         ]
 *     }
 *   ]
 * }   
 */
async function main() {
	console.log("MedipassTransactionSDK", MedipassTransactionSDK)
/*   await MedipassTransactionSDK.setConfig({
    env: 'stg', // Enter the environment you want to target (stg/prod)
    apiKey: 'xyz', // Can be found in your business settings in Connect
    appId: 'my-app', // Your application identifier
    appVersion: 'v1.0.0' // The transaction SDK version to target 
  });
  
  // Provider number must be supplied
  const providerNumber = '1234567A';
  
  const { providers } = await MedipassTransactionSDK.providers.getProvidersStatus({
    query: {
      providerNumber
    }
  });
  
  document.getElementById('providers').textContent = JSON.stringify(providers); */
}

main();