feat: expose currencyCode on Product struct in IAP module (#25084)

Co-authored-by: Shur Singh <ssingh@evernote.com>
This commit is contained in:
trop[bot]
2020-08-26 16:18:09 -07:00
committed by GitHub
parent 4df5ecdf82
commit 0b834877fe
4 changed files with 15 additions and 0 deletions

View File

@@ -28,6 +28,9 @@ struct Product {
double price = 0.0;
std::string formattedPrice;
// Currency Information
std::string currencyCode;
// Downloadable Content Information
bool isDownloadable = false;

View File

@@ -146,6 +146,14 @@
productStruct.formattedPrice =
[[self formatPrice:product.price
withLocal:product.priceLocale] UTF8String];
// Currency Information
if (@available(macOS 10.12, *)) {
if (product.priceLocale.currencyCode != nil) {
productStruct.currencyCode =
[product.priceLocale.currencyCode UTF8String];
}
}
}
}