Android SDKBOX::IAP wrong Product::priceValue

Method

onProductRequestSuccess

receive full list of iaps, but i have wrong

float Product::priceValue

and good

std::string Product::price

for example, priceValue == -1295.966797(wrong) and price == “2 999,00 ₽”(correct) (₽ - symbol of local currency, nvm if it look like square^^)

Is it only for me? I’m from Russia and i know about only russian google play (or just russian currency).

another problem is i can’t parce “2 999,00 ₽” because space between 2 and 9, as it appears, not a simple space. but maybe this isn’t a problem but just my fault, I write this only to say that I can’t take float price value now =(

Dose this happen on iOS or android?

Android (I’m not sure about IOS, but if I remember right it hadn’t this problem)

upd:
It seemed, that this problem occur when price is big
999 - OK, 2 999 - fail

and another one thing: in log i see SkuDetails and it have field price_amount_micros
for my purchases
price=999 -> price_amount_micros = 999 000 000
price=2999 -> price_amount_micros = 2 999 000 000

may be something with int overflow? but -1295+2 147 != 2999 =(

Ok, let me investigate into this a bit more.

@nite,

In app purchase for android we are getting Price Value as 0 or Garbage Value.
Is that issue fixed?

Am using INR currency.

Thanks in advance
Gurudath

I put in some fix, however it’s hard to test google play with other countries currency, Can you try the nightly build with following command, and let me know if it works for you?

sdkbox update --staging

@nite,

I have taken Update,
Now Price Value is always Zero.

Here is the Log message

 Got sku details: SkuDetails:{"productId":"id","type":"subs","price":"₹ 380.00","price_amount_micros":380000000,"price_currency_code":"INR","title":"Name","description":"Coins"}

When i access Product Detail, Value is:

Product Price PriceValue
id … ₹ 380.00 … 0.000000…

@nite,

Any updates?

Hello,

I didn’t find the exact reason for PriceValue is always Zero. I was getting proper Price with Country code.

Time being i have calculated Price Value through Price
_tPriceVal = this->getPriceValue(id.price);

float getPriceValue(std::string pPriceValue)
{
    for(int _tCount = 0; _tCount < pPriceValue.size(); _tCount++)
    {
        std::string _tNumbers = "0123456789";
        std::string _tSubString = pPriceValue.substr(_tCount, 1);
        if (_tNumbers.find(_tSubString) != std::string::npos) {
            
            return StringToNumber<float>(pPriceValue.substr(_tCount));
        }
        
    }
    return 0;
}

Regards,
Gurudath

I believe I has fixed this issue. You can test tomorrow.

@yinjimmy

So i can take updated code from sdkbox update and can test?

sdkbox update --staging

yes, but tomorrow.

@yinjimmy
Okay. Thank you.

You can try update it now.

Hello @nite, @yinjimmy,

I have taken update and i tried it.

In log message after fetching produce detail,
GooglePlay Request result : 0 msg : Product request successful. data :[{“id”:“coins”,“title”:" Coins ()",“desc”:" Coins",“price”:“₹ 380.00”,“currencyCode”:“INR”,“priceValue”:380}

But while fetching

std::vector<sdkbox::Product> _tDetails = sdkbox::IAP::getProducts();
     for (sdkbox::Product _tProduct : _tDetails)
     {
         log("............. Product Value %f",_tProduct.priceValue);
         log("............. Product  %s",_tProduct.price.c_str());
        
     }

_tProduct.priceValue will be either -0.0000 or 1280.000000. (Some garbage Value)

:scream: :beetle::beetle::beetle::beetle::beetle:

It’s 2.2.4.3 version ?

I have Taken Update today morning.
But still i have Sdk Version as showing

#define SDKBOX_VERSION_STR “sdkbox V2.2.3.5”

It’s stable release version. Please use sdkbox update --staging command to get nightly build.

It should get some log:

$ sdkbox update --staging
  _______ ______  _     _ ______   _____  _     _
  |______ |     \ |____/  |_____] |     |  \___/
  ______| |_____/ |    \_ |_____] |_____| _/   \_
 Copyright (c) 2015 SDKBOX Inc. v1.0.0.13
  _                          _
 |o|  o ,      o_,'   o_,   |o|
 |O| <%'.   _`'_ ===  <\_   |O|
 (0) /  |  (_)`-' |    / |  (0)
 p----------------------------g
 downloading package sdkbox-googleplayservices_v2.2.4.3.tar.gz
[###################################] 100%
 2.2.4.3 2.2.0.13
 updating googleplayservices v2.2.0.13 -> v2.2.4.3
 Installation Successful :)
 downloading package sdkbox-iap_v2.2.4.3.tar.gz

Can you update to night build, and help to test ? @Gurudath

sdkbox update --staging

Hi @yinjimmy, @nite

I have updated sdkbox.

updating googleplayservices v2.2.3.5 -> v2.2.4.3
updating iap v2.2.3.5 -> v2.2.4.3
updated 2 packages.

Am getting correct value. Price and Price Value are correct.

Thank You. :smile: