Currently, it's quite easy to accidentally pull down a live-configured database and accidentally run transactions using real credentials on a development site. This is exasperated by use of the recurring framework.

Patch creates a system-level variable that defaults to forcing your site into TEST mode. The hook_update should provide backwards-compatibility. We probably also need a way to set this variable in the UI, but the intention here is to use settings.php to configure this variable anyway.

More ideal would be if we could get full Oauth tokenized authentication, but that would require API changes.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gcb created an issue. See original summary.

mikemccaffrey’s picture

Rather than indirectly defining a test mode in order to switch the payment server credentials, this patch will allow you to directly override the credentials for a payment method in your settings.php file.

capellic’s picture

Would love to see a solution adopted.

gcb’s picture

@capellic have you tried either of these patches? I think mikemccaffrey's is a cleaner solution but we have only tested it in one implementation. Can you give it a try and tell us if it works for you?

Greg Boggs’s picture

Assigned: Greg Boggs » Unassigned
ruscoe’s picture

Assigned: Unassigned » ruscoe
Status: Needs work » Needs review
capellic’s picture

I haven't had a chance to review these patches, sorry, but came over to the iATS queue after this module caught my eye: https://www.drupal.org/project/commerce_payment_settings_switcher. Looks like several Commerce payment modules are using this and it might be a better way to go? Not suggesting it is, just throwing it in to the mix for consideration.

  • ruscoe committed ade97c6 on 7.x-2.x authored by mikemccaffrey
    Issue #2631312 by gcb, mikemccaffrey: Add ability to force Test mode...
ruscoe’s picture

Assigned: ruscoe » Unassigned
Status: Needs review » Fixed

We've gone with @mikemccaffrey's patch here. It gets the job done cleanly.

@capellic, I looked over the commerce_payment_settings_switcher module and it looks like it would work, but I think for something this simple we can avoid adding a dependency.

capellic’s picture

@capellic, I looked over the commerce_payment_settings_switcher module and it looks like it would work, but I think for something this simple we can avoid adding a dependency.

Sounds good, thank you.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.