Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/trial support #104

Merged
merged 4 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading