paybridge 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -230,10 +230,12 @@ class SoftyCompProvider extends base_1.PaymentProvider {
230
230
  // ==================== Webhooks ====================
231
231
  parseWebhook(body, _headers) {
232
232
  const event = typeof body === 'string' ? JSON.parse(body) : body;
233
- // activityTypeID mapping: 1=Pending, 2=Successful, 3=Failed, 4=Cancelled
233
+ // Handle both field names: activityTypeID (docs) and WebhookTypeID (observed)
234
+ // Mapping: 1=Pending, 2=Successful, 3=Failed, 4=Cancelled
235
+ const typeId = event.activityTypeID || event.WebhookTypeID || 1;
234
236
  let eventType = 'payment.pending';
235
237
  let status = 'pending';
236
- switch (event.activityTypeID) {
238
+ switch (typeId) {
237
239
  case 2:
238
240
  eventType = 'payment.completed';
239
241
  status = 'completed';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paybridge",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "One API, every payment provider. Unified payment SDK for Node.js — SoftyComp, Yoco, Ozow, and more.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",