Refund to In App Purchase on Android - android

I have an in app purchase that unlocks part of the app for a year. Its setup as Annual Subscription.
Temporarily running a promotion unlocking premium as one-time purchase.
One of the users emailed me and wanted to take advantage of the promotion. So I'm thinking Cancel / Refund his Subscription, and ask him to purchase again as one-time purchase.
My question is what happens after I cancel / refund his subscription order, does IAB still consider it a valid purchase or not ?
What happens when you queryInventory, is it no longer returned as his purchase or is it stilled returned and I have to handle the status somewhere in code?

You have to do it in your Google Wallet Merchant. Read this Google Documentation:
Once an order is refunded - on a non-rooted device - the order will be invalid if queried. IAB considers it as a purchaseState==2 (2 is refunded according to Table 4 in here). Note that the developer will be in charge to handle refunded items. Read this question.

Related

Inapp purchases and Subscriptions (Sell Once) android

I am providing levels in app (easy(unlocked),fun,crazy,hard)
want the users to buy only once and when they return they should have subscription.
I achieved it by saving in room database
But if I don't consume purchase it gets refunded. If I consume purchase when user comes back he has to buy again (the restore does not works)
What could be the solution?
If we use Subscriptions they are for specific period of time and user has to pay again for renewal but I want them permanent stick with that user.
For non-consumed purchases you need to acknowledge them or they will be automatically refunded in a couple days.
From the docs:
Note: If you do not acknowledge a purchase within three days, the user automatically receives a refund, and Google Play revokes the purchase.

Test subscription is revoked by GooglePlay

I'm working on a subscription renewal feature, in test mode, with testing payment methods. Problem is that we receive cancelation subscription webhook, GooglePlay makes subscription revoke. ​​
From params:
​"cancelReason": "1"
Status code from the docs,
Subscription was canceled by the system, for example, because of a
billing problem.
Also from the docs
Revoking a subscription instantly removes access to the subscription
and is usually done when you or Google suspects fraud.
Usually, it sends cancelation webhook immediately after renewal, even when it was successful, so there are cases when I got two e-mails, about renewal success and cancelation. In my case renewal called after 5 minutes (doc)
Have someone idea, what could be the reason? Is it some "Google anti-fraud system". Because for testing purpose we have short subscription period but the big price. But probably anti-fraud should not be executed when we do testing, with testing payment methods, when there is no real transaction.
The problem was, that we didn't acknowledge new subscriptions.
From the docs:
If you use the Google Play Billing Library version 2.0 or newer, you
must acknowledge all purchases within three days. Failure to properly
acknowledge purchases results in those purchases being refunded.
Regarding subscriptions:
For subscriptions, you must acknowledge any purchase that contains a
new purchase token. This means that all initial purchases, plan
changes, and re-signups need to be acknowledged, but you do not need
to acknowledge subsequent renewals.
Test acknowledging purchase with license testers:
For purchases made by license testers, the acknowledgment window is
shorter. Instead of three days, purchases are refunded and revoked if
they are not acknowledged within five minutes.
UPDATE
changes in documentation
You should also verify that purchases are properly acknowledged as
described in processing purchases. For purchases from license testers, a > purchase will be refunded after 3 minutes if your app does not
acknowledge the purchase and you will receive an email about the
cancellation. You can also check the Orders tab in the Google Play
Console to see if an order was refunded after 3 minutes.

Android In-App Subscription PurchaseState is always 0

In my android app using in-app subscription monthly plan. I have purchased a subscription product with test account. After one hour I cancelled it manually from my phone.
After I query using inventory.getPurchase(monthlyplan), I always get purchase state is 0.
I waited more than one day; still getting response of purchase state is 0. Can any one help me on this?
You may want to check this document - Subscription Cancellation:
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.
When the user cancels a subscription, Google Play does not offer a refund for the current billing cycle. Instead, it allows the user to have access to the canceled subscription until the end of the current billing cycle, at which time it terminates the subscription. For example, if a user purchases a monthly subscription and cancels it on the 15th day of the cycle, Google Play will consider the subscription valid until the end of the 30th day (or other day, depending on the month).
Important: In all cases, you must continue to offer the content that your subscribers have purchased through their subscriptions, as long any user is able to access it. That is, you must not remove any content while any user still has an active subscription to it, even if that subscription will terminate at the end of the current billing cycle. Alternatively, you can use the refund and revoke API to revoke each subscriber's subscription (one by one) and refund their subscription payments. Removing content that any subscriber is entitled to access will result in penalties. Please see the policies document for more information.
There are some good insights regarding the following (also found in the same document):
App uninstallation
Refunding and revoking subscriptions
Here is a related SO question that also talk about cancelling subscription in-app.

In-app subscriptions remain "purchased" after cancellation

I know it has been asked a few times here but still there's no answer explaining why it happens:
Buy the subscription. (subscription is added in my beta draft of the app in the developer console)
Cancel it in my phone's google play account
Query the inventory and get:
{
"packageName":"",
"productId":,
"purchaseState":0,
"autoRenewing":true
}
Obviously the purchase state should be 1 (Cancelled). I tried querying after 12 hours - still same. Am I missing something?
Might be this reason..
From Developer Docs -Subscription Cancellation
When the user cancels a subscription, Google Play does not offer a
refund for the current billing cycle. Instead, it allows the user to
have access to the canceled subscription until the end of the current
billing cycle, at which time it terminates the subscription.

InApp Subscriptions or Google Wallet

I have gone through most of the links here on stackoverflow and i have some doubts regarding InApp Subscriptions and Google Wallet.
What i know:
InApp Subscriptions basically allows a user to be able to subscribe to an app, say for example if it offers one year trial period, then once thats over, Google automatically handles the subscriptions then after.
Google Wallet, its a method that can be used to perform the purchase. What i don't understand is, can i use this method in order to allow users to use the app for one year, and then make them pay for the next years?
Billing continues indefinitely at the interval and price specified for the subscription. At each subscription renewal, Google Play charges the user account automatically, then notifies the user of the charges afterward by email. For monthly and annual subscriptions, billing cycles will always match subscription cycles, based on the purchase date. (Seasonal subscriptions are charged annually, on the first day of the season.)
This is what happens in my app:
1. A user logs in, and i get a date that probably keeps track of the billing cycle
2. If the sessions expired, the user is asked to pay using the inApp Billing serivce
3. Based on TrivailDriveApp Example, where we have the success log printed on subscription, we update the date of payment.
Some questions i have:
As per the quote from android, if the user is automatically subscribed to the service, and if a mail is sent to the user, does that mean that i would never be able to get a notification about the payment extension? How do i sync that with the server then?
Is my approach wrong in handling this kind of scenario? Or do i have to select a different method of handling app extensions?
P.S: There is no way of testing inapp subscriptions also. I wonder if i could do that without using real credit/debit card credentials.
EDIT:
I would also want to keep track of when the purchase or billing was done, if subscriptions are auto-renewed, then should i take up the purchase flow as an InApp Product instead of an InApp Subscription?
Please help.

Categories

Resources