commerce icon indicating copy to clipboard operation
commerce copied to clipboard

[4.x]: Gateway setting 'Only allow this gateway to be used for zero value orders?' does not save environment variable

Open samueldraper opened this issue 3 years ago • 0 comments

What happened?

Description

When trying to use an environment variable for the setting 'Only allow this gateway to be used for zero value orders?' the control panel does not save the value. Instead it reverts to the control panel Yes/No dropdown defaulting to "Yes".

It will save the setting from within the control panel dropdown. i.e. I can save it to the desired setting of 'no' and vice versa and it does recognise that the relevant environment variable exists but does not retain it upon save.

Steps to reproduce

  1. Within control panel got to Commerce > System Settings > Gatweays
  2. Choose a gateway
  3. Set the dropdown 'Only allow this gateway to be used for zero value orders?' to an environment variable that is saved in the .env file

Expected behavior

Should save the env variable.

Actual behavior

Reverts to control panel options only.

Craft CMS version

Craft Pro 4.2.0.2

Craft Commerce version

4.1.0

PHP version

8.1.8

Operating system and version

Linux 3.10.0-1160.71.1.el7.x86_64

Database type and version

MySQL 10.4.24

Image driver and version

Imagick 3.5.1

Installed plugins and versions

Screenshot 2022-08-08 at 17 40 17

samueldraper avatar Aug 08 '22 16:08 samueldraper