Skip to content

Commit

Permalink
added a payment_option field in the executeTrade method and changed t…
Browse files Browse the repository at this point in the history
…he default to payment_option=2 (due to the fact that the default value of bitcoin.de side is set to 1, however an payment_option value of 1 is not possible as bitcoin.de removed the express trading option since the fidor bank shut down.) To allow other payment_options as well the param can be overwritten.
  • Loading branch information
floshodan committed Aug 3, 2024
1 parent c7cb61a commit 404d0d8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions btcde.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,14 @@ def showMyOrderDetails(self, trading_pair, order_id):
p = ParameterBuilder({}, {}, uri)
return self.APIConnect('GET', p)

def executeTrade(self, trading_pair, order_id, order_type, amount):
def executeTrade(self, trading_pair, order_id, order_type, amount, payment_option=2):
"""Buy/Sell on a specific Order."""
uri = f'{self.apibase}{trading_pair}/trades/{order_id}'
params = { 'type': order_type,
'amount_currency_to_trade': amount}
avail_params = ['type', 'amount_currency_to_trade']
'amount_currency_to_trade': amount,
'payment_option': payment_option
}
avail_params = ['type', 'amount_currency_to_trade', 'payment_option']
p = ParameterBuilder(avail_params, params, uri)
return self.APIConnect('POST', p)

Expand Down

0 comments on commit 404d0d8

Please sign in to comment.