@fundly.ai/payment-sdk 1.5.0-beta.0 → 1.5.0-beta.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.
package/README.md CHANGED
@@ -595,51 +595,38 @@ The SDK automatically tracks payment events using CleverTap analytics. **No manu
595
595
 
596
596
  When the SDK mounts, it automatically initializes analytics with the appropriate environment settings based on the `environment` parameter in your `PaymentConfig`.
597
597
 
598
- ### Tracked Events
598
+ ### Tracked Events (v2)
599
599
 
600
- The SDK automatically tracks these payment lifecycle events:
600
+ The SDK tracks exactly two events in the payment lifecycle:
601
601
 
602
- 1. **Payment_Initiated** - When any payment is started
603
- 2. **Payment_Link_Generated** - When a payment link is created
604
- 3. **Payment_QR_Generated** - When a dynamic QR code is created
605
- 4. **Payment_Success** - When payment is successfully completed
606
- 5. **Payment_Failed** - When payment fails
602
+ #### 1. `Payment_SDK_Launched`
603
+ Fires when the payment options screen fully loads.
607
604
 
608
- Each event includes:
609
- - Payment mode (CASH, CHEQUE, STATIC_QR, DYNAMIC_QR, PAYMENT_LINK)
610
- - Amount and invoice count
611
- - Salesman information (if provided)
612
- - Transaction ID and timestamp
613
- - Additional mode-specific data
605
+ Key fields included:
606
+ - `invoice_count`, `payment_amount`, `payment_type`, `partial_payment`
607
+ - `supplier_id`, `supplier_name`, `user_type`, `user_uuid`
608
+ - `session_id`, `platform`, `sdk_version`, `sdk_entry_point`
609
+ - `is_payment_enabled`, `status`
610
+ - All 9 `payment_option_*` availability booleans
611
+ - `scan_channel`, `scan_origin`, `salesman_name`
612
+ - Carry-forward fields from upstream: `view_id`, `scan_id`, `bill_id`, `bill_type`, `bill_status`, `bill_total_amount`, `outstanding_amount`, `notification_id`, `notification_channel` (null for non-QR/non-notification flows)
614
613
 
615
- ### Custom Analytics Provider (Optional)
614
+ #### 2. `Payment_Initiated`
615
+ Fires when the user selects a payment method and proceeds.
616
616
 
617
- If you want to use a different analytics provider or disable CleverTap:
617
+ Key fields included:
618
+ - `fundly_transaction_id`, `invoice_count`, `partial_payment`
619
+ - `payment_amount`, `payment_type`, `payment_method`, `payment_mode`
620
+ - `payment_channel`, `payment_gateway`, `otp_required`, `retry_count`
621
+ - `supplier_id`, `supplier_name`, `user_type`, `user_uuid`
622
+ - `session_id`, `platform`, `mobile_changed`
623
+ - FUNDLY_PAY loan fields where applicable
618
624
 
619
- ```typescript
620
- import { analyticsService, IAnalyticsProvider } from '@fundly.ai/payment-sdk';
621
-
622
- // Disable analytics
623
- analyticsService.configure({
624
- enabled: false
625
- });
625
+ > **Note:** `Payment_Transaction` is **not** fired by the SDK. It is owned by the backend.
626
626
 
627
- // Or use your custom provider
628
- class MyAnalyticsProvider implements IAnalyticsProvider {
629
- trackPaymentInitiated(data) { /* your implementation */ }
630
- trackPaymentLinkGenerated(data) { /* your implementation */ }
631
- trackPaymentQRGenerated(data) { /* your implementation */ }
632
- trackPaymentSuccess(data) { /* your implementation */ }
633
- trackPaymentFailed(data) { /* your implementation */ }
634
- }
635
-
636
- analyticsService.configure({
637
- enabled: true,
638
- provider: new MyAnalyticsProvider()
639
- });
640
- ```
627
+ ### Analytics Failures
641
628
 
642
- **Note:** Custom configuration should be done before rendering the `PaymentOptionPage` component.
629
+ All analytics calls are wrapped in try/catch. A tracking failure will never block or interrupt the payment flow.
643
630
 
644
631
  ---
645
632
 
@@ -1 +1 @@
1
- {"version":3,"file":"fundlyPayDrawer.d.ts","sourceRoot":"","sources":["../../src/components/fundlyPayDrawer.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,6CAA6C,CAAC;AACrD,OAAO,uDAAuD,CAAC;AAY/D,UAAU,oBAAoB;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAA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