artfulrobot / uk.artfulrobot.civicrm.gocardless

A CiviCRM extension providing GoCardless integration to handle UK Direct Debits.
GNU Affero General Public License v3.0
5 stars 18 forks source link

Implement new doCancelRecurring and support payment propertyBag #83

Closed mattwire closed 3 years ago

mattwire commented 4 years ago

This implements support for payment propertyBag and doCancelRecurring()/cancelSubscription() for subscription cancellations.

Some notes:

  1. I've implemented supportsCancelRecurringNotifyOptional() and set it to TRUE. This means that the user will see an option to notify gocardless (defaults to Yes) on versions of CiviCRM that support this (5.27). In the backend they will see: image And the frontend (with https://github.com/civicrm/civicrm-core/pull/17687): image

  2. This drops support for CiviCRM < 5.24 - I think you'll have trouble getting everything working on versions much older anyway..

artfulrobot commented 4 years ago

Thanks, Matt. I think it does still need to be an option, though one that defaults to ON. Otherwise we need to handle cases when the API call fails but the Civi process should succeed. These are rare but they do happen especially in testing.

I like the "texts" stuff.

mattwire commented 4 years ago

Ok, @artfulrobot I pushed an update that should work in all cases for 5.24+:

mattwire commented 4 years ago

Also, a (gocardless) recur in Pending state does not have a subscription ID (processor_id) so cancel will fail. Maybe that's only a problem on my local dev because I'm not getting webhooks?

artfulrobot commented 4 years ago

@mattwire yeah but we don't care about those 😉

A GC recur will only be Pending for 24 hours or less (maybe 1 hour) then Cron changes it to cancel or failed, can't recall. Normally it will be In Progress. If it's pending then you can't cancel it cos it doesn't exist (at GC) yet.

mattwire commented 4 years ago

@artfulrobot I've updated the description - I think this should be ready for review now.