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

Creating live transactions from the gocardless sandbox #62

Closed martst closed 4 years ago

martst commented 4 years ago

I realise that the extension has been written to separate test transactions from live transactions but I would like to generate "real" transactions from the sandbox. I am configuring a new setup of civicrm and I want to be able to test the whole process of membership and DD payments before going live. I am considering doing this by using "real" data in civicrm but forcing the test flag in the extension by modifying the code. The extension will then use the sandbox credentials and callbacks. Has anyone else tried this or am I mad to attempt it. Martin

artfulrobot commented 4 years ago

I think you'll struggle with that and get in a tangle, I suspect.

Just do a normal test with in test mode. Everything should work, the only drawback is that it's hard to see in CiviCRM's UI because it tends to hide test things a bit - they are there, still though.

If you're determined...

You'd need to put your test credentials in under the live payment processor setting, making sure you have at least a different webhook secret entered in the test payment processor setting (important)

Then you'd need to hack the code to never use the live endpoint for the API e.g. in here: https://github.com/artfulrobot/uk.artfulrobot.civicrm.gocardless/blob/master/CRM/Core/Payment/GoCardless.php#L455 - make it always use \GoCardlessPro\Environment::SANDBOX

Of course, if you do this stuff it will not work with anything live.

artfulrobot commented 4 years ago

closing this as I don't think it's a bug and I've not heard back for a while and I need a feel good thing to do before Christmas ;-)

Feel free to reopen the conversation if you still need it.