据我所知,实际支付的金额不包括在收据中(密钥列于 here
).
但是,价格包含在SKProduct对象中,产品标识符在收据中可用,因此您可以在发送收据时将所有价格发送到服务器,并使用收据中的产品标识符来获取相应的价格.
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
NSMutableDictionary *prices = [NSMutableDictionary dictionary];
for (SKProduct *product in [response products]) {
NSString *productIdentifier = [product productIdentifier];
NSDecimalNumber *price = [product price];
NSLocale *priceLocale = [product priceLocale];
prices[productIdentifier] = @[price, priceLocale];
}
// keep these in memory and send them with the receipt
}