- π¬π§United Kingdom jonathanshaw Stroud, UK
Overriding the payment gateway via settings.php for each environment is what I'm currently doing, using the gateway in test mode everywhere except production, so only test credentials are ever stored in the db config.
I think this is right
So at the very least you want to be really really sure outbound email does not get sent. I'm constantly trapping fail messages in Mailhog.
There's many reasons why you want to be really really sure of that.
I think this stuff is important, but more fundamental than should be in scope for commerce_recurring. At most a warning in the module documentation.
- πΊπΈUnited States mariacha1
I'm just leaving a quick note on how I solved the problem in case it can help others.
Since commerce_recurring uses "advancedqueue" with an option to set the processor to either "daemon" (meaning run by drush or drupal console) or "cron" I just added some lines to my settings.php file to say "only run commerce_recurring on cron on live". With that I'm able to test out recurring charges on my local or dev databases using
drush advancedqueue:queue:process commerce_recurring
(and have it run against my testing sandbox for credit cards, handled also through settings.php) while still having the live site run on cron. Here's the code in my settings.php file (example is for Pantheon):// Protect ourselves from a cron run attempting to renew subscriptions. $config['advancedqueue.advancedqueue_queue.commerce_recurring']['processor'] = 'daemon'; if (defined('PANTHEON_ENVIRONMENT') && (PANTHEON_ENVIRONMENT == 'live')) { $config['advancedqueue.advancedqueue_queue.commerce_recurring']['processor'] = 'cron'; }