Ok, we have a progress: now the token is accepted and the call to plans goes fine.
But the response to getPlans() is an empty list: it cannot find any approved plan.
{"list":[],"start":0,"total":0,"count":0}
When I try to execute launchBilling() with the approved plan ID I already know, it gives the same error:
No product found for given productId
For completeness these are the appID and planID I am using:
Poynt.billing.getPlans(function(data) {
window.alert("Plans: "+ JSON.stringify(data));
}, function(err) {
window.alert("getPlans Err: " + JSON.stringify(err));
}, {
"packageName": "com.ecosagile.etimestore.pnt.dev",
"appID":"bb5047dc-403c-4e85-88d4-0cbfa7c91cec" // EU Dev
});
var planId = "b30b859d-8f29-4079-b210-4a35f6183c0b"; //EU Test
Poynt.billing.launchBilling(function(){
// Success
$scope.checkSubscriptionStatus();
}, function(error){
window.alert(error);
}, {'planid': planId, 'replace': false});
Maybe the reason could be the filter by currency=USD ? The plan is in EUR.
How can I filter by EUR or remove any filter?
See the logcat below:
08-30 00:34:08.142 2363 2544 D OkHttp : --> GET https://billing-eu.poynt.net/apps/com.ecosagile.etimestore.pnt.dev/plans?currency=USD&status=ACTIVE&status=INACTIVE http/1.1
08-30 00:34:08.142 2363 2544 D OkHttp : authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJjYXJsby5naXJlbGxpQHNvZnRhZ2lsZS5jb20iLCJwb3ludC5kaWQiOiJ1cm46dGlkOjQ1ZTg0ZmE2LWVjNDEtM2I1ZC04MjRhLTM2ODI1YTZiMDc4MCIsInBveW50LmRzdCI6IkQiLCJwb3ludC5zY3QiOiJKIiwicG95bnQub3JnIjoiMGJjNDhjMWMtNjVjYS00MDVkLTg1OGYtOTUyYTQzYTg5MzI2IiwiaXNzIjoiaHR0cHM6XC9cL3NlcnZpY2VzLWV1LnBveW50Lm5ldCIsInBveW50LmtpZCI6NjE1NTI0NjE1MjgyNzE0MTc3NywicG95bnQuaXN0IjoiY29tLnBveW50LnN0b3JlIiwicG95bnQuc3RyIjoiYzg0ZWVjMmMtMDkwOC00MTFiLTkyNmUtNjBkYWIzNDE5Y2UxIiwiYXVkIjoidXJuOmFpZDpzdG9yZS5wb3ludC5uZXQiLCJwb3ludC5iaXoiOiI1ZTA2ODk2Ny05NmViLTQ5OGUtYjg1Mi0yMzAzNzIzZWRiNDIiLCJleHAiOjE1MzU3MDA4NDcsImlhdCI6MTUzNTYxNDQ0NywianRpIjoiMzI4MWQ2NzItMWNmZi00Y2Y2LTg4NzMtNjBkNGYzYzlhZmVjIn0.VdDY427GZm4QTMEiQxHsJBJiVSfFJwsXNWNrxPCBEdpDaSim2STzCJZZUb7jvikEFuoIp-6C2zkv0HUCTyX1xuRb60bgHB3808L1Cxv-EGZzgMV9a22qYSKud4CjH0n-luwr4IwIYp6_lEyqragXbnSgOUH4ZFbZiHWzgdFU-_cMnibKYZCK5loRjI7jpf2J2CnIIwUXMlxWYDanv-DUlhUYEpDsizT29I-Iz6E2lE8wAWW-5vqGXbEOdn2glQBqoyD95fGi_z7znKjYxpxM9tt-AOYdzdtIhDt_ty3W3QXaptH9Cic2xC-Lywr6BIuUOODDkYnqKAmK6eOXS0ERfQ
08-30 00:34:08.142 2363 2544 D OkHttp : --> END GET
08-30 00:34:09.038 2363 2544 D OkHttp : <-- 200 https://billing-eu.poynt.net/apps/com.ecosagile.etimestore.pnt.dev/plans?currency=USD&status=ACTIVE&status=INACTIVE (895ms)
08-30 00:34:09.038 2363 2544 D OkHttp : set-cookie: AWSALB=Ghbc5G9yV8FqyZVu8MsinIrl6mCysKJ6u7ybOq4O60grMjoe5p8n4UjA4aWzdTLEahb7lH/6uGy6/EorpvYXVnqHOanZ8/iD6RueK5LrTO0xzBvpTfSLO4GWzu0I; Expires=Thu, 06 Sep 2018 07:34:08 GMT; Path=/
08-30 00:34:09.039 2363 2544 D OkHttp : server: Apache-Coyote/1.1
08-30 00:34:09.048 2363 2544 D OkHttp : {"list":[],"start":0,"total":0,"count":0}
[...]
08-30 00:34:40.103 2363 2544 D OkHttp : --> GET https://billing-eu.poynt.net/apps/com.ecosagile.etimestore.pnt.dev/plans/b30b859d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l4Kx9JRP8mzqVR9si8lM-vFMRpQ
08-30 00:34:40.103 2363 2544 D OkHttp : --> END GET
08-30 00:34:40.158 2363 2544 D OkHttp : <-- 404 https://billing-eu.poynt.net/apps/com.ecosagile.etimestore.pnt.dev/plans/b30b859d-8f29-4079-b210-4a35f6183c0b?currency=USD (54ms)
08-30 00:34:40.158 2363 2544 D OkHttp : date: Thu, 30 Aug 2018 07:34:40 GMT
08-30 00:34:40.158 2363 2544 D OkHttp : content-type: application/json
08-30 00:34:40.158 2363 2544 D OkHttp : content-length: 191
08-30 00:34:40.158 2363 2544 D OkHttp : set-cookie: AWSALB=DOketBl18KykA4kEmVvw8ApSBxRjbXgKhn7VvrL3NfkK/LGoGwf+Y7zcKGrxiCkNJSG9vojYL8gxMU/uPQH73kCR//z0E/hWzq7MB8iQeAFd+4r8C5sjNmW/yIql; Expires=Thu, 06 Sep 2018 07:34:40 GMT; Path=/
08-30 00:34:40.158 2363 2544 D OkHttp : server: Apache-Coyote/1.1
08-30 00:34:40.158 2363 2544 D OkHttp : {"code":"PLAN_NOT_FOUND_FOR_CURRENCY","httpStatus":404,"message":"Plan not found for the given currency","developerMessage":"Optional[USD]","requestId":"cf9e1d3f-de69-4b8f-acd7-783394ea0ed8"}
08-30 00:34:40.158 2363 2544 D OkHttp : <-- END HTTP (191-byte body)
Thankyou.