13

In my app , there is functionality called in app subscription which is auto renewal . In app there is a feature called "Cancel Upgrade".

What I want is If user cancel the subscription then his/her subcription will be cancelled not refundable but just cancelled.

I go through this link and found below note:

You cannot use the API to issue refunds or cancel In-app Billing transactions. You must do this manually through your Google payments merchant account. However, you can use the API to retrieve order information.

But i want my user to cancel his/her upgrade.

Is there any way to do this or please provide alternate solution for this.

Thanks in advance.

KishuDroid
  • 5,411
  • 4
  • 30
  • 47

2 Answers2

9

You can try Google Play Developer API, a REST-based web service that includes Subscriptions and In-App Purchases API

Purchases.subscriptions: cancel

Cancels a user's subscription purchase. The subscription remains valid until its expiration time.

User Billing

Google Play provides a purchase token back to the purchasing app through the In-app Billing API. Your apps can store the token locally or pass it to your backend servers, which can then use it to validate or cancel the subscription remotely using the Google Play Developer API.

random
  • 10,238
  • 8
  • 57
  • 101
  • Thanks for the answer . I will try it and let you know. – KishuDroid Oct 03 '15 at 07:54
  • 3
    I think this is a HUGE security risk. The GP Developer API are to easy your publication/management process, not to be put into an app. If the app apk or the request sent are analyzed, an attacker would basically obtain access to your GP Developer Console. Or is there something I've missed? – Andrea Oct 21 '15 at 15:20
  • Thanks for your valuable answer. – KishuDroid Oct 28 '15 at 13:05
  • @AndreaBasso you're actually right assuming one would call the Google Play Developer API directly from the App. However, you can get around this when having your own backend inbetween. – Salim Dec 13 '18 at 16:18
  • @Andrea He means to say that you can set up your own back-end server and that server can then use Purchases.subscriptions:cancel to cancel a subscription. – Mohit Atray Aug 18 '20 at 13:11
9

From the in app subscription guide,

Users can view the status of all of their subscriptions and cancel them if necessary from the My Apps screen in the Play Store app. Currently, the In-app Billing API does not provide support for programatically canceling subscriptions from inside the purchasing app.

Thus, the user won't be able to cancel their subscription from the app itself, but you can invite them to viist the My Apps section on the Play Store to cancel it.

Andrea
  • 351
  • 1
  • 7