Accept XRP, RLUSD, and custom XRPL token payments on any website or application. Use our UMD/ESM JavaScript SDK, custom Web Components, or React Hooks.
The client library includes methods for opening checkout sheets, handling popups, and monitoring payment status.
Alternative: Open Checkout in Popup
If you prefer to keep customers on your site, you can launch the checkout session in an overlay popup instead of a redirect.
javascript
// Create session and open checkout in a popup overlay
const session = await xrpay.sessions.create({ amount: 15.00, currency: 'USD' });
xrpay.openPopup({
sessionId: session.id,
onClose: () => console.log('Popup checkout window was closed')
});
Real-Time Status Monitoring
Subscribe to checkout session status changes. The callback triggers automatically when payments are validated on-ledger.
javascript
// Poll status updates and trigger success behaviors
xrpay.sessions.onStatusChange(session.id, (status) => {
if (status.status === 'confirmed') {
alert('Payment successful! Transaction Hash: ' + status.txHash);
window.location.href = '/success';
} else if (status.status === 'expired') {
alert('Payment checkout session expired.');
}
});
Web Components (Elements)
Build responsive, drop-in payment interfaces using framework-agnostic HTML Custom Elements. Includes built-in support for light/dark themes and styling customization.
html
<script src="https://xrpay.it/sdk/xrpay-elements.js"></script>
<!-- Embedded payment buttons -->
<xrpay-button
api-key="pk_test_..."
amount="49.99"
currency="USD"
label="Pay with XRPay"
theme="light">
</xrpay-button>
<!-- Full embedded inline checkout UI with countdown & QR code -->
<xrpay-checkout
api-key="pk_test_..."
amount="150.00"
currency="USD"
settlement-currency="RLUSD">
</xrpay-checkout>
<!-- Mini inline payment status indicator badge -->
<xrpay-status
api-key="pk_test_..."
session-id="cmr2o3ink000ayk43f5rodogr">
</xrpay-status>
Custom Custom-Elements Event Hooks
Web components dispatch custom events during checkout lifecycles so you can capture updates in your local application state.