Billing Services with Ionic Cordova App

To test the Billing Services, the documentation suggests to see the Poynt Samples App:

which is written in Java for native Android apps.
We are developing a cordova App. Is there a cordova plugin to wrap the Billing Services calls?
I have found only the plugin: GitHub - poynt/cordova-plugin-poynt
which has only one function: launchPayment().
For the getPlans() functionality I can call the API:
https://billing.poynt.net/apps/urn:aid:[AppID]/plans
which gives the plans list.
Is there another API to launch launchBillingFragment() or the other functions needed to subscribe to a billing plan?
Thankyou.
Carlo

@carlo318 please check develop branch of https://github.com/poynt/cordova-plugin-poynt/tree/develop. This is a community maintained cordova plugin.

1 Like

I synced up with carlo and he basically says that he started from what you suggested on https://github.com/poynt/cordova-plugin-poynt/blob/develop/www/PoyntPlugin.js#L29 by running getPlans() but he obtained the ā€œNot connected to inAppBillingService!ā€ error message. It is not clear what to include in ā€œoptionsā€ or where else to obtain the list of the App ā€œbilling plansā€ and execute a purchase with launchBilling(). He tried to compare info with the native plugin, but could not cross-check data. He has to insert the AppID but does not know how and where to do it. Could you help him?

1 Like

A little update:
I have also tried to execute Init() before calling getPlans() and the error has changed:
PoyntError{code=27, httpStatusCode=0, apiErrorCode=null, reason=ā€˜nullā€™, data=ā€˜nullā€™, requestId=ā€˜nullā€™, throwable=}

Code:

Poynt.billing.Init(function(data) {
    // Successful (returns data="")
    Poynt.billing.getPlans(function(data) {
        Log.debugLog("getPlans OK: " + JSON.stringify(data));
    }, function(err) {
        // Fail: returns the error code=27
    }, {  /* what options?  */  });        
}, function(err) { }, {  /* what options?  */  });

Where do the plugin get the AppID or PackageName ?
How can I tell if the plugin is calling the EU portal or USA Portal?

Thankyou.
Carlo

A developer of the plugin said that those functions are still under development.

Hi Carlo,
I see that the dev variant of your app is on US and one of the terminals is on EU, this might be one reason. Check the logcat for the billing endpoint.

Thankyou @deepak I have uploaded the apk also on EU portal.
Anyway, this plugin was not working even when the device was on US.
Since the plugin is under development, maybe it is not fully functional.

Therefore we cannot use that plugin and we cannot complete the Billing procedure of the App.
What alternative can we apply?
I am able to use the Cloud API to get Billing Plans of an App, with this Api Endpoint:
https://billing.poynt.net/apps/urn:aid:[AppID]/plans
But I donā€™t know how to execute launchBillingFragment(). Is there another EndPoint of the API to do it?
Without this information we cannot complete the APP with the Billing part.
Thankyou.
Carlo

@carlo318, hereā€™s a working Cordova Project with billing: https://github.com/dsnatochy/TestCordovaApp.
You can see the calls to billing service in index.html.

Hi Dennis, thankyou for the information.
I am trying to call the functions like in the example, using our test terminal.

  • The Poynt.billing.Init() goes fine;
  • Poynt.billing.launchBilling() shows the popup ā€œConfirm purchaseā€ for 1 second, then shows the error:
    "No product found for given productId"
    This happens with the approved billing planID from DEV App of EU portal, but also with planID from DEV App of USA portal.
  • Poynt.billing.getPlans() returns this error:
    PoyntError {code=30, httpStatusCode=0, apiErrorCode=null, reason='null', data='null', requestId='null', throwable=}

The appID is correct, with .dev suffix.
Are you sure this terminal has been correctly switched to EU portal?
I cannot access to any Poynt App store on the device (I uploaded the App via Usb).
Thankyou.

@carlo318 can you attach the logcat?

Here is the logcat of the App.
It looks like there is a problem with the Auth-Token of the API.
Please let me know if you need a more extensive log (maybe attached via email):

08-29 03:12:26.334  1403  1632 D CO.POYNT.SERVICES/AppSettingsImpl.java:221: AsyncTask #4 userName (carlo.girelli@softagile.com) refreshToken (1:2:1:2:3/Hcjx9UG6CkhU22n0TNzdoZiefP5jkLJpgM3OxKM3eH7CVTOg0elJgPV3YKi9z/q9EC21KhEg9GuLuz8yth3w==) accessToken (eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJjYXJsby5naXJlbGxpQHNvZnRhZ2lsZS5jb20iLCJwb3ludC5kaWQiOiJ1cm46dGlkOjQ1ZTg0ZmE2LWVjNDEtM2I1ZC04MjRhLTM2ODI1YTZiMDc4MCIsInBveW50LmRzdCI6IkQiLCJwb3ludC5vcmciOiIwYmM0OGMxYy02NWNhLTQwNWQtODU4Zi05NTJhNDNhODkzMjYiLCJwb3ludC5zY3QiOiJVIiwiaXNzIjoiaHR0cHM6XC9cL3NlcnZpY2VzLWV1LnBveW50Lm5ldCIsInBveW50LnVyZSI6Ik8iLCJwb3ludC5raWQiOjYxNTUyNDYxNTI4MjcxNDE3NzcsInBveW50LnNjdiI6ImNhcmxvLmdpcmVsbGlAc29mdGFnaWxlLmNvbSIsInBveW50LnN0ciI6ImM4NGVlYzJjLTA5MDgtNDExYi05MjZlLTYwZGFiMzQxOWNlMSIsImF1ZCI6InVybjp0aWQ6NDVlODRmYTYtZWM0MS0zYjVkLTgyNGEtMzY4MjVhNmIwNzgwIiwicG95bnQudWlkIjoxMTA3LCJwb3ludC5iaXoiOiI1ZTA2ODk2Ny05NmViLTQ5OGUtYjg1Mi0yMzAzNzIzZWRiNDIiLCJleHAiOjE1MzU1Mjg5MTIsImlhdCI6MTUzNTQ0MjUxMiwianRpIjoiMWEzYmI3ZGEtZjBjZC00YzljLWFiZWUtMzY1YzMwMTJhNGQyIn0.O46jD--Y1o9n_Vne-49e9mxIS9umAjbHD7NF__NfGsg26xbq6J7k6Z8LA-pJ7sRX1Hb_ui6erw6oJ-oOCmD-XQQko1Suzo7KfHv5qjf7g-_fYIVo61WJpiFBbncspJovmOuBYm4QAx4ksSTaqwGhA-E8z5YWmJ6OC421RcXeK1HOeANidm0aXH1A_nw72BUvsj6DWOGRCun11xXgf4Ypb3gkJBUYsZwaH2ueVJtGPUAqctvuDREnDql-XYT6cnqrtBk5QiwK0tfbTEgAAZuTWVb1eSqowcJJgPs8-bR87QNN7UXsWTpfG1Ho5lFESnLnxXcQxwJf6cYyz_EK43IwAQ)
08-29 03:12:26.334  1403  1632 D CO.POYNT.SERVICES/RestAdapterProvider.java:95: AsyncTask #4 Rest adapter already created or services endpoint hasn't changed (https://services-eu.poynt.net) (https://services-eu.poynt.net)
08-29 03:12:26.335  1403  1632 I CO.POYNT.SERVICES/RestAdapterProvider.java:110: AsyncTask #4 Services endpoint hasn't changed (https://services-eu.poynt.net)
08-29 03:12:26.343  8078  8078 D WebView : evaluateJavascript=cordova.callbackFromNative('SQLitePlugin278389213',true,1,[[{"type":"success","result":{"rowsAffected":0}}]],false);
08-29 03:12:26.344  1403  1632 D CLOUD-API: ---> HTTP POST https://services-eu.poynt.net/token
08-29 03:12:26.344  1403  1632 D CLOUD-API: Authorization: BEARE
08-29 03:12:26.344  1403  1632 D CLOUD-API: api-version: 1.2
08-29 03:12:26.344  1403  1632 D CLOUD-API: User-Agent: Poynt Services/NEXI_PATCH1_1.0-CI17_NEXI_-d (Android 6.0; merchant-staging-p61b-56; urn:tid:45e84fa6-ec41-3b5d-824a-36825a6b0780; P6SW186JS001164)
08-29 03:12:26.344  1403  1632 D CLOUD-API: POYNT-SESSION-ID: 
08-29 03:12:26.344  1403  1632 D CLOUD-API: Content-Type: application/x-www-form-urlencoded; charset=UTF-8
08-29 03:12:26.344  1403  1632 D CLOUD-API: Content-Length: 99
08-29 03:12:26.344  1403  1632 D CLOUD-API: grantType=TOKEN_EXCHANGE&audience=urn%3Aaid%3Astore.poynt.net&subject=carlo.girelli%40softagile.com
08-29 03:12:26.345  1403  1632 D CLOUD-API: ---> END HTTP (99-byte body)
08-29 03:12:26.345  1403  1632 D CLOUD-API: POYNT-REQUEST-ID: 852b8469-0165-1000-9567-56e0d46b1678
[...]
08-29 03:12:26.869  1403  1632 I POYNT-EVENT: {"time" : "2018-08-29T10:12:26Z", "type" : "REST_API", "status" : "SUCCESS", "storeDeviceId" : "urn:tid:45e84fa6-ec41-3b5d-824a-36825a6b0780", "processingTime" : 522.002615, "method" : "POST", "apiStatusCode" : 200, "apiRequestId" : "852b8469-0165-1000-9567-56e0d46b1678", "apiEndpoint" : "https://services-eu.poynt.net/token", "apiServerDate" : "Wed, 29 Aug 2018 10:12:26 GMT", "apiServerBuild" : "1.2.465-2018-08-28T17:40:31Z", "apiServerInstanceId" : "i-05ebcee7ff08a538c"}
08-29 03:12:26.869  1403  1632 D CLOUD-API: <--- HTTP 200 https://services-eu.poynt.net/token (524ms)
08-29 03:12:26.869  1403  1632 D CLOUD-API: OkHttp-Selected-Protocol: h2
08-29 03:12:26.869  1403  1632 D CLOUD-API: date: Wed, 29 Aug 2018 10:12:26 GMT
08-29 03:12:26.869  1403  1632 D CLOUD-API: content-type: application/json;charset=UTF-8
08-29 03:12:26.869  1403  1632 D CLOUD-API: set-cookie: AWSALB=L66IJsuL7tHpaJz0w/zBDlw6qG2mZ+phroR+6ft0APuTCqQp4pqka3fWeLndm6unLblDEttjbJz+M/kfFYYS+Qcg/IvD87sS946uenSmCmJdCEqrcuoVDMYKeNGA; Expires=Wed, 05 Sep 2018 10:12:26 GMT; Path=/
08-29 03:12:26.869  1403  1632 D CLOUD-API: server: Apache-Coyote/1.1
08-29 03:12:26.869  1403  1632 D CLOUD-API: poynt-request-id: 852b8469-0165-1000-9567-56e0d46b1678
08-29 03:12:26.869  1403  1632 D CLOUD-API: poynt-build-info: 1.2.465-2018-08-28T17:40:31Z
08-29 03:12:26.869  1403  1632 D CLOUD-API: instance-id: i-05ebcee7ff08a538c
08-29 03:12:26.869  1403  1632 D CLOUD-API: OkHttp-Sent-Millis: 1535537546746
08-29 03:12:26.869  1403  1632 D CLOUD-API: OkHttp-Received-Millis: 1535537546867
08-29 03:12:26.870  1403  1632 D CLOUD-API: {"expiresIn":86400,"accessToken":"eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJjYXJsby5naXJlbGxpQHNvZnRhZ2lsZS5jb20iLCJwb3ludC5kaWQiOiJ1cm46dGlkOjQ1ZTg0ZmE2LWVjNDEtM2I1ZC04MjRhLTM2ODI1YTZiMDc4MCIsInBveW50LmRzdCI6IkQiLCJwb3ludC5zY3QiOiJKIiwicG95bnQub3JnIjoiMGJjNDhjMWMtNjVjYS00MDVkLTg1OGYtOTUyYTQzYTg5MzI2IiwiaXNzIjoiaHR0cHM6XC9cL3NlcnZpY2VzLWV1LnBveW50Lm5ldCIsInBveW50LmtpZCI6NjE1NTI0NjE1MjgyNzE0MTc3NywicG95bnQuaXN0IjoiY29tLnBveW50LnN0b3JlIiwicG95bnQuc3RyIjoiYzg0ZWVjMmMtMDkwOC00MTFiLTkyNmUtNjBkYWIzNDE5Y2UxIiwiYXVkIjoidXJuOmFpZDpzdG9yZS5wb3ludC5uZXQiLCJwb3ludC5iaXoiOiI1ZTA2ODk2Ny05NmViLTQ5OGUtYjg1Mi0yMzAzNzIzZWRiNDIiLCJleHAiOjE1MzU2MjM5NDYsImlhdCI6MTUzNTUzNzU0NiwianRpIjoiMGJhM2U3NjEtMzhmMS00MGE0LTkwNDYtNzhhZTJjYWZlYzIwIn0.KxJbka1G0by0s3ZPidBlZAguxYet1Y9Iqa4OsOEBzggQyOgjULFRGvMel1dOrYZeVMdhhqF_-JDTE0gPagxq22XgaFH2KG0e0_gpQleT_lqotFXz3lot1pxlNfH_SFWv14OtJNDVTXJxSQxrbaFGJz4kw2s8mt2Odu4Rx8SBfBwxpgyfMX6pbz9bC7xNY7PwdQg51EtEnMB-TnW5kC9FotwRCENQWXRtK_QDKGShTalkdJJt5QDwGO-CZc4Bk87haLs2Vn9LVaxtkmdQQ3bKkgyjPyu2XcdKku5hhQT8vhzm3wfHG0Td7JDCX9tH7x_0gw0W4SvzvnR-62orvVhpEg","refreshToken":"1:2:1:2:WbUML76mPVJTaMiDvr72tGusd+KBnH0/J9KCnwAM8HAs4M9aN5adkAEM87Uo3LHYPiO4p1yzA6mMgFhOzwJFpnXN2XqZKcB5XdcSwYYdVO8=","scope":"ALL","tokenType":"BEARER"}
08-29 03:12:26.870  1403  1632 D CLOUD-API: <--- END HTTP (1228-byte body)
08-29 03:12:26.890  1403  1632 D CO.POYNT.SERVICES/GrantTokenTask.java:45: AsyncTask #4 Successfully obtained token for audience (urn:aid:store.poynt.net) issued to (com.poynt.store): TokenResponse [expiresIn=86400, accessToken=***masked***, refreshToken=***masked***, scope=ALL, tokenType=BEARER]
08-29 03:12:26.891  1403  1403 D TokenResponse:  MEASURE_TIME Total write time 1 size:1233 compressedSize:914
08-29 03:12:26.892  1431  7149 D TokenResponse:  MEASURE_TIME Received bytes 914 json size:1233
08-29 03:12:26.893  1431  7149 D TokenResponse:  Gson Json string size:1233
08-29 03:12:26.893  1431  7149 D TokenResponse:  MEASURE_TIME Total read time 1
08-29 03:12:26.895  1431  8150 D OkHttp  : --> GET https://billing.poynt.net/apps/com.ecosagile.etimestore.pnt.dev/plans?currency=USD&status=ACTIVE&status=INACTIVE http/1.1
08-29 03:12:26.895  1431  8150 D OkHttp  : authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJjYXJsby5naXJlbGxpQHNvZnRhZ2lsZS5jb20iLCJwb3ludC5kaWQiOiJ1cm46dGlkOjQ1ZTg0ZmE2LWVjNDEtM2I1ZC04MjRhLTM2ODI1YTZiMDc4MCIsInBveW50LmRzdCI6IkQiLCJwb3ludC5zY3QiOiJKIiwicG95bnQub3JnIjoiMGJjNDhjMWMtNjVjYS00MDVkLTg1OGYtOTUyYTQzYTg5MzI2IiwiaXNzIjoiaHR0cHM6XC9cL3NlcnZpY2VzLWV1LnBveW50Lm5ldCIsInBveW50LmtpZCI6NjE1NTI0NjE1MjgyNzE0MTc3NywicG95bnQuaXN0IjoiY29tLnBveW50LnN0b3JlIiwicG95bnQuc3RyIjoiYzg0ZWVjMmMtMDkwOC00MTFiLTkyNmUtNjBkYWIzNDE5Y2UxIiwiYXVkIjoidXJuOmFpZDpzdG9yZS5wb3ludC5uZXQiLCJwb3ludC5iaXoiOiI1ZTA2ODk2Ny05NmViLTQ5OGUtYjg1Mi0yMzAzNzIzZWRiNDIiLCJleHAiOjE1MzU2MjM5NDYsImlhdCI6MTUzNTUzNzU0NiwianRpIjoiMGJhM2U3NjEtMzhmMS00MGE0LTkwNDYtNzhhZTJjYWZlYzIwIn0.KxJbka1G0by0s3ZPidBlZAguxYet1Y9Iqa4OsOEBzggQyOgjULFRGvMel1dOrYZeVMdhhqF_-JDTE0gPagxq22XgaFH2KG0e0_gpQleT_lqotFXz3lot1pxlNfH_SFWv14OtJNDVTXJxSQxrbaFGJz4kw2s8mt2Odu4Rx8SBfBwxpgyfMX6pbz9bC7xNY7PwdQg51EtEnMB-TnW5kC9FotwRCENQWXRtK_QDKGShTalkdJJt5QDwGO-CZc4Bk87haLs2Vn9LVaxtkmdQQ3bKkgyjPyu2XcdKku5hhQT8vhzm3wfHG0Td7JDCX9tH7x_0gw0W4SvzvnR-62orvVhpEg
08-29 03:12:26.895  1431  8150 D OkHttp  : --> END GET
08-29 03:12:27.159  1431  8150 E NativeCrypto: ssl=0x7f6c843400 cert_verify_callback x509_store_ctx=0x7f6c77e0d0 arg=0x0
08-29 03:12:27.159  1431  8150 E NativeCrypto: ssl=0x7f6c843400 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_RSA
08-29 03:12:27.270   702   773 D PerfServiceManager: [PerfService] MESSAGE_TIMEOUT:105 
08-29 03:12:27.270   702   773 I libPerfService: 5: set: 1
08-29 03:12:27.270   702   773 I libPerfService: 5: set freq: 0
08-29 03:12:27.270   702   773 D PerfServiceManager: [PerfService] set utilization:0.8 
08-29 03:12:27.382  1431  8150 D OkHttp  : <-- 401 Unauthorized https://billing.poynt.net/apps/com.ecosagile.etimestore.pnt.dev/plans?currency=USD&status=ACTIVE&status=INACTIVE (486ms)
08-29 03:12:27.382  1431  8150 D OkHttp  : Content-Type: application/json
08-29 03:12:27.382  1431  8150 D OkHttp  : Date: Wed, 29 Aug 2018 10:12:27 GMT
08-29 03:12:27.382  1431  8150 D OkHttp  : Server: Apache-Coyote/1.1
08-29 03:12:27.382  1431  8150 D OkHttp  : Content-Length: 130
08-29 03:12:27.382  1431  8150 D OkHttp  : Connection: keep-alive
08-29 03:12:27.382  1431  8150 D OkHttp  : {"code":"INVALID_ACCESS_TOKEN","httpStatus":401,"message":"Access token is missing or invalid","developerMessage":"Invalid token"}
08-29 03:12:27.382  1431  8150 D OkHttp  : <-- END HTTP (130-byte body)
08-29 03:12:27.385  1431  1431 E PoyntInAppBillingSvc: onError for list plans
[...]
08-29 03:12:32.619  1403  1631 D CO.POYNT.SERVICES/LoadBusinessTask.java:48: AsyncTask #3 Getting business for storeDeviceId: urn:tid:45e84fa6-ec41-3b5d-824a-36825a6b0780
08-29 03:12:32.619  1403  1631 D CO.POYNT.SERVICES/PoyntSystemProperties.java:87: AsyncTask #3 It is currently in demo mode: false
08-29 03:12:32.621  1403  1631 D CO.POYNT.SERVICES/TokenUtils.java:53: AsyncTask #3 Token expiry (Wed Aug 29 05:17:24 PDT 2018) current time (Wed Aug 29 03:12:32 PDT 2018)
08-29 03:12:32.621  1403  1631 D CO.POYNT.SERVICES/PoyntBusinessProcessorImpl.java:141: AsyncTask #3 Getting business object for deviceId urn:tid:45e84fa6-ec41-3b5d-824a-36825a6b0780
[...]
08-29 03:12:32.688  1403  1631 D CO.POYNT.SERVICES/PoyntBusinessProcessorImpl.java:156: AsyncTask #3 returning business from local DB: Ecosagile Test
08-29 03:12:32.688  1403  1403 D CO.POYNT.SERVICES/LoadBusinessTask.java:72: main Setting businessId (5e068967-96eb-498e-b852-2303723edb42) in settings (ACTIVATED)
08-29 03:12:32.689  1403  1403 D CO.POYNT.SERVICES/LoadBusinessTask.java:78: main Setting storeId (c84eec2c-0908-411b-926e-60dab3419ce1) in settings

Thankyou.

It was connecting to https://billing.poynt.net, instead of https://billing-eu.poynt.net/. I have installed the correct version of com.poynt.store which should resolve this issue.

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-8f29-4079-b210-4a35f6183c0b?currency=USD http/1.1
08-30 00:34:40.103  2363  2544 D OkHttp  : authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJjYXJsby5naXJlbGxpQHNvZnRhZ2lsZS5jb20iLCJwb3ludC5kaWQiOiJ1cm46dGlkOjQ1ZTg0ZmE2LWVjNDEtM2I1ZC04MjRhLTM2ODI1YTZiMDc4MCIsInBveW50LmRzdCI6IkQiLCJwb3ludC5zY3QiOiJKIiwicG95bnQub3JnIjoiMGJjNDhjMWMtNjVjYS00MDVkLTg1OGYtOTUyYTQzYTg5MzI2IiwiaXNzIjoiaHR0cHM6XC9cL3NlcnZpY2VzLWV1LnBveW50Lm5ldCIsInBveW50LmtpZCI6NjE1NTI0NjE1MjgyNzE0MTc3NywicG95bnQuaXN0IjoiY29tLnBveW50LnN0b3JlIiwicG95bnQuc3RyIjoiYzg0ZWVjMmMtMDkwOC00MTFiLTkyNmUtNjBkYWIzNDE5Y2UxIiwiYXVkIjoidXJuOmFpZDpzdG9yZS5wb3ludC5uZXQiLCJwb3ludC5iaXoiOiI1ZTA2ODk2Ny05NmViLTQ5OGUtYjg1Mi0yMzAzNzIzZWRiNDIiLCJleHAiOjE1MzU3MDA4ODAsImlhdCI6MTUzNTYxNDQ4MCwianRpIjoiOTM5ZjBmYzItOTYwMy00ZGFjLTgxNWQtMWQxZjRiOTExMTMyIn0.HUndzel7RUMFpx0hsHuw4MK2eBcbF88gYq1VeSkO9lu2yvhbH0RvoDdQomjY24Ck4QtPnMyWcJ5Kr073ElWQ4oTl0pCtUNzJjlfDqdQyjFEcuQuCL0iRkr-3ukrYf7nTL9VOz5_Pmof8xaEoEeso6D8fzYfFK4N8wZ9ngwnTVdlkOk4fRjTac6tXbpxUbtH22feMgkquV1-2MIaNa6HQFksalI1L8Lh3A6G6wRgC2JbZ7m6bt0MkFTCg7964DiUgHWEWeI189Qb36S7xtoPGPMvwSx3jx9SjqKm0Xok-VBzejWMtxyMXxn21g8kl4Kx9JRP8mzqVR9si8lM-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.

It looks like the getPlans() is invoking the following endpoint with currency set as USD- https://billing-eu.poynt.net/apps/com.ecosagile.etimestore.pnt.dev/plans?currency=USD&status=ACTIVE&status=INACTIVE

The Test Merchant on the device did not have EUR as the currency in their account settings. I modified the currency from USD to EUR. Please try again.

Ok, now it works!
I can get the correct Plans list and launchBilling() shows the popup with the selected plan.

Now can you please approve the plans of our Live App? (not .Dev).

Thankyou.

HI Carlo,

we previously approved and hid billing plans for your production version. The reason is that currently apps in app marketplace are in free trial.

I have subscribed successfully to a billing plan of the DEV version of the App.
I have also checked the I am successfully subscribed with Poynt.billing.checkSubscription().
Now, how can I unsubscribe from the billing plan?
There is no function to do it in TestCordovaApp, not even in the cordova-plugin-poynt - PoyntPlugin.js.
Can you please help me on how to do it?
Thankyou.
Carlo

@carlo318 do you have Poynt Store (ā€œAppsā€ app) on your terminal? If yes, you can go to account tab and unsubscribe from there. see https://poynt.zendesk.com/hc/en-us/articles/115012584367-Apps-Cancel-or-Unsubscribe. If you donā€™t have the app, let me know the serial number of your device.

I have the App ā€œAppsā€ on the Terminal and the Plan is visible with the button Unsubscribe.
Thankyou!

Hi, we still have a problem with the plugin.

When we subscribe to a plan, the billing fragment starts correctly with the plain id selected, but when we complete the transaction, it does not enter to the success callback (in which we do some business logic like contact our APIā€™s to update user subscription informations).

The UI display a notification message on top of the screen (like a toast notification)

We have tested this functionality 1 month and half ago and it worked (execute the success callback).

How can we solve this issue?