<!-- Include the eSIM Script -->
<script src="https://script.viserlab.com/esim/esim.js"></script>
<link rel="stylesheet" href="https://script.viserlab.com/esim/esim.css">
Initialize the ESIM object after including the script.
Opens the payment modal for eSIM purchase.
ESIM.checkout({
plan: 'Regional 3GB',
price: 12,
currency: 'USD',
onSuccess: function(data) {
// Handle successful purchase
},
onError: function(error) {
// Handle error
}
});
Displays available plans in a modal.
ESIM.showPlans({
region: 'global',
onSelect: function(plan) {
// Handle selected plan
}
});
Called when payment is successfully processed.
function(data) {
// data contains:
// - orderId
// - planName
// - qrCodeUrl
// - activationCode
}
Called when an error occurs during payment.
function(error) {
// error contains:
// - code
// - message
// - details
}