question

ilyas avatar image
ilyas asked

Problem with real money purchase event

Usd purchase events show wrong value.

Our implementation for android

var googleReceipt = GooglePurchase.FromJson(product.receipt);ValidateGooglePlayPurchaseRequest request = new ValidateGooglePlayPurchaseRequest();
request.CurrencyCode = product.metadata.isoCurrencyCode;
request.PurchasePrice = (uint)(product.metadata.localizedPrice * 100);
request.ReceiptJson = googleReceipt.PayloadData.json;
request.Signature = googleReceipt.PayloadData.signature;
PlayFabClientAPI.ValidateGooglePlayPurchase(request, result =>
    {
        Debug.Log("Validation successful!");

For iOS

var receipt = PurchaseReceipts.FromJson(product.receipt);

PlayFabClientAPI.ValidateIOSReceipt(new ValidateIOSReceiptRequest()
{
    // Pass in currency code in ISO format
    CurrencyCode = product.metadata.isoCurrencyCode,
    // Convert and set Purchase price
    PurchasePrice = (int)(product.metadata.localizedPrice * 100),
    // Pass in payload
    ReceiptData = receipt.Payload
}, result =>
    {
        Debug.Log("Validation successful!");

Results.

Only USD values are wrong usd values have to 100x more. Any help would be greatly appreciated.

PlayStream
qwe.png (501.3 KiB)
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

·
Sarah Zhang avatar image
Sarah Zhang answered

Currently, we lack a testing environment, could you please provide the log of "PurchasePrice" for a reference? In addition, you can try to follow this thread, modify the implementation for android like the following one, and test again.

if(product.metadata.isoCurrencyCode=="USD"){}
else{request.PurchasePrice=(uint)(product.metadata.localizedPrice *100);
}
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.