Issue

We developped custom payment gateways and payment types that represents financing contracts. Those payments require additional fields like the financing duration or the financing rate that are added to the payment entity via bundle fields.

With the new admin payment creation system that relies on OrderPaymentAddForm, the custom payment fields are no longer fillable and this is an issue. We have set the setting commerce_payment_use_legacy_add_payment_form but we except it to be deprecated in the future so we are looking for a future-proof solution.

Possible solutions

  • We could extend OrderPaymentAddForm locally and insert the required custom fields but some vary based on the payment gateway which may be a bit trickier. Also we would need to follow closely the updates made on the original form to avoid breaking stuff, so additional maintenance.
  • We could create a new PR which replaces the current hard-coded form to reuse the add-payment inline entity form when defined on the payment gateway. Would you consider it? I fear it might be rejected because it would be like going backwards.
  • We could move all our custom fields to dedicated PaymentMethod and avoid altering the payment entity itself, the payment method form would be loaded in OrderPaymentAddForm. Though none of the financing contracts are reusable, aren't we bending the system to match our needs? This would represents quite a big migration so let's make sure it's future-proof.
  • Would you see another possible solution?

Thank you in advance for your support.

Comments

aerzas created an issue.