diff --git a/CHANGELOG.md b/CHANGELOG.md index 75b459c..cc18ae5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.0-beta.8 +Chore +* Trial support for retrieve Subscription + ## 1.0.0-beta.7 Chore * UTF8 support diff --git a/README.md b/README.md index b7145cc..952ac5b 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ To use Chargebee SDK in your Flutter app, follow these steps: ``` dart dependencies: - chargebee_flutter: ^1.0.0-beta.7 + chargebee_flutter: ^1.0.0-beta.8 ``` 2. Install dependency. diff --git a/android/build.gradle b/android/build.gradle index 926d49c..1cd9a60 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ group 'com.chargebee.flutter.sdk' -version '1.0.0-beta.7' +version '1.0.0-beta.8' buildscript { ext.kotlin_version = '1.6.0' diff --git a/ios/chargebee_flutter.podspec b/ios/chargebee_flutter.podspec index 783d5e2..f347a42 100644 --- a/ios/chargebee_flutter.podspec +++ b/ios/chargebee_flutter.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'chargebee_flutter' - s.version = '1.0.0-beta.7' + s.version = '1.0.0-beta.8' s.summary = 'This is the official Software Development Kit (SDK) for Chargebee Flutter.' s.description = <<-DESC A new Flutter plugin. diff --git a/lib/src/models/product.dart b/lib/src/models/product.dart index 3148993..d57d2bf 100644 --- a/lib/src/models/product.dart +++ b/lib/src/models/product.dart @@ -198,21 +198,22 @@ class Subscripton { subscriptionId = json['subscription_id'] as String; customerId = json['customer_id'] as String; status = json['status'] as String; - activatedAt = json['activated_at'] as int; - currentTermStart = json['current_term_start'] as int; - currentTermEnd = json['current_term_end'] as int; - planAmount = json['plan_amount'].toString(); + activatedAt = json.containsKey('activated_at') ? json['activated_at'] as int : null; + currentTermStart = json.containsKey('current_term_start') ? json['current_term_start'] as int: null; + currentTermEnd = json.containsKey('current_term_end') ? json['current_term_end'] as int: null; + planAmount = json.containsKey('plan_amount') ? json['plan_amount'].toString() : null; + /// Defaults to null if key not present /// Plan amount sometime we are getting double value sometime Int } /// convert json data into Subscripton model for Android Subscripton.fromJsonAndroid(Map json) { - activatedAtString = json['activated_at'].toString(); - currentTermEndString = json['current_term_end'].toString(); - currentTermStartString = json['current_term_start'].toString(); + activatedAtString = json.containsKey('activated_at') ? json['activated_at'].toString(): null; + currentTermEndString = json.containsKey('current_term_end') ? json['current_term_end'].toString(): null; + currentTermStartString = json.containsKey('current_term_start') ? json['current_term_start'].toString(): null; customerId = json['customer_id'] as String; - planAmount = json['plan_amount'].toString(); + planAmount = json.containsKey('plan_amount') ? json['plan_amount'].toString(): null; status = json['status'] as String; subscriptionId = json['subscription_id'] as String; } diff --git a/pubspec.yaml b/pubspec.yaml index 583f01e..d09a0d3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: chargebee_flutter description: This is the official Software Development Kit (SDK) for Chargebee Flutter. -version: 1.0.0-beta.7 +version: 1.0.0-beta.8 homepage: 'https://chargebee.com' repository: 'https://github.com/chargebee/chargebee-flutter'