BoxPay Payment SDK Example /* Style for the container holding the iframe */ body { margin: 0; padding: 0; } #boxpay-checkout { /* your style goes here */ }
// This function is called when the payment is completed function handlePaymentResponse(data) { console.log(‘Payment completed!’, data); // Merchant logic to handle payment response can be added here } // This function is called when the user navigates away from the checkout page function handlePaymentCancellation() { console.log(‘Payment Cancelled!’); // Merchant logic to handle payment cancellation can be added here } // Initialize and open the BoxPayCheckout iframe with the provided token and callbacks // `handlePaymentResponse` will handle successful payments or errors // `handlePaymentCancellation` will handle the case where the user cancels the payment BoxPayCheckout.open(‘https://test-checkout.boxpay.tech?token=’ + new URLSearchParams(window.location.search).get(‘token’), handlePaymentResponse, handlePaymentCancellation);
Scroll to Top