private void InitWalletStripe()
        {
            try
            {
                var stripePublishableKey = ListUtils.SettingsSiteList?.StripeId ?? "";
                if (!string.IsNullOrEmpty(stripePublishableKey))
                {
                    PaymentConfiguration.Init(stripePublishableKey);
                    Stripe = new Stripe(this, stripePublishableKey);

                    MPaymentsClient = WalletClass.GetPaymentsClient(this, new WalletClass.WalletOptions.Builder()
                                                                    .SetEnvironment(WalletConstants.EnvironmentTest)
                                                                    .SetTheme(WalletConstants.ThemeLight)
                                                                    .Build());

                    IsReadyToPay();
                }
                else
                {
                    Toast.MakeText(this, GetText(Resource.String.Lbl_ErrorConnectionSystemStripe), ToastLength.Long).Show();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Пример #2
0
 private void InitWalletStripe()
 {
     try
     {
         var stripePublishableKey = ListUtils.SettingsSiteList?.StripeId ?? "";
         if (!string.IsNullOrEmpty(stripePublishableKey))
         {
             PaymentConfiguration.Init(stripePublishableKey);
             Stripe = new Stripe(this, stripePublishableKey);
         }
         else
         {
             Toast.MakeText(this, GetText(Resource.String.Lbl_ErrorConnectionSystemStripe), ToastLength.Long)?.Show();
         }
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
Пример #3
0
        public void OnCreate(Bundle savedInstanceState, StripeConfig stripeConfig)
        {
            _stripeConfig = stripeConfig;

            PaymentConfiguration.Init(_stripeConfig.ApiKey);

            var stripeRemoteService =
                new StripeRemoteService(_stripeConfig, _restHttpClient, _logManager, _jsonSerializer);

            CustomerSession.InitCustomerSession(new StripeEphemeralKeyProvider(stripeRemoteService));

            _paymentSession = new PaymentSession(CrossCurrentActivity.Current.Activity);
            var config = new PaymentSessionConfig.Builder()
                         .SetShippingInfoRequired(false)
                         .SetShippingMethodsRequired(false)
                         .Build();

            _paymentSession.Init(new PaymentSessionListener(), config, savedInstanceState);

            StripeManager.Initialize(stripeRemoteService, _stripeConfig);
        }
        private void InitWalletStripe()
        {
            try
            {
                var stripePublishableKey = ListUtils.SettingsSiteList.FirstOrDefault()?.StripeId ?? "";
                if (!string.IsNullOrEmpty(stripePublishableKey))
                {
                    PaymentConfiguration.Init(stripePublishableKey);
                    Stripe = new Stripe(this, stripePublishableKey);

                    MPaymentsClient = WalletClass.GetPaymentsClient(this, new WalletClass.WalletOptions.Builder()
                                                                    .SetEnvironment(WalletConstants.EnvironmentTest)
                                                                    .SetTheme(WalletConstants.ThemeLight)
                                                                    .Build());

                    IsReadyToPay();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }