fromJson static method

NativePayData fromJson(
  1. dynamic data
)

Implementation

static NativePayData fromJson(dynamic data) {
  var json = DynamicJsonExtension.getJsonMap(data);
  switch (json['type']) {
    case 'apple_pay':
      return ApplePayData.fromJson(json);
    case 'google_pay':
      return GooglePayData.fromJson(json);
    default:
      throw Exception("Unsupported NativePayData type: ${json['type']}");
  }
}