Problem/motivation
There are times when making a payment (i.e when a payment is created upon custom checkout) where it would be helpful to know whether a payment transaction should be captured vs. authorized. In the PaymentAddForm (admin UI), the user explicitly sets the capture / authorization flag for payments, but for cases like #2820931: Perform payment transaction during checkout, there is no way for the system to know whether a payment should be captured or authorized.
Proposed resolution
Implement a third party setting on checkout flows that payment gateways can use to determine auth v. capture from the checkout flow's configuration.
Remaining tasks
- Third party setting on checkout flows, checked from e.g. checkout.complete event subscribers who want to make payments
- Payment example implementation
- Test
Comments
Comment #2
steveoliver CreditAttribution: steveoliver commentedSee https://github.com/drupalcommerce/commerce/pull/542
Comment #3
bojanz CreditAttribution: bojanz at Centarro commentedI think this needs to be configured on checkout, not on the payment gateway level.
Comment #4
steveoliver CreditAttribution: steveoliver commented@bojanz: I'm not totally sure what you mean, but I updated the issue summary with what I think you might have meant by your last comment. Please let me know if that's what you had in mind and/or any other thoughts about this idea of having a way to know if a payment should be authorized or captured.
Comment #5
steveoliver CreditAttribution: steveoliver commented@bojanz: In detail: If I understand correctly, the payment module would implement something similar to the last two form_alter and form_builder of core's contact_storage_test.module, applied to checkout flows--adding a third party setting of 'capture payment immediately'.
Comment #6
mglamanGoing to close as outdated, let's make it a configuration option on the payment process pane proposed in [##2820931].