question

basse avatar image
basse asked

Converting IAP prices to minor unit,Converting IAP prices for receipt validation

When validating an IAP receipt (eg on iOS) ValidateIOSReceipt in the client API expects an integer in the smallest currency unit (eg 199), whereas the price returned with the receipt is a decimal number (eg $1.99). So it appears we need to perform a conversion to the minor currency unit. For most currencies this is simply a multiplication by 100, but some currencies have other ratios or no minor unit.

Do you have any best practices or suggestions on how to manage this? Handling the conversion for each currency (the exceptions) on the client side is of course a possibility. But this is probably something others have run into as well?

Cheers,

Sebastian

,
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

To date, what we have seen in receipt validation reporting for titles is that the value presented to titles via most plugins is 100* the major value of the currency in question - even for currencies that do not have a minor value, such as JPY. Now that said, it's entirely possible that you're using a plugin that does some conversion, which could complicate matters. But at a base, if you pass in the 100* value as-is, that should report the correct currency amount in our service.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.