@funnelfox/billing 0.8.0-ffb-550.38 → 0.8.0-ffb-704.41

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
@@ -421,6 +421,8 @@ try {
421
421
  console.log('Error Code:', error.errorCode); // e.g., 'double_purchase'
422
422
  console.log('Error Type:', error.errorType); // e.g., 'api_exception'
423
423
  console.log('Request ID:', error.requestId); // For support
424
+ console.log('Decline Code:', error.declineCode); // e.g., 'INSUFFICIENT_FUNDS', set on failed payments
425
+ console.log('Decline Source:', error.declineCodeSource); // 'primer' | 'stripe' | 'adyen', when the provider reports one
424
426
  console.log('Message:', error.message);
425
427
  } else if (error instanceof PrimerError) {
426
428
  // Primer SDK error
@@ -634,6 +636,8 @@ const paymentMethod = await Billing.initMethod(
634
636
  },
635
637
  onPaymentFail: error => {
636
638
  console.error('Payment failed:', error.message);
639
+ console.log('Decline code:', error.declineCode); // e.g., 'INSUFFICIENT_FUNDS', when the provider reports one
640
+ console.log('Decline source:', error.declineCodeSource); // 'primer' | 'stripe' | 'adyen'
637
641
  },
638
642
  onPaymentCancel: () => {
639
643
  console.log('Payment was cancelled');