peshay / btcde

A Python Module for Bitcoin.de Trading API
MIT License
38 stars 24 forks source link

Fix: executeTrade not possible due to payment_option set to 1 (default) if not specified #64

Closed floshodan closed 3 months ago

floshodan commented 3 months ago

With the current API Wrapper it is not possible to executeTrades. It is not possible to change the payment_option field (which is specified as a optional parameter in the docs). As its a optional Post Parameter, it is set to payment_option=1 on bitcoin.de side.

However, since the Fidor bank shutdown a payment_option=1 (Express Trade) is not possible on the platform anymore. But the payment_option is still be set if not specified, resulting in an "71 - Express Trade not allowed" Error. (Which tbh should also be fixed on bitcoin.de side, as it does not make sense)

As it was not possible to set the payment_option regardless, I added the field and changed the default value to 2 (SEPA-Buy) and also made the field optional, by overriding the method call parameter.

Optionally, rather then changing the default value in the method itself, we could allow for making the whole parameter optional with **args, so the payment_option field can still be set to the desired value when calling the method. However an existing codebase with older realeases might not work.

peshay commented 3 months ago

Thanks for your contribution! Can you also add the new parameter to the tests, so they succeed? Then I can file a new bugfix release.