Allow payment method plugins to present themselves as multiple brands. This allows for payment methods that connect to PSPs to present themselves as "PayPal" and "iDEAL", without requiring duplicate configuration, for instance.

Postponed to 8.x-2.x.

Comments

xano’s picture

Version: 7.x-1.x-dev » 8.x-2.x-dev
Status: Postponed » Active
xano’s picture

Also make \Drupal\payment\Plugin\payment\method\Base provide a solution for site builders to configure and translate the human-readable names of any brands the method offers.

xano’s picture

Status: Active » Needs work
StatusFileSize
new14.08 KB

Patch is WIP. The problem is to make Base provide a user-friendly way that supports plugins with one and multiple brands, as the textfields will need to be grouped and need a short description, but putting one textfield in a details form element may be very invasive. Also, generic titles in 7.x-1.x (which was a primitive form of brand labels) defaulted to the specific title (now payment method entity label), which can now only be done if there is one brand, but then the behavior will be inconsistent between plugins with one brand, and those with more.

To do:
- Fix the aforementioned issue
- Upgrade specific titles for Basic payment methods to brand labels
- Update the predefined payment methods with brand labels

xano’s picture

StatusFileSize
new68.37 KB
new40.12 KB

The default behavior, which is a single brand with the same name as the plugin itself.
Image 8-7-13 at 9.11 .png

When plugins override the defaults to define more than one brand. The default labels here are "Foo" and "Bar" and will always be displayed like that in the form element title. The values of these elements are how these brands are displayed to the payer, and these default to the default brand labels, but can be overridden.
Image 8-7-13 at 9.14 .png

xano’s picture

StatusFileSize
new53.79 KB

Let's do this instead: no form elements by default, but Basic adds a textfield of its own to customize the brand label. The element is optional, and the brand label defaults to the payment method entity label.
Screen Shot 2013-07-08 at 10.52.45 .png

xano’s picture

Status: Needs work » Fixed
StatusFileSize
new18.19 KB

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.