CheckoutMerchant.fromJson constructor
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);
}