Fix: executeTrade not possible due to payment_option set to 1 (default) if not specified #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.