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

Support request: basic set-up queries #10

Closed Upperholme closed 7 years ago

Upperholme commented 7 years ago

Getting a tad confused getting this set up, in part because I'm not familiar with the GoCardless system, and in part because CiviCRM's payment processor approach allows for both a live and test mode and I'm working on a dev copy of the site so that this isn't going anywhere near production yet.

In terms of setting up the payment processor, as I read it I need two access tokens - one for live mode using the real GoCardless account, and one for test mode, using the sandbox GoCardless account (although for my testing right now I'm only really concerned with the sandbox account and test mode.

On webhooks, am I right in thinking that again two webhooks are needed, one for live mode and one for test/sandbox?

Also on the payment processor set-up page, I see fields (in both live and test) for "Site URL" and "Recurring payments URL", neither of which are prefilled, so is the site URL the address of my site's front page? And what's the recurring payment URL? (apologies if these come across as numpty questions, I'm new to recurring payments).

Lastly - minor point (I think) in your install/setup notes it states: "Select GoCardless Direct Debit from the Payment Method" but I don't see that option on my payment processor form?

artfulrobot commented 7 years ago

GoCardless is confusing because unlike, say, Stripe, where you have one account and within that test and live credentials/keys, in GoCardless your testing and live accounts are completely separate; different URLs, different usernames, different passwords.

To set this extension up in a dev env you can just use your testing account and leave the live credentials blank on the payment processor set up page. Of course you need to ensure that all the payments you do through CiviCRM are done in test mode or it will fall over.

As for webhooks, there's only one webhook endpoint your end but the live and test versions of the payment processor should have different "webhook secrets". You have to set the secret up at the GoCardless end as well.

Also note that in order for a webhook to be callable it has to be callable from the internet, so a dev VM behind a firewall is not going to work. Sorry to state the obvious, I'm sure you realised that. Also your webhook must be https (possibly need a valid certificate, too - Lets Encrypt is your friend).

I don't think you need the Site URL or the Recurring Payments URL filled out. Basically CiviCRM provides five fields to store details used by various payment processors and different processors use them differently (or not at all).

Finally, yes you should have a "GoCardless Direct Debit" payment method. This is created in the install hook code ref so it's odd if you don't have it.

wpf500 commented 7 years ago

Just on the point of locally testing webhooks, I've used https://ngrok.com/ a lot for that, which gives you a secure tunnel to your localhost.

Upperholme commented 7 years ago

Many thanks for this. My test site is online, so the need for access isn't an issue, and my live site has SSL so when I come to test on that we'll be good to go. The GoCardless documentation indicates that https is only required for live transactions, so again we can run with their sandbox without needing to worry about a certificate.

The clarification on the redundant fields in Civi's payment processor screen is most helpful.

Upperholme commented 7 years ago

On the subject of the "GoCardless Direct Debit" payment method I can see that there is an entry in the 'Payment Instruments' options group with this name, presumably created by the extension when I installed it? I've certainly not manually created it. Or am I missing something?

Upperholme commented 7 years ago

If you "leave the live credentials blank on the payment processor set up page" - in terms of the API access token - I've found that Civi will complain. For the moment, on my dev site I've just put the sandbox token into both live and test fields, as I'm only working with test mode.

artfulrobot commented 7 years ago

@Upperholme yes, test creds in the live config fields will be fine (it won't ever work in CiviCRM's live mode, of course, but you don't need or expect it to).

This is how the top half of the payment processor config should look: screenshot 2017-01-19 09 19 32

(the choice of Financial Account is up to you and makes no difference to the operation of the extension.)

artfulrobot commented 7 years ago

Am I OK to close this now?

Upperholme commented 7 years ago

Indeed, thanks.