fromJson static method
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']}");
}
}