viafintech/Shopware5-Plugin-v2

Plugin always using sandbox

Closed this issue · 5 comments

The Plugin is always using the sandbox, we can not turn it off.

Hi @wismo11.
This should be fairly easy when you send along sandbox=false as a parameter. This will tell the plugin to use the Live URL instead of the sandbox. Please see here: https://github.com/viafintech/Shopware5-Plugin-v2/blob/master/Client.php#L44
When you configure the module directly in Shopware, it should be only the "Testmodus" switch to "off".

Let me know if it helps, otherwise we will investigate further ;)

I've set the Switch in Shopware to testmodus off. But it is always using the Sandbox API instead of the Live API.

The issue is that sandbox modus is hardcoded in your code.

See:

$oClient = new Client($sDivisionID, $sApiKey, true);

and

$oClient = new Client($sDivisionID, $sApiKey, true);

So the testmodus switch in Shopware has no function.

Okay, since I'm not into that plugin, maybe @srahmel or @julie-caro can check that please?

@wismo11 I'm not a PHP programmer - so one of the other 2 guys should be able to help you out but from my understanding below this line:

$sApiKey = Shopware()->Config()->getByNamespace('ZerintBarzahlenViacash','api_key');

we should first fetch the actual config from the namespace - so wether it's sandbox or not and then use it in the 2 lines you mentioned in the last part instead of true there.

@srahmel looks like a bug to me. So maybe please fix it soon or help us out if we missunderstood something.

@wismo11 we try to quickly fix the issue. Thanks alot for pointing us in this direction :)

Just committed a fix. Thanks for your heads up.