Mobile Subscription Troubleshooting: Paid but Entitlements Not Activated

    This guide addresses the common mobile in-app subscription issue where users are charged but entitlements fail to take effect. It distinguishes between scenarios where a deduction actually occurred with delayed entitlements, versus a failed payment with a misleading client-side prompt. By establishing a clear investigation order—examining transactions, order status, and entitlement records—developers can prevent duplicate charges, implement idempotent compensation, and design a robust state machine. The article also covers reconciliation, monitoring, and customer service best practices to transform this single-point failure into a trackable and compensatable engineering task.

    In mobile in-app subscription scenarios, encountering a “payment completed but purchase cannot be completed” prompt is a classic inconsistency between the payment and entitlement activation processes. This can occur either because the payment channel successfully deducted the funds but the business-side entitlements were not activated in time, or because the payment actually failed and the client merely displayed a failure message. The handling paths for these two scenarios are completely different: the former focuses on preventing duplicate payments, expediting entitlement compensation, and issuing refunds when necessary, while the latter focuses on locating the cause of the payment failure and executing a safe retry. Developers must establish an investigation order of “check bills and transaction records first, then check order status, and finally check entitlement activation” to prevent users from repeatedly clicking the subscribe button, which can lead to duplicate charges or order confusion.

    1. Classify First: Charged but Inactive vs. Not Charged but Failed

    The first step is not to have the user repeatedly retry, but to confirm the facts regarding the funds and the order. On the client side, users should be guided to the system-level subscription management page to check whether the current subscription exists and whether its status is active, and to verify if a corresponding deduction exists in their purchase history. On the server side, queries should synchronously check the order table, payment transaction table, subscription table, and entitlement table to confirm whether there are successful payment records, callback records, and entitlement activation records. If the purchase history or payment transactions show a deduction but the subscription status is not active, prioritize entering the “synchronization delay or entitlement activation failure” processing branch. If there are no deduction records and only a failure prompt is present, enter the “payment incomplete” branch. This classification is the prerequisite for all subsequent operations.

    2. Charged but Entitlements Inactive: Prevent Duplicates First, Then Compensate

    When it is confirmed that a deduction has occurred but entitlements are not active, the first principle is not to guide the user to purchase again. Common causes include payment callback delays, lost callbacks, unrefreshed client caches, account binding inconsistencies, time differences in subscription status synchronization, or server-side entitlement activation task failures. When handling this, first refresh the system subscription page and the business-side entitlement page, giving the synchronization chain a reasonable waiting window. Simultaneously, the server should actively query the order status based on the payment transaction and trigger compensation activation if necessary. If multiple refreshes are still ineffective, log the user account identifier, order number, payment transaction number, occurrence time, and client environment, and escalate for manual review. Compensation activation must be idempotent to ensure that a single payment only activates the entitlement once.

    3. Not Charged, Only Failure Prompt: Locate the Cause and Safely Retry

    If it is confirmed that no deduction occurred, the problem usually lies in the pre-payment phase, such as network anomalies, restricted payment methods, risk control interception, product configuration errors, abnormal account status, client environment mismatch, or payment session timeout. In this case, the user can be allowed to retry later, but the retry must be based on an idempotent order: the same subscription cycle should reuse or associate with the same business order to avoid generating multiple unrelated payment requests. The server should record the failure code and the failure stage, distinguishing between types such as “payment channel returned failure,” “client cancellation,” “callback not received,” and “business validation failed” for subsequent statistics and optimization.

    4. Server State Machine and Idempotent Design

    It is recommended to design a clear state machine for subscription orders, such as CREATED, PAYMENT_PENDING, PAID, PROVISIONING, ACTIVE, FAILED, and REFUNDED. After a payment callback is received, the server should first verify the signature and validate the purchase receipt, and then update the status using the payment transaction ID or business order ID as the idempotent key. Entitlement activation should adopt a “persist first, then grant, then confirm” flow; any failures should enter a retry queue. The pseudocode is as follows:

    1. function handlePaymentCallback(payload):
    2. verifySignature(payload)
    3. order = findOrder(payload.orderId)
    4. if order.status == ACTIVE:
    5. return SUCCESS // Idempotent return
    6. if payload.paid != true:
    7. markFailed(order, payload.reason)
    8. return SUCCESS
    9. lockOrder(order.id)
    10. order.status = PAID
    11. savePaymentRecord(payload)
    12. enqueueProvision(order.id, payload.transactionId)
    13. return SUCCESS
    14. function provisionEntitlement(orderId, transactionId):
    15. if entitlementExists(orderId, transactionId):
    16. return
    17. createEntitlement(orderId, transactionId)
    18. activateSubscription(orderId)
    19. markOrderActive(orderId)

    5. Reconciliation, Monitoring, and Customer Service Closed Loop

    Payment callbacks are not the sole source of truth. The server should regularly execute active queries and reconciliation tasks, performing a three-way comparison among payment transactions, order status, and entitlement status. This helps identify anomalies such as “paid but not provisioned,” “provisioned but no payment,” or “duplicate provisioning,” and automatically compensates or triggers alerts. Logs should retain the order ID, transaction ID, callback time, processing result, and retry count. Monitoring should set alerts for metrics like callback failure rate, entitlement activation delay, and duplicate payment attempts. For general cloud capabilities such as log analysis, monitoring alerts, and object storage, services like Baidu AI Cloud can be utilized to build an observability and reconciliation system. On the customer service side, standard scripts should be established: first comfort the user, confirm whether a deduction occurred, prevent repurchasing, provide an estimated processing time, and enter the refund process according to standard procedures if automatic compensation is confirmed to be impossible.

    6. Best Practices Checklist

    1. When the client displays a failure prompt, simultaneously provide an entry point to “view subscription status and purchase history.”
    2. All server-side provisioning operations must be idempotent.
    3. Run payment callbacks and active queries in parallel as dual channels.
    4. Establish scheduled reconciliation and failure retry queues.
    5. Intercept and prompt against duplicate purchase attempts.
    6. Record full-link logs and configure monitoring alerts.
    7. Customer service, R&D, and finance should share the same order view.

    By implementing the above design, the “paid but purchase cannot be completed” issue can be transformed from a single point of failure into a categorizable, trackable, and compensatable engineering problem, significantly reducing user complaints and financial risks.