PlatformPaymentException.insufficientFunds constructor

PlatformPaymentException.insufficientFunds({
  1. required PlatformPaymentType type,
  2. String? transactionId,
  3. double? amount,
  4. String? currency,
  5. Object? cause,
  6. StackTrace? stack,
  7. Map<String, dynamic> metadata = const {},
})

Convenience constructor for insufficient funds errors.

Implementation

factory PlatformPaymentException.insufficientFunds({
  required PlatformPaymentType type,
  String? transactionId,
  double? amount,
  String? currency,
  Object? cause,
  StackTrace? stack,
  Map<String, dynamic> metadata = const {},
}) {
  return PlatformPaymentException(
    type: type,
    errorCode: 'insufficient_funds',
    userMessage: 'Insufficient funds to complete the payment.',
    devMessage: 'Insufficient funds for ${type.displayName} payment.',
    transactionId: transactionId,
    amount: amount,
    currency: currency,
    cause: cause,
    stack: stack,
    metadata: metadata,
  );
}