Can't add a card via the user payment methods page

Created on 19 June 2024, 5 months ago
Updated 23 June 2024, 5 months ago

On user/UID/payment-methods/add if you try and add a card using this payment gateway you get an ajax error and you can't save the form, only the address fields appear.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom c_archer Cumbria

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @c_archer
  • Assigned to mwjansen
  • 🇬🇧United Kingdom mwjansen Bristol

    I have not implemented any 'stored payment method' functionality (and am currently not intending to since my own customer base doesn't need it).
    I have just checked and the Gateway is inheriting from 'SupportsStoredPaymentMethodsInterface' so that's probably the issue.

    I will need to refactor the inheritance slightly to remove 'SupportsStoredPaymentMethodsInterface' from the inheritance chain.

  • 🇬🇧United Kingdom mwjansen Bristol

    The issue is supporting creating payment methods 'off-checkout'. Opayo Pi supports it, Drupal Commerce supports it but this gateway doesn't currently implement it.

    (It could be added but I suspect it's a fair chunk of work, which I won't have any time for in the foreseeable and I'm not getting the feeling anybody else is keen and available to jump in and add it.)

    In an ideal world I would take out the inheritance of 'SupportsCreatingPaymentMethodsInterface' but it looks like that would probably break the existing normal checkout for this gateway.
    I don't think Drupal Commerce has advanced yet to naturally support a payment process like Opayo Pi where most of the heavy lifting is
    done between the customer's browser Javascript and the Opayo servers.

    Instead I might add some code to identify and intercept when a customer tries to add a payment method 'off-checkout' (e.g. on the user's 'Payment Methods' tab) and display a nice 'Not available' or 'Not supported' message.

  • 🇬🇧United Kingdom c_archer Cumbria

    Thanks for the response, agreed we should at least display a prompt for this feature not been supported. Then this ticket can be put into backlog for when one of us has time to implement.

  • 🇬🇧United Kingdom c_archer Cumbria

    Also worth noting even if we're not saving its still registers in the db

Production build 0.71.5 2024