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

Can't enter redirect flow for 3DS verification with 3DS type "optional" card #877

Closed
erichsu opened this issue Jan 5, 2018 · 3 comments · Fixed by #878
Closed

Can't enter redirect flow for 3DS verification with 3DS type "optional" card #877

erichsu opened this issue Jan 5, 2018 · 3 comments · Fixed by #878

Comments

@erichsu
Copy link

erichsu commented Jan 5, 2018

Summary

I am trying to charge a payment by 3DS credit card source method, and it works fine in Stripe iOS SDK 11.2. After migrate to 11.5, STPRedirectContext initializer return nil if the Source token is already in chargeable status.
(in commit: 5de1550)

Is there any way to force user to enter redirect flow for 3DS verification?

testing card no. 4242 4242 4242 4242 will not enter redirect flow
P.S. The weird part is, 4000 0000 0000 3055 works fine.

Code to reproduce

Example code

    func startCharge(source: STPSource) {
        guard let redirectContext: STPRedirectContext = STPRedirectContext(source: source, completion: { (sourceId: String, clientSecret: String, err: Error) -> Void in
            
            print("Start polling callback")
            STPAPIClient.shared().startPollingSource(withId: sourceId, clientSecret: clientSecret, timeout: 10, completion: { source, err in
                
                if let source: STPSource = source {
                    
                    switch source.status {
                    case STPSourceStatus.chargeable:
                        print("chargeable")
                        
                        
                        
                        
                    case STPSourceStatus.consumed, STPSourceStatus.canceled, STPSourceStatus.pending, STPSourceStatus.failed, STPSourceStatus.unknown:
                        print("failed")
                    }
                    
                } else if let err: Error = err {
                    print("source: polling err \(err)")
                }
            })
        }) else {
            print("redirect context invalid")
            return
        }
        
        redirectContext.startRedirectFlow(from: nav)
    }

iOS version

iOS 10.x and above

Installation method

How did you install our SDK?
Carthage

SDK version

Cartfile.resolved
github "stripe/stripe-ios" "v11.5.0"

@bg-stripe
Copy link
Contributor

bg-stripe commented Jan 5, 2018

Hi @erichsu ,

According to our docs, 3DS sources are usually set to pending, but may be chargeable if the customer’s card has not yet been enrolled in 3D Secure. If the 3DS source is chargeable, I believe you should not redirect the customer (since the card either does not need verification or does not support 3DS).

https://stripe.com/docs/sources/three-d-secure#checking-if-verification-is-still-required

To test 3DS, you should use the test card numbers here. All other test cards (like 4242) do not require verification and will immediately be set to chargeable.

Hope this helps. If you have any additional questions about your 3DS integration, please get in touch with support@stripe.com – they'll be happy to help you further.

Ben

@billinghamj
Copy link

billinghamj commented Jan 5, 2018

Just because it's chargeable doesn't mean we necessarily want to charge it without additional verification.

If 3DS is optional, many merchants will still want to run the authentication process anyway - otherwise it will end up with status set to succeeded, but authenticated set to false.

This is something the Stripe docs explicitly mention as an option:

optional: 3D Secure is optional. The process isn’t required but can be performed to help reduce the likelihood of fraud.

https://stripe.com/docs/sources/three-d-secure#check-requirement

@bg-stripe
Copy link
Contributor

Ah, you're right @billinghamj – my apologies, it looks like this is a regression. We'll include a fix for RedirectContext in the next release.

mludowise-stripe added a commit that referenced this issue Mar 24, 2022
* us bank account

* Adds option to pass custom API version to our testing backend

* Adds tests for us_bank_account

* Adds example view controller

* Changelog

* * Removes unneeded product param from example
* Adds "(ACH)" to docstrings
* Removes extra space in docstrings
* Removes dead paymentintent confirmation test method signature
* Moves fulfills to end of completion block

* Add new strings

* uncomment test

* Adds support for verifying microdeposits (#871)

* Adds support for verifying microdeposits

* Update Stripe/STPAPIClient+Payments.swift

Co-authored-by: Mel <78050250+mludowise-stripe@users.noreply.github.com>

* Update Stripe/STPAPIClient+Payments.swift

Co-authored-by: Mel <78050250+mludowise-stripe@users.noreply.github.com>

* Update Stripe/STPAPIClient+Payments.swift

Co-authored-by: Mel <78050250+mludowise-stripe@users.noreply.github.com>

* Update Stripe/STPAPIClient+Payments.swift

Co-authored-by: Mel <78050250+mludowise-stripe@users.noreply.github.com>

* Less repetition in verify code

* Fun with generics

* Whitespace cleanup

* Adds support for payment_method_options[us_bank_account] (#877)

* Adds support for payment_method_options[us_bank_account]

* Update PMO form encoding test

* Update Stripe/STPConfirmPaymentMethodOptions.swift

Co-authored-by: Yuki <yuki@stripe.com>

* Update Stripe/STPConfirmUSBankAccountOptions.swift

Co-authored-by: Yuki <yuki@stripe.com>

Co-authored-by: Yuki <yuki@stripe.com>

Co-authored-by: Mel <78050250+mludowise-stripe@users.noreply.github.com>
Co-authored-by: Yuki <yuki@stripe.com>

* Fix build

Co-authored-by: Mel <78050250+mludowise-stripe@users.noreply.github.com>
Co-authored-by: Yuki <yuki@stripe.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants