I trying to test Android In-App Billing V3 to make subscription purchases.
Im aware of the following:
"Test subscription purchases recur daily, regardless of the product's subscription period."
but I noticed the following behavior:
A user buys a monthly subscription through google play, the client passes the information to the server. On the server side, I make an API call to google to get more info about the subscription.
I go to the Google play dashboard and cancel the subscription. (it changes from renewing on X to expire on X).
I buy the same subscription again but I have the following behavior:
Purchase token is the same as in #1. My assumption that the purchase
token will be different.
autoRenewing is still set to false (even
though google play dashboard shows "will renew on x").
expiryMills still shows the original expiration which is in the past (I resubscribed a couple of days later so I would expect the expiryMills to be updated)
Im not sure if this is the correct beahvior or not ...
I would expect the following: If im in within the period, so after the user cancels and then resubscribes, the autoRenewing will "true", and if im after the period, I will get a new purchase token so that the information I get from google api will match the google play dashboard.
Ofir
Related
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.
I have an Android app offering auto-renewing subscriptions via In-App Billing, using https://developer.android.com/google/play/billing/billing_library.html.
I'm using a lightly modified BillingManager.java from https://github.com/googlesamples/android-play-billing/ to help with purchase management.
Previously, prior to release (around 4-8 weeks ago), whenever a subscription trial ended and the subscription auto-renewed, I would continue to receive a corresponding Purchase object in the purchases lists upon querying purchases:
PurchasesResult subscriptionResult = mBillingClient.queryPurchases(SkuType.SUBS);
List<Purchase> list = purchasesResult.getPurchasesList();
(see queryPurchases here)
The OrderID had an incremented counter value appended according to the number of renewals that had occurred since the original order (as described under Subscription Order Numbers here).
In the last few days, it seems that whenever a customer's subscription converts to paid from trial, or renews subsequently, queryPurchases returns zero Purchases thereafter. I expect to receive one Purchase object for users with an active subscription (and was getting this during testing a while back - I have the data in my db to confirm it.)
As a result, the app no longer calls our backend server to update the subscription validity and users are denied access to functionality for which they have been charged - not great.
I can view the customer's order (with incremented OrderID) on Google Play Console and the subscription shows as valid (and is not cancelled) and a purchase token is available and can be validated.
Does anyone have any idea why would queryPurchases would stop returning a valid Purchase after the first renewal? (The Purchase is returned as expected prior to the renewal date.)
I'm using the current billing client library, as follows:
implementation 'com.android.billingclient:billing:1.0'
(As a workaround, I can fix this on the back-end by periodically rechecking all submitted purchase tokens, but I'd much prefer to do it on demand triggered by the app, which was working fine previously.)
I initially had test accounts for testing in -app purchases in android but I since removed the testing accounts and moved the app from beta to production. Both test accounts have attempted to cancel their test subscriptions through the Google play app according to documentation. Although the Google play app says the subscription had canceled, it still remains active. Even with trying to uninstall the app. How can I remove the test subscriptions?
I have removed the beta test apk from the Play Store and disabled testing. I have removed all testing accounts from the licensing page as well as the authorized beta testers list. Beta test users are still reporting having an active (daily) test subscription. No matter how many times they hit cancel, it still renews the next day. I need to get this removed. It is hindering our development process.
Assuming you're testing with real transactions where you got a token when you subscribed, you can try cancelling subscription using Google Play Developer API > Cancel Subscription
Purchases.subscriptions: cancel
Cancels a user's subscription purchase. The subscription remains valid until its expiration time.
HTTP request
POST
https://www.googleapis.com/androidpublisher/v2/applications/packageName/purchases/subscriptions/subscriptionId/tokens/token:cancel
where
packageName string The package name of the application for which this
subscription was purchased (for example, 'com.some.thing').
subscriptionId string The purchased subscription ID (for example, 'monthly001').
token string The token provided to the user's device
when the subscription was purchased.
The API requires authorisation.
Also check this
Canceling completed test purchases
Google Play accumulates completed test purchases for each user but
does not pass them on to financial processing.
In some cases, you might want to manually cancel a test purchase to
continue testing. To do so, open the app page in the Play Store. If
the test purchase that you want to cancel is a subscription, you can
also use the cancel() method of the Purchases.subscriptions API.
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.
I'm trying to implement in-app subscription in my application. Everything seems to work ok, except for refund. I made a test account, and bought test subscription. In response got "purchaseState" : 0 (purchased). I immediately issued a refund through a Merchant Console, in response I got same "purchaseState" : 0.
Shouldn't I be notified of refund, so i can cancel subscription on my end? How do i handle refunds for subscriptions? I understand cancellations - state will be changed after expiration date. But refunds..
Refunds are not supported for subscriptions. I recently implemented subscriptions in our Android app and had some of the same questions and saw the same results but confirmed that 'refund' state is never sent for a subscription. Mostly because Google does not give you a refund (unlike in-app billing).