SDK Methods
The BoomPay SDK provides various methods that let you interact with the BoomPay API.
Create a Wallet
Wallets are now created on the Boom App. You can download it here. Once created this will be the wallet which is tied to your API Key hence you won't need to specify the wallet address on API requests.
Create a Payment Intent
Create a new payment intent by specifying the wallet address, amount, currency, URLs for success and failure scenarios, additional metadata, and a label:
const payment = await boomPay.payments.createIntent({
amount: 5,
successUrl: 'https://your-success-url.com',
failureUrl: 'https://your-failure-url.com',
metadata: {
anyKey: 'anyValue',
},
label: 'Payment Label',
});
Retrieve a Payment
Retrieve details of a specific payment using its ID:
const payment = await boomPay.payments.getPayment("payment-id");
Retrieve the Default Wallet
Retrieve details of the default wallet:
const defaultWallet = await boomPay.wallets.getDefaultWallet();