AnchorFreePartner / hydrasdk-demo-android

Hydra VPN SDK demo app for Android
https://developer.anchorfree.com/
60 stars 31 forks source link

Bandwidth issue in premium account. #125

Open yogeshwar-quantum4u opened 3 years ago

yogeshwar-quantum4u commented 3 years ago

As per documentation, we have created a API Access and service account for the purchase info and also provided all relevant access on google console and cloud console

But when we are updating the below json, its always returning "failed to parse purchase settings"

{ "credentials": { "type": "service_account", "project_id": "api-3333333333333333333-333333", "private_key_id": "3333333333333333333333333333333333333333", "private_key": "-----BEGIN PRIVATE KEY----- MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC3eWGUsgiwXzEG ...= -----END PRIVATE KEY----- ", "client_email": "perchaseverification@api-8590733015157495171-576381.iam.gserviceaccount.com", "client_id": "110405678044800470496", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://accounts.google.com/o/oauth2/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/perchaseverification%40api-1111111115157495171-511181.iam.gserviceaccount.com" }, "application": "AnchorFree-Backend/1.0" }

timoshenkoav commented 3 years ago

Please email me full generated json and project id to a.timoshenko@anchorfree.com

naphaso commented 3 years ago

"credentials" should be escaped string with service account. Example:

{
  "credentials":"{\"type\":\"service_account\",\"project_id\":\"api-3333333333333333333-333333\", ...}",
  "application":"AnchorFree-Backend/1.0"
}

You could correctly escape service account in browser console, for example:

> console.log(JSON.stringify({credentials:JSON.stringify({"type": "service_account", "project_id": "api-3333333333333333333-333333"}),application:"AnchorFree-Backend/1.0"}))

{"credentials":"{\"type\":\"service_account\",\"project_id\":\"api-3333333333333333333-333333\"}","application":"AnchorFree-Backend/1.0"}
singhmeenu commented 3 years ago

Hi @naphaso thanks it's work for me. After adding payment method. I am using below function to pass the purchase json from google. sdk.getBackend().purchase("json from google", new CompletableCallback() { @Override public void complete() { //purchase request success }

@Override public void error(VpnException e) { //failed to process purchase } }); Passing json is {"orderId":"GPA.3316-0060-8538-95781","packageName":"com.appnextg.vidmaker","productId":"com.monthly.pro","purchaseTime":1620800024656,"purchaseState":0,"purchaseToken":"glklbledoecgjienpinphdbe.AO-J1Oy34aYGswoKuchDcpk831qGNyzw7PHfUxtdjx2Wn5vqlwUCc72qVtIJCxcU1wSAZHQ2FRaaWG5AOKz2Fsto5HWvdXgxFp5JzHf6QVknSIUBilS36jw","autoRenewing":true,"acknowledged":false}

and getting error is below PartnerApiException{code=200message=nullcontent=INVALID_PURCHASE}

Please help me.

yogeshwar-quantum4u commented 3 years ago

Please email me full generated json and project id to a.timoshenko@anchorfree.com

Email sent. Please check. yogeshwar.quantum4u@gmail.com

lamlt95 commented 3 years ago

Please email me full generated json and project id to a.timoshenko@anchorfree.com

I am also facing the same issues can you help me fix it.

timoshenkoav commented 3 years ago

@lamlt95 have you tried https://github.com/AnchorFreePartner/hydrasdk-demo-android/issues/125#issuecomment-839024034 ?

lamlt95 commented 3 years ago

@lamlt95 have you tried #125 (comment) ?

thanks. I have tried and succeeded

ShafiqSadat commented 3 years ago

Can you send me your application google play link?