plz try our js sample https://github.com/sdkbox/sdkbox-sample-iap/tree/master/js
and be sure run your app in release mode.
cocos run -p android -m release
mitopandoras:
priceValue
should use this patch:
diff --git a/js/frameworks/runtime-src/Classes/PluginIAPJSHelper.cpp b/js/frameworks/runtime-src/Classes/PluginIAPJSHelper.cpp
index 1a03bc7..1cb9486 100644
--- a/js/frameworks/runtime-src/Classes/PluginIAPJSHelper.cpp
+++ b/js/frameworks/runtime-src/Classes/PluginIAPJSHelper.cpp
@@ -19,6 +19,7 @@ void product_to_obj(JSContext* cx, const sdkbox::Product& p, JS::MutableHandleOb
JS::RootedValue title(cx);
JS::RootedValue description(cx);
JS::RootedValue price(cx);
+ JS::RootedValue priceValue(cx);
JS::RootedValue currencyCode(cx);
JS::RootedValue receipt(cx);
JS::RootedValue receiptCipheredPayload(cx);
@@ -35,6 +36,8 @@ void product_to_obj(JSContext* cx, const sdkbox::Product& p, JS::MutableHandleOb
JS_SetProperty(cx, jsobj, "description", description);
price = SB_STR_TO_JSVAL(cx, p.price);
JS_SetProperty(cx, jsobj, "price", price);
+ priceValue = JS::DoubleValue(p.priceValue);
+ JS_SetProperty(cx, jsobj, "priceValue", priceValue);
currencyCode = SB_STR_TO_JSVAL(cx, p.currencyCode);
JS_SetProperty(cx, jsobj, "currencyCode", currencyCode);
receipt = SB_STR_TO_JSVAL(cx, p.receipt);
@@ -52,6 +55,7 @@ void product_to_obj(JSContext* cx, const sdkbox::Product& p, JS::MutableHandleOb
JS::RootedValue title(cx);
JS::RootedValue description(cx);
JS::RootedValue price(cx);
+ JS::RootedValue priceValue(cx);
JS::RootedValue currencyCode(cx);
JS::RootedValue receipt(cx);
JS::RootedValue receiptCipheredPayload(cx);
@@ -68,6 +72,8 @@ void product_to_obj(JSContext* cx, const sdkbox::Product& p, JS::MutableHandleOb
JS_SetProperty(cx, jsobj, "description", description);
price = SB_STR_TO_JSVAL(cx, p.price);
JS_SetProperty(cx, jsobj, "price", price);
+ priceValue = JS::DoubleValue(p.priceValue);
+ JS_SetProperty(cx, jsobj, "priceValue", priceValue);
currencyCode = SB_STR_TO_JSVAL(cx, p.currencyCode);
JS_SetProperty(cx, jsobj, "currencyCode", currencyCode);
receipt = SB_STR_TO_JSVAL(cx, p.receipt);
@@ -85,6 +91,7 @@ void product_to_obj(JSContext* cx, const sdkbox::Product& p, JS::MutableHandleOb
jsval title;
jsval description;
jsval price;
+ jsval priceValue;
jsval currencyCode;
jsval receipt;
jsval receiptCipheredPayload;
@@ -101,6 +108,8 @@ void product_to_obj(JSContext* cx, const sdkbox::Product& p, JS::MutableHandleOb
JS_SetProperty(cx, jsobj, "description", &description);
price = SB_STR_TO_JSVAL(cx, p.price);
JS_SetProperty(cx, jsobj, "price", &price);
+ priceValue = JS::DoubleValue(p.priceValue);
+ JS_SetProperty(cx, jsobj, "priceValue", priceValue);
currencyCode = SB_STR_TO_JSVAL(cx, p.currencyCode);
JS_SetProperty(cx, jsobj, "currencyCode", ¤cyCode);
receipt = SB_STR_TO_JSVAL(cx, p.receipt);
some issue : 2.99 (c++) ----> 2.990000000088123