Skip to content

Commit

Permalink
Merge pull request #104 from chargebee/feat/trial-support
Browse files Browse the repository at this point in the history
Feat/trial support
  • Loading branch information
cb-palanim authored Sep 19, 2024
2 parents ca6c816 + 8e9d2df commit b0f33cc
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.0-beta.8
Chore
* Trial support for retrieve Subscription

## 1.0.0-beta.7
Chore
* UTF8 support
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion ios/chargebee_flutter.podspec
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
17 changes: 9 additions & 8 deletions lib/src/models/product.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, dynamic> 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;
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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'

Expand Down

0 comments on commit b0f33cc

Please sign in to comment.