@beampay/checkout
v2.0.1
Published
Framework-agnostic embeddable checkout widget for BeamPay
Downloads
233
Readme
@beampay/checkout
Framework-agnostic embeddable payment widget for BeamPay.
CDN usage
<script src="https://cdn.beampay.fun/checkout/v1.js" defer></script>
<button id="pay"></button>
<script>
BeamPay.init({
apiUrl: 'https://api.beampay.fun',
chain: 'bsc',
merchant: '0x...',
token: '0x55d398326f99059fF775485246999027B3197955',
amount: '100000000',
onSuccess: (order) => console.log('paid', order),
onError: (err) => console.error(err),
}).mount('#pay')
</script>npm usage
import { BeamPayCheckout } from '@beampay/checkout'
const checkout = new BeamPayCheckout({ ... })
checkout.mount(document.querySelector('#pay'))Theming
Checkout elements ship with readable light defaults and can be themed with CSS custom properties:
beam-pay-modal,
beam-pay-button {
--bp-checkout-surface: #ffffff;
--bp-checkout-text: #0f172a;
--bp-checkout-text-muted: #475569;
--bp-checkout-primary: #00d4ff;
--bp-checkout-primary-hover: #00b8e6;
}