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) }; }
public CustomerContext( StripeEphemeralKeyProvider keyProvider, StripeRemoteService stripeRemoteService) : base(keyProvider) { _stripeRemoteService = stripeRemoteService; }