How to exit `inBillingRetryPeriod` state in Storekit2

I'm currently testing subscriptions in Sandbox. In AppstoreConnect, I set a grace period of 3 days. I subscribed for a service which expired and now it's inBillingRetryPeriod state. I thought it had to do with my payment method. After updating my payment method, it still remains in that state. I checked Status.RenewalInfo's gracePeriodExpiration and expirationReason values but both produced nil. How do I exit the inBillingRetry state? I'm new to in-app purchases. Thanks. Here's the relevant code that updates subscription status:

   @MainActor
    func updateSubscriptionStatus() async {
        do {
            
            guard let product = storeManager.renewables.first,
                  let statuses = try await product.subscription?.status else {return}
            
            var highestProduct: Product? = nil
            var highestStatus: Product.SubscriptionInfo.Status? = nil
            
            for status in statuses {
                switch status.state {
                case .expired, .revoked:
                    continue
                default:
                    let verifiedRenewalInfo = try storeManager.checkVerified(status.renewalInfo)
                    
                    //Find the first subscription in the store that matches id on the `status.renewalInfo`
                    guard let newSubscription = storeManager.renewables.first(where: {$0.id == verifiedRenewalInfo.autoRenewPreference}) else { continue }
                    
                    guard let currentProduct = highestProduct else {
                        highestProduct = newSubscription
                        highestStatus = status
                        // next status
                        continue
                    }
                    
                    let currentProductTier = storeManager.tierDuration(for: currentProduct.id)
                    let newTier = storeManager.tierDuration(for: newSubscription.id)
                    if newTier > currentProductTier {
                        //updated product and status
                        highestProduct = newSubscription
                        highestStatus = status
                    }
                }
            }
            
             
            currentSubscription = highestProduct // currentSubscription is an @State 
            status = highestStatus // status is an @State 
            if let mySubcriptionStatus = status,
               case .verified(let renewalInfo) = highestStatus?.renewalInfo {
                print(mySubcriptionStatus.state) // 
                StoreKit.Product.SubscriptionInfo.RenewalState(rawValue: 3))-- inBillingRetry.  
                print(renewalInfo.expirationReason) // nil
                print(renewalInfo.gracePeriodExpirationDate) // nil
            }
        } catch  {
            print(error)
        }
        
    }

Replies

Note for Sandbox, there is no payment method to manage and that the grace period duration isn't applicable in sandbox due to its accelerated rates.

For info on sandbox subscription accelerated rates for billing retry and grace period, see: https://developer.apple.com/help/app-store-connect/test-in-app-purchases/manage-sandbox-apple-id-settings#edit-subscription-renewal-speed

For info testing subs going to billing retry in sandbox and recovering, see our article here: https://developer.apple.com/documentation/storekit/in-app_purchase/testing_in-app_purchases_with_sandbox/testing_failing_subscription_renewals_and_in-app_purchases