#1 April 17, 2019 4:04pm

Eden-i72
Member
Registered: April 17, 2019
Posts: 2

Payment Gateway Credentials Broken

Screenshot

I just updated a site to 4.4.3. We'd noticed an issue when configuring Authorize.Net (under Developer > Payment Gateway > Authorize.Net). The form fields appear to update successfully (we see the "Updated Payment Gateway" message and get redirected to the Developer root), but once we return to the form, the fields are blank again. I did some digging and it looks like a CMS bug.

The form loads saved values for each field from a BigTreePaymentGateway object. The actual settings appear to be saving correctly when the form is submitted; it’s just that the Settings and Service properties of the BigTreePaymentGateway object don't seem to be set correctly in the constructor (in core/inc/bigtree/apis/payment-gateway.php) .

The BigTreePaymentGateway constructor calls BigTreeCMS::getSetting('bigtree-internal-payment-gateway’).

public function __construct($gateway_override = false) {
	// This returns an array of settings
	$s = BigTreeCMS::getSetting("bigtree-internal-payment-gateway");

	// ... other stuff I cut out for relevance

	// Makes an empty setting if it doesn't exist--the structure doesn't match so it sets the properties as empty
	$this->Service = isset($s["value"]["service"]) ? $s["value"]["service"] : "";
	$this->Settings = isset($s["value"]["settings"]) ? $s["value"]["settings"] : array();

	// ... the rest of the function cut out for relevance

The problem is that BigTreeCMS::getSetting returns a string or array of the setting’s value, and the BigTreePaymentGateway constructor is looking for it to return an array with the ‘value’ key set to the setting’s value. The structure expected doesn’t match the structure returned, so it’s treated as if there are no settings.

I noticed BigTreeAdmin::getSetting looks like it does return the expected structure at least in most cases (and was used in earlier versions), in case that's helpful for resolving this.

Thanks.

Offline

#2 April 17, 2019 4:11pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Payment Gateway Credentials Broken

I just received a similar bug report about S3 credentials not saving as well. I'll take a look into fixing this tomorrow morning and getting a 4.4.4 release out on Friday.

Offline

#3 April 18, 2019 9:14am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Payment Gateway Credentials Broken

This and several other settings related issues were fixed in this commit!
https://github.com/bigtreecms/BigTree-C … dce76e5fb1

Thanks for the bug report!

Offline

#4 April 19, 2019 8:18am

Eden-i72
Member
Registered: April 17, 2019
Posts: 2

Re: Payment Gateway Credentials Broken

Thanks!

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.