CheckoutMerchant.fromJson constructor

CheckoutMerchant.fromJson(
  1. Map<Object?, Object?> value
)

Parses and validates a merchant identity from the native bridge.

Implementation

factory CheckoutMerchant.fromJson(Map<Object?, Object?> value) {
  _expectFields(value, const {'displayName'});
  final displayName = value['displayName'];
  if (displayName is! String || displayName.isEmpty) {
    throw const FormatException('Invalid Checkout merchant');
  }
  return CheckoutMerchant(displayName: displayName);
}