purchaseIos method
Future<LinkFiveActiveProducts>
purchaseIos({
- required AppStoreProductDetails? productDetails,
- required AppStorePurchaseDetails purchaseDetails,
override
after a purchase on ios we call the purchases/apple We don't need to do this on Android
Implementation
@override
Future<LinkFiveActiveProducts> purchaseIos({
required AppStoreProductDetails? productDetails,
required AppStorePurchaseDetails purchaseDetails,
}) async {
final uri = _makeUri("api/v1/purchases/user/apple");
final transaction = purchaseDetails.skPaymentTransaction;
final transactionId = transaction.transactionIdentifier ?? "";
final body = {
"currency": productDetails?.currencyCode,
"price": productDetails?.rawPrice,
"transactionId": transactionId,
"originalTransactionId": transaction.originalTransaction?.transactionIdentifier ?? transactionId
};
LinkFiveLogger.d("purchase. $body");
final response = await httpClient.post(uri, body: body, headers: await _headers);
return _parseOneTimePurchaseListResponse(response);
}