payment-gateway-webhook-package
v1.0.0
Published
A simple Node.js client to interact with the Webhook Testing Platform API — easily create and retrieve test webhook sessions.
Maintainers
Readme
payment-gateway-webhook-package
A simple Node.js client to interact with the Webhook Testing Platform API — easily create and retrieve test webhook sessions.
⚙️ Installation
npm install payment-gateway-webhook-package💡 Usage
const { createWebhook, getWebhookEvents } = require('payment-gateway-webhook-package');
(async () => {
const { webhookUrl, webhookId } = await createWebhook('test-user-123');
console.log('Webhook URL:', webhookUrl);
const events = await getWebhookEvents(webhookId);
console.log('Received Events:', events);
})();🧩 Methods
- createWebhook(userId): Creates a session and returns webhook URL
- getWebhookEvents(webhookId): Retrieves all stored payloads for that webhook
🧱 Configuration
Set the base URL (if self-hosted):
export WEBHOOK_API_BASE="https://api.yourdomain.dev"Defaults to the public API URL or http://localhost:xxxx/api.
📌📌 But note: that you actually will not need any baseURL config if its not selfHosted
🧰 Requirements
- Node.js 18+
- Internet access for public API calls
🪙 License
MIT, ISC
