Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STPPaymentOptionsViewController loading forever #1796

Closed
jhjones9 opened this issue Apr 28, 2021 · 2 comments
Closed

STPPaymentOptionsViewController loading forever #1796

jhjones9 opened this issue Apr 28, 2021 · 2 comments
Assignees
Labels
triaged Issue has been reviewed by Stripe and is being tracked internally

Comments

@jhjones9
Copy link

jhjones9 commented Apr 28, 2021

Summary

STPPaymentOptionsViewController is hanging forever when trying to present it. I'm using 21.4.0.

Code to reproduce

`struct PaymentOptionsView: UIViewControllerRepresentable {

@Environment(\.presentationMode) private var presentationMode

func makeCoordinator() -> Coordinator {
    Coordinator(self)
}

class Coordinator: NSObject, STPPaymentOptionsViewControllerDelegate {
    
    var control: PaymentOptionsView
    
    init(_ control: PaymentOptionsView) {
        self.control = control
    }
    
    func paymentOptionsViewController(_ paymentOptionsViewController: STPPaymentOptionsViewController, didFailToLoadWithError error: Error) {
        
    }
    
    func paymentOptionsViewControllerDidFinish(_ paymentOptionsViewController: STPPaymentOptionsViewController) {
        
    }
    
    func paymentOptionsViewControllerDidCancel(_ paymentOptionsViewController: STPPaymentOptionsViewController) {
        
    }
}

func makeUIViewController(context: UIViewControllerRepresentableContext<PaymentOptionsView>) -> STPPaymentOptionsViewController {
    let config = STPPaymentConfiguration()
    config.requiredBillingAddressFields = .full
    config.canDeletePaymentOptions = true
            
    let customerContext = STPCustomerContext(keyProvider: StripeAPIClient())
    
    let vc = STPPaymentOptionsViewController(configuration: config, theme: STPTheme.defaultTheme, customerContext: customerContext, delegate: context.coordinator)
    
    return vc
}

func updateUIViewController(_ uiViewController: STPPaymentOptionsViewController, context: UIViewControllerRepresentableContext<PaymentOptionsView>) {
    
}

}.`

iOS version

What version of iOS are you observing the problem on? 14.1

Installation method

How did you install our SDK? Cocoapods

SDK version

What version of our SDK are you using? 21.4.0.

Other information

I'm using SwiftUI which is why I'm using UIViewControllerRepresentable to display STPPayementOptionsViewController.

@csabol-stripe
Copy link
Contributor

Hi @jhjones9 ,
This sounds like it might be #1758 which was fixed in v21.3.0. Would you mind cleaning & deleting Derived Data to see if maybe you have an old version hanging around?

If that doesn't fix it could you verify if getOrCreateKey is being called on your keyprovider implementation from listPaymentMethodsForCustomer in STPCustomerContext?

@csabol-stripe csabol-stripe self-assigned this Apr 29, 2021
@csabol-stripe csabol-stripe added the triaged Issue has been reviewed by Stripe and is being tracked internally label Apr 29, 2021
@davidme-stripe
Copy link
Contributor

This ticket hasn't received any updates in a while. Feel free to re-open it if you're still experiencing this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issue has been reviewed by Stripe and is being tracked internally
Projects
None yet
Development

No branches or pull requests

3 participants