public void Purchase(AN_SkuDetails skuDetails, string developerPayload, Action <AN_BillingPurchaseResult> callback)
            {
                m_BillingPurchaseCallback = callback;
                var paramsBuilder = AN_BillingFlowParams.NewBuilder();

                paramsBuilder.SetSkuDetails(skuDetails);

                m_BillingClient.LaunchBillingFlow(paramsBuilder.Build());
            }
        //--------------------------------------
        //  UM_iInAppClient
        //--------------------------------------

        public void AddPayment(string productId)
        {
            var skuDetails = GetSkuDetails(productId);

            Assert.IsNotNull(skuDetails);

            var paramsBuilder = AN_BillingFlowParams.NewBuilder();

            paramsBuilder.SetSkuDetails(skuDetails);
            m_BillingClient.LaunchBillingFlow(paramsBuilder.Build());
        }
Exemple #3
0
    private void SubscriptionReplace()
    {
        var oldProductId  = "old_subscription_id";
        var paramsBuilder = AN_BillingFlowParams.NewBuilder();

        AN_SkuDetails subscriptionProduct = null; // get subscription AN_SkuDetails model here.

        paramsBuilder.SetSkuDetails(subscriptionProduct);
        paramsBuilder.SetOldSku(oldProductId);
        paramsBuilder.SetReplaceSkusProrationMode(AN_BillingFlowParams.ProrationMode.ImmediateWithoutProration);

        //Use your billing client here.
        AN_BillingClient client = null;

        client.LaunchBillingFlow(paramsBuilder.Build());
    }