RevenueCat / RevenueCat/react-native-purchases

IOS: Payment cancelled while doing payment from UPI

Open
#1,570 7 comments 0 reactions 1 assignee View on GitHub

@facumenzella is already working on this.

Since Feb 4, 2026.

bug
Dominant language
TypeScript
Stars
1.2k
Forks
117
Avg merge
14h 40m
Merged PRs (30d)
40

Description

Describe the bug
On IOS, while making a payment through UPI in India, the purchase is getting cancelled in background when i go to the payment app for accepting the payment.
Error Code is PURCHASE_CANCELLED in the above case as soon as i go to payment app, Payment is successful but error code is incorrect in this case.

  1. Environment
    1. Platform: IOS
    2. SDK version: 9.6.15
    3. OS version:
    4. Xcode/Android Studio version:
    5. React Native version: 0.73.11
    6. SDK installation (CocoaPods + version or manual):
    7. How widespread is the issue. Percentage of devices affected.
  2. Debug logs that reproduce the issue
  3. Steps to reproduce, with a description of expected vs. actual behavior
  4. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

Additional context
Here is the code snippet

const purchasePackage = async (
  parentAuthId: string,
  parentServiceId: string,
  pkg: PurchasesPackage,
) => {
  return withInAppPurchase(parentAuthId, parentServiceId, async () => {
    try {
      const result = await Purchases.purchasePackage(pkg);

      return result;
    } catch (error) {
      logError(InAppPurchaseAnalyticsEvents.PURCHASE_PACKAGE_FAILED, {
        error,
        parentAuthId,
        parentServiceId,
      });
      throw error;
    }
  });
};


const purchase = useCallback(
    (pkg: PurchasesPackage) => {
      return purchasePackage(parentAuthId, parentServiceId, pkg);
    },
    [parentAuthId, parentServiceId],
  );


const handlePurchase = useCallback(async () => {
    if (!selectedPlan) {
      return;
    }

    setStatus('inprogress');
    trackEvent(getAnalyticsEvent('purchase', 'inprogress'), { plan_type: planType });

    try {
      await purchase(selectedPlan);

      validateCustomerInfo();
    } catch {
      setStatus('failed');
    }
  }, [selectedPlan, planType, purchase, validateCustomerInfo]);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.