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

added originalPurchaseDate to the purchaserInfoWrapper #66

Merged
merged 1 commit into from
Jun 16, 2020
Merged
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
10 changes: 8 additions & 2 deletions lib/purchaser_info_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class PurchaserInfo {
/// Date when this info was requested
final String requestDate;

/// Returns the purchase date for the version of the application when the user bought the app.
/// Use this for grandfathering users when migrating to subscriptions.
final String originalPurchaseDate;

/// Returns the version number for the version of the application when the
/// user bought the app. Use this for grandfathering users when migrating
/// to subscriptions.
Expand Down Expand Up @@ -56,7 +60,8 @@ class PurchaserInfo {
requestDate = map["requestDate"],
allPurchaseDates = (map["allPurchaseDates"] as Map<dynamic, dynamic>)
.map((key, value) => MapEntry(key as String, value as String)),
originalApplicationVersion = map["originalApplicationVersion"];
originalApplicationVersion = map["originalApplicationVersion"],
originalPurchaseDate = map["originalPurchaseDate"];

@override
String toString() {
Expand All @@ -70,6 +75,7 @@ class PurchaserInfo {
'firstSeen: $firstSeen, '
'originalAppUserId: $originalAppUserId, '
'requestDate: $requestDate, '
'originalApplicationVersion: $originalApplicationVersion}';
'originalApplicationVersion: $originalApplicationVersion, '
'originalPurchaseDate: $originalPurchaseDate}';
}
}