Forum PayVault Pay Vault returning unexpected error

Discussion and help relating to the PlayerIO payment solution, PayVault.

Pay Vault returning unexpected error

Postby brunogasppar » July 12th, 2017, 9:18 pm

Hello.
I am trying to validate a Google Play purchase with its receiple, but getting an error from webservice.
I did try with javasctipt and UnityC# version but both are giving me errors.

My code in javasctipt is as follow:

Code: Select all
Client.payVault.getBuyDirectInfo(
   'googleplayv2',
   {
      inapp_signed_data: transactionReceipt,
      inapp_signature: transactionReceiptSignature,
   },
   null,
   function(result){               console.log('OKKKK!!!!');   },
   function(error) {            console.log(error);            }
);


And receiving the following error
Code: Select all
{
   "errorcode":2,
   "message":"An unexpected error occurred inside the Player.IO webservice. Please try again. - Reference code: acc616d4"
}


Can anyone help me?

Also I am using last version of Player.io, have GooglePlay and AppleStore enabled for PayVault.

Thanks in advance
brunogasppar
 
Posts: 5
Joined: October 14th, 2016, 9:33 pm

Re: Pay Vault returning unexpected error

Postby Henrik » July 13th, 2017, 10:24 am

Google Play (and iOS) payments are a bit different, you can't call GetBuyDirectInfo or GetBuyCoinsInfo to start the purchase, instead you complete the in-app purchase on the mobile device, and then pass in the receipt to PayVault through the method https://playerio.com/documentation/refe ... UseBuyInfo, which will then add whatever the user bought to their Vault.

That method isn't implemented in the JS library, because we assumed you'd only be able to get in-app receipts if you were using the native client libraries or Unity, but I guess we'll have to implement it there as well, then. :-)

Also, that error message is really not helpful, it should have told you how to fix it, not just puke out an error code. We'll fix that as well. :-)
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Pay Vault returning unexpected error

Postby brunogasppar » July 13th, 2017, 1:42 pm

Thank you Henrik.
I thought it was the same in javascript. My mistake!
I did it just for testing, we do not need it in javascript (but would be nice to test some purchases with our admin tool :D ). I just use it to test faster than Unity.

And now I realize that UseBuyInfo in unity-c# without passing error callback gives me a null pointer exception. Thats why I thought it had some mistake in the SDK or server side too.

So, this is not working in the plugin:
Code: Select all
UseBuyInfo(string provider, Dictionary<string, string> providerArguments, Callback<Dictionary<string, string>> successCallback);

and this one works ok:
Code: Select all
UseBuyInfo(string provider, Dictionary<string, string> providerArguments, Callback<Dictionary<string, string>> successCallback, Callback<PlayerIOError> errorCallback);


Thank you!
brunogasppar
 
Posts: 5
Joined: October 14th, 2016, 9:33 pm

Re: Pay Vault returning unexpected error

Postby brunogasppar » July 14th, 2017, 12:15 pm

Hi Henrik

Btw let me ask you something about pricing...

We are going to use PayVault only to validate purchases receipts, Are there any cost related to this use?

Thank you.
brunogasppar
 
Posts: 5
Joined: October 14th, 2016, 9:33 pm

Re: Pay Vault returning unexpected error

Postby Henrik » July 14th, 2017, 6:15 pm

Yes, it counts as a PayVault transaction, so it counts towards you usage.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to PayVault