Skip to content
Draft

init #12296

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
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.4.12

* Exposes the underlying `SK2Transaction` object on `SK2PurchaseDetails` (via a new `sk2Transaction` property) to enable checking of native properties like `originalId` and `expirationDate`.

## 0.4.11

* Fixes StoreKit 2 date format does not match in_app_purchase_platform_interface PurchaseDetails.transactionDate format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ extension on SK2TransactionMessage {
SK2PurchaseStatusMessage.restored => PurchaseStatus.restored,
};

final SK2Transaction sk2Transaction = convertFromPigeon();
return SK2PurchaseDetails(
productID: productId,
// in SK2, as per Apple
Expand All @@ -162,6 +163,7 @@ extension on SK2TransactionMessage {
status: purchaseStatus,
purchaseID: id > 0 ? id.toString() : null,
appAccountToken: appAccountToken,
sk2Transaction: sk2Transaction,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart';

import '../../in_app_purchase_storekit.dart';
import '../../store_kit_2_wrappers.dart';
import '../../store_kit_wrappers.dart';
import '../store_kit_wrappers/enum_converters.dart';

Expand Down Expand Up @@ -92,12 +93,16 @@ class SK2PurchaseDetails extends PurchaseDetails {
required super.transactionDate,
required super.status,
this.appAccountToken,
this.sk2Transaction,
});

/// A UUID that associates the transaction with a user on your own service.
/// This is the value set when making the purchase via appAccountToken option.
final String? appAccountToken;

/// The underlying StoreKit 2 transaction.
final SK2Transaction? sk2Transaction;

@override
bool get pendingCompletePurchase => status == PurchaseStatus.purchased;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: in_app_purchase_storekit
description: An implementation for the iOS and macOS platforms of the Flutter `in_app_purchase` plugin. This uses the StoreKit Framework.
repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_storekit
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 0.4.11
version: 0.4.12

environment:
sdk: ^3.10.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ void main() {
expect(result.first.verificationData.serverVerificationData, 'receiptData');
expect(result.first.verificationData.localVerificationData, 'jsonRepresentation');
expect((result.first as SK2PurchaseDetails).appAccountToken, 'appAccountToken');
expect((result.first as SK2PurchaseDetails).sk2Transaction, isNotNull);
expect((result.first as SK2PurchaseDetails).sk2Transaction!.originalId, '2');
},
);

Expand Down
Loading