PlatformPaymentException.authenticationFailed constructor
PlatformPaymentException.authenticationFailed({
- required PlatformPaymentType type,
- String? transactionId,
- String? details,
- Object? cause,
- StackTrace? stack,
- Map<
String, dynamic> metadata = const {},
Convenience constructor for payment authentication failures.
Implementation
factory PlatformPaymentException.authenticationFailed({
required PlatformPaymentType type,
String? transactionId,
String? details,
Object? cause,
StackTrace? stack,
Map<String, dynamic> metadata = const {},
}) {
return PlatformPaymentException(
type: type,
errorCode: 'authentication_failed',
userMessage: 'Payment authentication failed.',
devMessage:
'${type.displayName} authentication failed${details != null ? ': $details' : ''}.',
transactionId: transactionId,
cause: cause,
stack: stack,
metadata: {
if (details != null) 'authDetails': details,
...metadata,
},
);
}