transactionWithReceipt method
void
transactionWithReceipt({})
Implementation
void transactionWithReceipt({
required String productId,
required String currencyCode,
required double unitPrice,
required int quantity,
String? androidPurchaseData,
String? androidDataSignature,
String? iosReceipt,
String? iosTransactionId,
}) {
bool isValidIOS =
Platform.isIOS && iosReceipt != null && iosTransactionId != null;
bool isValidAndroid = Platform.isAndroid &&
androidPurchaseData != null &&
androidDataSignature != null;
if (isValidIOS || isValidAndroid) {
_channel.invokeMethod('transactionWithReceipt', {
'productId': productId,
'purchaseData': androidPurchaseData,
'dataSignature': androidDataSignature,
'currencyCode': currencyCode,
'unitPrice': unitPrice,
'quantity': quantity,
'receipt': iosReceipt,
'transactionId': iosTransactionId,
});
} else {
print('TenjinSDK.instance transaction is missing data');
}
}