Problem/Motivation
There are multiple use cases for payments where 3ds is not suitable and the Stripe review pane is not relevent:
Recurring: #3171408: Allow off_session payment intents for recurring payments
Staff: #3222298: Allow administrators to add payment methods & take payments
Proposed resolution
In the gateway's createPayment() method, create a payment intent if one is not already present on the order.
We should assume it is an off_session payment intent, as if a customer is present the Stripe review pane should be used in order to allow for 3ds.
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork commerce_stripe-3259349
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
jonathanshawThis is blocked on #3259211: Provide more parameters to createPaymentIntent()
Comment #4
jonathanshawComment #5
jonathanshawThe remaining test fails should be because createPaymentIntent() is not using the intent attributes that are being passed to it. This is fixed by the blocking issue #3259211: Provide more parameters to createPaymentIntent().
Comment #6
johnpitcairn commentedRunning this as part of a combo patch in #3171408: Allow off_session payment intents for recurring payments produces the same test fails as #3259211: Provide more parameters to createPaymentIntent(), confirming the test failures here will be fixed by that blocking issue.
Comment #7
johnpitcairn commentedComment #8
johnpitcairn commented#3259211: Provide more parameters to createPaymentIntent() is committed so we can move forward with this.
Comment #9
johnpitcairn commentedComment #10
johnpitcairn commentedThis will need re-testing against current dev and 9.x. Not sure how to do that.
Comment #11
rivimeyJohn, the automated testing setup of this project needs to be updated, by a maintainer such as @jsacksick, to update the test targets to D9 / D10 and recent DB versions.
However, while I agree the testing should be done, I feel that putting the status back to needs work is not helpful as we don't actually know of any work that needs doing, and maintainers won't necessarily check on issues in needs work state.
Comment #12
jonathanshawComment #13
jonathanshawI've become doubtful about something in the tests; I'm debugging a bit with the last commit.
Comment #14
jonathanshawrtbc I think
Comment #15
jsacksick commented@rivimey: Tests are running on Drupal 9.5, not sure what the problem is?
Comment #16
rivimeyAt the time of the comment all the tests had been against D8.9 and using php7.1, both of which were eol at the time.
Is there a MR version of the 'add test/retest' option, ideally that enables different combinations to be tested. I ask because it's unsafe to only test on php7 -- php8.1 is needed too as there are a lot of bugs being found with php8's stricter checks.
Comment #17
jonathanshawYes. I see it now on this page under the test results, although previously I didn't.
Comment #18
rivimeyDon't know if it helps as a non-Commerce dev, but I've looked over the code and cannot see any issues. Looks good to me!
RTBC +1
Comment #19
johnpitcairn commentedWorking as expected here and looks good, let's see what @jsacksick thinks.
Comment #20
jonathanshawTests are still green, still RTBC. The D10 test failure is unrelated to any change in this MR.
Comment #21
jsacksick commentedhm... But does this still aply after #3185801: Stripe Charge to Stripe PaymentIntent got in?
Comment #22
jonathanshawI thought it wouldn't do, but I reran the tests and they're still green:
https://www.drupal.org/pift-ci-job/2576783
Comment #23
jonathanshawAh, my bad: the MR needs a rebase, it doesn't automatically run against latest master.
Comment #24
jonathanshawNo significant conflict with #3185801: Stripe Charge to Stripe PaymentIntent, Gitlab handled automatic rebase fine.
Comment #26
jsacksick commentedCommitted, thank you!