Passed
Branch master (4fbfcc)
by Steffen
01:26 queued 11s
created

ICashout.request_withdrawal()   A

Complexity

Conditions 1

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
c 1
b 0
f 1
dl 0
loc 16
rs 9.4285
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3
from kuon.api_response import APIResponse
4
from kuon.bitskins import BitSkins
5
from kuon.bitskins.common import *
6
7
8
class ICashout(BitSkins):
9
    """Implementation of the API methods related to the cashout on BitSkins"""
10
11
    def __init__(self, *args, **kwargs):
12
        """Initializing function"""
13
        super().__init__(*args, **kwargs)
14
15
    def request_withdrawal(self, amount: float, withdrawal_method=Processor.PAYPAL) -> APIResponse:
16
        """MoneyWithdrawal v1 implementation
17
        https://bitskins.com/api/#request_withdrawal
18
19
        :param amount:
20
        :param withdrawal_method:
21
        :return:
22
        """
23
        api_url = "https://bitskins.com/api/v1/request_withdrawal/"
24
25
        payload = {
26
            'amount': str(amount),
27
            'withdrawal_method': withdrawal_method
28
        }
29
30
        return self.api_request(api_url=api_url, params=payload)
31