feat: expose currencyCode on Product struct in IAP module (#25058)
Co-authored-by: Shur Singh <ssingh@evernote.com>
This commit is contained in:
parent
5d3301769b
commit
a17e97c3b2
4 changed files with 15 additions and 0 deletions
|
@ -61,6 +61,9 @@ struct Converter<in_app_purchase::Product> {
|
|||
dict.Set("price", val.price);
|
||||
dict.Set("formattedPrice", val.formattedPrice);
|
||||
|
||||
// Currency Information
|
||||
dict.Set("currencyCode", val.currencyCode);
|
||||
|
||||
// Downloadable Content Information
|
||||
dict.Set("isDownloadable", val.isDownloadable);
|
||||
|
||||
|
|
|
@ -28,6 +28,9 @@ struct Product {
|
|||
double price = 0.0;
|
||||
std::string formattedPrice;
|
||||
|
||||
// Currency Information
|
||||
std::string currencyCode;
|
||||
|
||||
// Downloadable Content Information
|
||||
bool isDownloadable = false;
|
||||
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue