I want to make transactions and validate them through backendless. How can I do that?
I found this article but it only works with Java SDK
Hi Timur,
I am still checking if there is REST API. Out of curiosity, could you please describe why the implementation in our SDK for Android would not work for you?
Regards,
Mark
Hi Timur,
Sure there is a REST API.
Here are the routes for v4:
Validate Purchase: GET /<app_id>/<rest_api_key>/commerce/googleplay/validate/<package_name>/inapp/<product_id>/purchases/<token>
Get Subscription Status: GET /<app_id>/<rest_api_key>/commerce/googleplay/<package_name>/subscription/<subscription_id>/purchases/<token>
Cancel Subscription: POST /<app_id>/<rest_api_key>/commerce/googleplay/<package_name>/subscription/<subscription_id>/purchases/<token>/cancel
And for v3:
Validate Purchase: GET /<version_name>/commerce/googleplay/validate/<package_name>/inapp/<product_id>/purchases/<token>
Get Subscription Status: GET /<version_name>/commerce/googleplay/<package_name>/subscription/<subscription_id>/purchases/<token>
Cancel Subscription: POST /<version_name>/commerce/googleplay/<package_name>/subscription/<subscription_id>/purchases/<token>/cancel
Hello! I don’t want to implement any additional sdks in my project. They makes app bigger and slower in some way
Thanks! But where can I find the explanation of mechanism “under the hood”? For example, I want to check any in-app purchases though Backenless. After payment I want to increase some value in table. What should I do?
Hello,
call
Validate Purchase: GET /<app_id>/<rest_api_key>/commerce/googleplay/validate/<package_name>/inapp/<product_id>/purchases/<token>
Get Subscription Status: GET /<app_id>/<rest_api_key>/commerce/googleplay/<package_name>/subscription/<subscription_id>/purchases/<token>
the response will be:
{ "kind": "androidpublisher#productPurchase",
"purchaseTimeMillis": long,
"purchaseState": integer,
"consumptionState": integer,
"developerPayload": string,
"orderId": string}
consumptionState - integer - The consumption state of the inapp product. Possible values are:
<ol>Yet to be consumed</ol>
<ol>Consumed</ol>developerPayload - string - A developer-specified string that contains supplemental information about an order.
<ol>Purchased</ol>
<ol>Cancelled</ol>purchaseTimeMillis - long - The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970).
kind - string - This kind represents an inappPurchase object in the androidpublisher service.
orderId - string - The order id associated with the purchase of the inapp product.
purchaseState - integer - The purchase state of the order. Possible values are:
more details here: https://developers.google.com/android-publisher/api-ref/purchases/products
then depends on your business logic you can change your data.