j3k0 / cordova-plugin-purchase

In-App Purchase for Cordova on iOS, Android and Windows
https://purchase.cordova.fovea.cc
1.3k stars 537 forks source link

What is the return of store.validator supposed to include? #289

Closed deejbee closed 9 years ago

deejbee commented 9 years ago

I might have missed this but I've set the url and the receipt is verified at myurl:

store.validator = "myurl";

store.when("myproduct").verified(function (product) {
    product.finish();
});

but what is "myurl" supposed to return for the .verified() to run?

I can see the successful http call to myurl but the function never runs. where's the docs for this?

deejbee commented 9 years ago

...just answering this myself after digging into line 417 of:

https://github.com/j3k0/cordova-plugin-purchase/blob/master/www/store-android.js

It's expecting the response from the web service to include "ok:true" AND data:product for a valid receipt i.e.

{
    "ok": true,
    "data": {
                   ... the payload you POST'ed
}