veda-consulting / uk.co.vedaconsulting.payment.gocardlessdd

1 stars 7 forks source link

relationship with uk direct debit extension #16

Open artfulrobot opened 8 years ago

artfulrobot commented 8 years ago

This extension depends on the ukdirectdebit extension but looking a the code I'm confused as to the relationship between the two.

The GC-specific processing code is split between the two; this repo has code for starting the redirect flow; the ukdirectdebit one has code for completing the redirect flow (and the 3rd party GC libs are included in the ukdirectdebit one).

Apart from the form post hook that processes the successful redirect flows, the only cross-reliance I can see is a call to a helper function about start date.

The ukdirectdebit extension (which I'm not v familiar with) seems to be focussed on SmartDebit (and there's redundant code in the GC extension that appears to be copied from that).

I'd propose either

  1. Separate two extensions, remove dependency. Reasons for this are that the separateion of responsibilities is not clear; it looks like GC could stand alone with some minor changes and leave ukdirectdebit to focus on SmartDebit. This would also enable other devs to move the GC extension on without the overhead of the much larger ukdirectdebit one, e.g. I'm interested in doing some work on webhooks which might fix #15
  2. Drop GC, merge into ukdirectdebit. Reasons are that half the code is already there anyway.
  3. Refactor code so ukdirectdebit provides a documented plugin interface for other providers, possibly separate smartdebit out. Reasons would be if the ukdirectdebit could provide really useful common features and if this would enable other processors to be written with less overhead, bringing more choice to the charities and other orgs using CiviCRM.

My favourite option is (1), because it seems the path of least resistance in terms of me getting GC DDs up and running for a client.