Beispiel #1
0
        public void Initialize(StripeConfig stripeConfig)
        {
            if (_paymentContext != null)
            {
                return;
            }

            if (STPPaymentConfiguration.SharedConfiguration().PublishableKey == null)
            {
                STPPaymentConfiguration.SharedConfiguration().PublishableKey = stripeConfig.ApiKey;
            }

            var stripeRemoteService =
                new StripeRemoteService(stripeConfig, _restHttpClient, _logManager, _jsonSerializer);
            var provider        = new StripeEphemeralKeyProvider(stripeRemoteService, _logManager);
            var customerContext = new CustomerContext(provider, stripeRemoteService);

            _paymentContext = new STPPaymentContext(
                customerContext,
                STPPaymentConfiguration.SharedConfiguration(),
                STPTheme.DefaultTheme)
            {
                HostViewController = _getUiViewControllerFunc(),
                Delegate           = new PaymentDelegate(_messageHub, stripeRemoteService)
            };
        }
Beispiel #2
0
 public CustomerContext(
     StripeEphemeralKeyProvider keyProvider,
     StripeRemoteService stripeRemoteService) : base(keyProvider)
 {
     _stripeRemoteService = stripeRemoteService;
 }