viafintech / Shopware5-Plugin-v2

1 stars 1 forks source link

Plugin always using sandbox #2

Closed wismo11 closed 3 years ago

wismo11 commented 3 years ago

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

martinseener commented 3 years ago

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 ;)

wismo11 commented 3 years ago

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: https://github.com/viafintech/Shopware5-Plugin-v2/blob/8495a680dcac8678f339889992df43b810ae5b5d/Controllers/Frontend/Barzahlen.php#L58

and

https://github.com/viafintech/Shopware5-Plugin-v2/blob/8495a680dcac8678f339889992df43b810ae5b5d/Controllers/Backend/Barzahlen.php#L17

So the testmodus switch in Shopware has no function.

martinseener commented 3 years ago

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

martinseener commented 3 years ago

@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: https://github.com/viafintech/Shopware5-Plugin-v2/blob/8495a680dcac8678f339889992df43b810ae5b5d/Controllers/Frontend/Barzahlen.php#L52 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 :)

srahmel commented 3 years ago

Just committed a fix. Thanks for your heads up.