
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@medipass/checkout-sdk
Advanced tools
The Medipass Checkout SDK is a client-side JavaScript library which allows you to interact with Medipass from your web interface.
yarn add @medipass/checkout-sdk
or NPM:
npm install @medipass/checkout-sdk
A payment request URL is passed to the createCheckout function, which opens a secure pop-up window to Medipass to take the payment.
import medipassCheckoutSDK from '@medipass/checkout-sdk';
// or: const medipassCheckoutSDK = require('@medipass/checkout-sdk');
medipassCheckoutSDK.init({
env: 'stg',
onSuccess: ({ transactionId }) => {
// handle success
},
onFailure: ({ transactionId }) => {
// handle failure
},
onCancel: ({ transactionId }) => {
// handle cancel
},
onClose: () => {
// handle close
}
});
const paymentRequestUrl = getPaymentRequestUrl();
await medipassCheckoutSDK.createCheckout({
paymentRequestUrl // the paymentRequestUrl returned after creating a Medipass invoice
});
<script>
tag<html>
<head>
<script src="https://unpkg.com/@medipass/checkout-sdk/umd/@medipass/checkout-sdk.min.js"></script>
</head>
<body>
<script>
medipassCheckoutSDK.init({
env: 'stg',
onSuccess: ({ transactionId }) => {
// handle success
},
onFailure: ({ transactionId }) => {
// handle failure
},
onCancel: ({ transactionId }) => {
// handle cancel
},
onClose: () => {
// handle close
}
});
const paymentRequestUrl = getPaymentRequestUrl();
medipassCheckoutSDK.createCheckout({
paymentRequestUrl // the paymentRequestUrl returned after creating a Medipass invoice
});
</script>
</body>
</html>
You can update a patient's payment details using the requestUpdatePaymentDetails function.
import medipassCheckoutSDK from '@medipass/checkout-sdk';
// or: const medipassCheckoutSDK = require('@medipass/checkout-sdk');
await medipassCheckoutSDK.requestUpdatePaymentDetails({
apiKey, // apiKey | undefined
token, // token | undefined
patientRefId, // patientRefId
env, // 'stg' | 'prod'
onSuccess, // Invoked when the payment method update has been successful
onFailure, // Invoked when the payment method update has failed
onCancel, // Invoked when the payment method update has been rejected
onClose, // Invoked when the pop-up window has been closed by the user
callbackOrigin // The origin of the window invoking the checkout SDK
});
<script>
tag<html>
<head>
<script src="https://unpkg.com/@medipass/checkout-sdk/umd/@medipass/checkout-sdk.min.js"></script>
</head>
<body>
<script>
medipassCheckoutSDK.requestUpdatePaymentDetails({
apiKey, // apiKey | undefined
token, // token | undefined
patientRefId, // patientRefId
env, // 'stg' | 'prod'
onSuccess, // Invoked when the payment method update has been successful
onFailure, // Invoked when the payment method update has failed
onCancel, // Invoked when the payment method update has been rejected
onClose, // Invoked when the pop-up window has been closed by the user
callbackOrigin // The origin of the window invoking the checkout SDK
});
</script>
</body>
</html>
Take note of the following:
Object
| required
{
env: 'stg' | 'prod',
onSuccess: function({ transactionId }) {}, // Invoked when the payment has been successful
onFailure: function({ transactionId }) {}, // Invoked when the payment has failed
onCancel: function({ transactionId }) {}, // Invoked when the payment has been rejected
onClose: function() {} // Invoked when the pop-up window has been closed by the user before approving or rejecting the payment
}
Object
| required
{
paymentRequestUrl: string,
}
FAQs
Medipass Checkout SDK
The npm package @medipass/checkout-sdk receives a total of 18 weekly downloads. As such, @medipass/checkout-sdk popularity was classified as not popular.
We found that @medipass/checkout-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.