我目前正在通过Firebase云功能将Stripe集成到我的iOS应用程序中。我遇到一个奇怪的问题,当我尝试添加卡时,它告诉我在云功能中明确配置它时API密钥丢失了。
我注意到的一件事是,如果我不包括STPPaymentConfiguration(),则在客户端,则代码可以正常工作,并且付款来源已添加到firebase和stripe中。我在这里想念什么吗?
我认为我不太了解前端方面的内容,因为
let addCardViewController = STPAddCardViewController()
Run Code Online (Sandbox Code Playgroud)
我的代码可以正常工作,但是应该可以,但是现在视图控制器没有帐单地址选项。
我的前端Swift代码:
@objc func addPaymentPressed(_ sender:UIButton) {
// Setup add card view controller
let config = STPPaymentConfiguration()
config.requiredBillingAddressFields = .full
let addCardViewController = STPAddCardViewController(configuration: config, theme: theme.stpTheme)
//Creating VC without configuration and theme works just fine
//let addCardViewController = STPAddCardViewController()
addCardViewController.delegate = self
let navigationController = UINavigationController(rootViewController: addCardViewController)
navigationController.navigationBar.stp_theme = theme.stpTheme
present(navigationController, animated: true, completion: nil)
}
func addCardViewControllerDidCancel(_ addCardViewController: STPAddCardViewController) {
// Dismiss add card view controller
dismiss(animated: true)
}
func addCardViewController(_ …Run Code Online (Sandbox Code Playgroud)