Move vendor and API setting back to payment gateway setup

Created on 20 December 2023, 11 months ago
Updated 26 March 2024, 8 months ago

While I can understand your need to have these has a separate page it creates confusion and I'm not sure its a good solution to your problem.

If you want to store the same values for multiple Opayo payment methods these can be stored in a ENV variable and shared between the payment methods. For example:

// Payment gateway 1
$config['commerce_payment.commerce_payment_gateway.opayo_pi_one']['configuration'] = [
  'vendor' => getenv('OPAYO_VENDOR'),
  'live_integration_key' => getenv('OPAYO_LIVE_KEY'),
  'live_integration_password' => getenv('OPAYO_LIVE_PASSWORD'),
  'test_integration_key' => getenv('OPAYO_TEST_KEY'),
  'test_integration_password' => getenv('OPAYO_TEST_PASSWORD'),
  'mode' => getenv('OPAYO_MODE'),
];

and

// Payment gateway 2
$config['commerce_payment.commerce_payment_gateway.opayo_pi_two']['configuration'] = [
  'vendor' => getenv('OPAYO_VENDOR'),
  'live_integration_key' => getenv('OPAYO_LIVE_KEY'),
  'live_integration_password' => getenv('OPAYO_LIVE_PASSWORD'),
  'test_integration_key' => getenv('OPAYO_TEST_KEY'),
  'test_integration_password' => getenv('OPAYO_TEST_PASSWORD'),
  'mode' => getenv('OPAYO_MODE'),
];

Having the details on the payment gateway page allows for different values per gateway which some users may want and keeps the module inline with other gateways.

📌 Task
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom c_archer Cumbria

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @c_archer
  • 🇬🇧United Kingdom c_archer Cumbria
  • 🇬🇧United Kingdom mwjansen Bristol

    At the end of the day I need a non-ambiguous place to define settings for Opayo of which there should only be 1 instance, irrespective of how may 'opayo' gateways get created.
    I need these settings for the maintenance routines.
    Conceptually I would argue those 'maintenance' settings don't go with the payment gateway settings.
    For the API credentials I think you can argue either way: keep them with the 'generic' settings because that avoids duplication or keep them with the gateway settings because it's more intuitive.

  • 🇬🇧United Kingdom mwjansen Bristol
  • Status changed to Closed: works as designed 8 months ago
Production build 0.71.5 2024