Open chenna8464 opened 2 months ago
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
and we have enabled pub/sub also
how are you configuring the SDK @chenna8464 ? Can you share some of the configure code? Without your API key of course 😄
this is the initialization of the SDK
static Future<void> init() async { if (await Purchases.isConfigured) return; await Purchases.configure(PurchasesConfiguration( Platform.isIOS ? EnvironmentConfig.revenueCatPublicKeyiOS : EnvironmentConfig.revenueCatPublicKeyAndroid, )); Purchases.addReadyForPromotedProductPurchaseListener( (productIdentifier, startPurchase) { startPurchase.call(); }); Purchases.getOfferings(); await Purchases.collectDeviceIdentifiers(); }
and this is where the purchase is happening
` Package? product; CustomerInfo? purchaserInfo;
final context = navigator.currentContext!;
final appProvider = context.read<AppProvider>();
product = await _getPackage(appProvider.selectedPlan);
if (Platform.isIOS) {
await Purchases.checkTrialOrIntroductoryPriceEligibility(
[product!.storeProduct.identifier]);
}
await Purchases.setEmail(email);
if (oldProductId.isNotEmpty && Platform.isAndroid) {
purchaserInfo = await Purchases.purchasePackage(product!,
googleProductChangeInfo: GoogleProductChangeInfo(oldProductId,
prorationMode:
GoogleProrationMode.immediateAndChargeFullPrice));
} else {
purchaserInfo = await Purchases.purchasePackage(product!);
}
final isPurchaseSuccesful =
purchaserInfo.entitlements.all["mentor_access"]!.isActive;`
@vegaro
and we have the same ticket, this we raised long back and it closed saying that revcat fixed the issue https://github.com/RevenueCat/purchases-flutter/issues/803
@vegaro any update on this?
@chenna8464 your code looks correct. In that other issue, the UI looks slightly different since it actually shows there was a product change.
Without having the user id it's going to be hard to understand what happened. Do you mind sharing an app user id (or the url link to the user page in the dashboard) so we can look into the details of the purchase? You can send a message to support with more details at support@revenuecat.com if you prefer not to share here, and post the ticket number when you do.
@vegaro user id ketan.gurav+1334@magnifi.com, testsub10@yopmail.com
Thanks @chenna8464
We have been looking into the receipts of those users and it looks like when we check the purchases with Google, they are already cancelled, with a system initiated cancellation. Is it possible you are purchasing using the wrong test card in the purchase screen?
I was looking at ketan.gurav+1334@magnifi.com purchases and that one doesn't have a product change and when RevenueCat gets the purchase, Google indicates it's already canceled, which is odd.
the plans expired/were cancelled because it has some time limit to expire, but if you check the webhook that was sent for this user which has price 0. and it happened for some other users, whose subscriptions expired/cancelled it is happening In two cases only for android , iOS is working fine in all cases
On Mon, 1 Jul 2024 at 18:31, Cesar de la Vega @.***> wrote:
Thanks @chenna8464 https://github.com/chenna8464
We have been looking into the receipts of those users and it looks like when we check the purchases with Google, they are already cancelled, with a system initiated cancellation. Is it possible you are purchasing using the wrong test card in the purchase screen?
image.png (view on web) https://github.com/RevenueCat/purchases-flutter/assets/664544/7e1b140e-2769-4bae-9c0f-68425ecb8c55
I was looking at @.*** purchases and that one doesn't have a product change and when RevenueCat gets the purchase, Google indicates it's already canceled, which is odd.
— Reply to this email directly, view it on GitHub https://github.com/RevenueCat/purchases-flutter/issues/1107#issuecomment-2200083956, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVI27N65ZF2GUCZFBNM2TUTZKFHLBAVCNFSM6AAAAABKBOBBYWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBQGA4DGOJVGY . You are receiving this because you were mentioned.Message ID: @.***>
@vegaro sent an email with the reply, but adding the same message here
we are using the correct test cards for purchase, check this user testsub7@yopmail.com ( this user did the payment and the upgrade also worked but some users still getting the same error (BILLING ERROR))
the plans expired/were cancelled because it has some time limit to expire, but if you check the webhook that was sent for this user which has a price 0. and it happened for some other users, whose subscriptions expired/cancelled it is happening In two cases only for Android, iOS is working fine in all cases
Hi @chenna8464
Been looking into this a bit more and we've realised that what you are seeing is expected for Indian subscriptions. We have a whole blogpost about it, but the tldr; is that India has laws that regulate auto renewing subscriptions that are over 5000 INR so Google immediately cancels this purchases, and sends a notification to our servers with a systemInitiatedCancellation
reason. This is why you see the yearly subscription cancelled and not renewing, but the monthly subscription is working as expected.
There's for sure some work to do in our dashboard to make this less confusing, so I will pass that feedback along and hopefully we can add more clarification for Indian subscriptions in our UI.
Hi @vegaro , understood, now i changed the region to United States(US) to check the payment above 5000INR, by using https://developer.android.com/google/play/billing/test#play-billing-lab
now this user have some issues after payment testsub13@magnifi.com,
now the issue is. I received a webhook for $14 successfully,
but for $134.
**Started a subscription of**
This webhook has the correct price of $134
and
**Changed their renewal preference to**
webhook has a $0 price, which is not correct right? it should have the correct price
Hi @chenna8464,
The webhook for product changes is anticipated to have a $0 price. This is designed to simply notify you of the change. You will subsequently receive a renewal webhook with the updated subscription details, reflecting the correct pricing. For more information about product changes, please refer to our documentation here.
Hi @vegaro , thanks for the update, and also have a small doubt,
The webhook for product changes is anticipated to have a $0 price. This is designed to simply notify you of the change. You will subsequently receive a renewal webhook with the updated subscription details, reflecting the correct pricing. For more information about product changes, please refer to our documentation
will this be the same behaviour in production as well, when we do payments using real money not in sandbox?
Hi @chenna8464, You are correct, this is the expected behavior in sandbox and production.
@vegaro have one more doubt, in the flow INITIAL PURCHASE event will come when i do the initial purchase let's say monthly and then after the free trial. it will convert to a paid user after that, i upgraded from monthly to yearly, and then again i received an INITIAL PURCHASE event
INITIAL PURCHASE -- $14 monthly free tail RENEWAL (converted from free trail to paid) INITIAL PURCHASE -- $134.99 yearly no free tail PRODUCT_CHANGE RENEWAL
we got two INITIAL PURCHASE events
testsub22@magnifi.com, can you please check this user and give me some clarity on this. we are stuck on this flow to handle in our BE
Hi @vegaro any update on this. we stuck on this, can you please give me some info on this
Hi @chenna8464, Since this is different from the initial GitHub ticket and you've opened one in Zendesk, let's continue the conversation there to keep everything organized and focused on the same topic.
‼️ Required data ‼️
Environment
flutter doctor
purchases-flutter
:6.29.4
Describe the bug
initially, i made a monthly payment of $14 which had a free trial, and then after I made a yearly payment of $134. here the payment has gone through successfully but in the revenue cat, it is showing like below (see screenshot). and sometimes it's happening for initial payment as well.
the main issue is the payment is cancelled due to a billing error, and the webhook is sending the price as
0
Additional context
the code i am using for the upgrade is
if (oldProductId.isNotEmpty && Platform.isAndroid) { purchaserInfo = await Purchases.purchasePackage(product!, googleProductChangeInfo: GoogleProductChangeInfo(oldProductId, prorationMode: GoogleProrationMode.immediateAndChargeFullPrice)); } else { purchaserInfo = await Purchases.purchasePackage(product!); }