Swift - модуль импорта, работающий в одном файле, но не в другом - PullRequest
0 голосов
/ 18 марта 2020

Просто чтобы уточнить, модуль Stripe выдает ошибку, что нет модуля с именем Stripe. Вот что я попробовал:

Файл 1 (работает в этом файле):

import Foundation
import Stripe
import FirebaseFunctions

let StripeApi = _StripeApi()

class _StripeApi : NSObject, STPCustomerEphemeralKeyProvider {

Файл 2 (не работает в этом файле):

import UIKit
import Stripe
import FirebaseFunctions

class CheckoutVC: UIViewController, CartItemDelegate {

В Кроме того, тот же файл выдает эту ошибку: Значение типа 'STPPaymentConfiguration' не имеет члена 'createCardSources'

func setupStripeConfig() {
        let config = STPPaymentConfiguration.shared()
        config.createCardSources = true
        config.requiredBillingAddressFields = .none
        config.requiredShippingAddressFields = [.postalAddress]

        let customerContext = STPCustomerContext(keyProvider: StripeApi)
        paymentContext = STPPaymentContext(customerContext: customerContext, configuration: config, theme: .default())

        paymentContext.paymentAmount = StripeCart.total
        paymentContext.delegate = self
        paymentContext.hostViewController = self

    }

Если бы кто-то мог поставить меня на правильный путь, это было бы очень оценили. Спасибо!

...