Completed
Branch master (d0d40f)
by Artem
02:44
created

AccountApi::payBalance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
//----------------------------------------------------------------------
4
//
5
//  Copyright (C) 2015-2016 Artem Rodygin
6
//
7
//  This file is part of Linode API Client Library for PHP.
8
//
9
//  You should have received a copy of the MIT License along with
10
//  the library. If not, see <http://opensource.org/licenses/MIT>.
11
//
12
//----------------------------------------------------------------------
13
14
namespace Linode;
15
16
/**
17
 * This class is autogenerated.
18
 *
19
 * @version Linode API v3.3
20
 */
21
class AccountApi extends BaseLinodeApi
22
{
23
    /**
24
     * Estimates the invoice for adding a new Linode or NodeBalancer as well as resizing a Linode. This
25
     * returns two fields: PRICE which is the estimated cost of the invoice, and INVOICE_TO which is the
26
     * date invoice would be though with timezone set to America/New_York.
27
     *
28
     * @param string $mode        [required] This is one of the following options: 'linode_new', 'linode_resize', or 'nodebalancer_new'.
29
     * @param int    $LinodeID    [optional] This is the LinodeID you want to resize and is required for mode 'linode_resize'.
30
     * @param int    $PlanID      [optional] The desired PlanID available from avail.LinodePlans(). This is required for modes 'linode_new' and 'linode_resize'.
31
     * @param int    $PaymentTerm [optional] Subscription term in months. One of: 1, 12, or 24. This is required for modes 'linode_new' and 'nodebalancer_new'.
32
     *
33
     * @return array
34
     */
35 1
    public function estimateInvoice($mode, $LinodeID = null, $PlanID = null, $PaymentTerm = null)
36
    {
37
        return $this->call('account.estimateinvoice', [
38
            'mode'        => $mode,
39
            'LinodeID'    => $LinodeID,
40
            'PlanID'      => $PlanID,
41
            'PaymentTerm' => $PaymentTerm,
42
        ]);
43 1
    }
44
45
    /**
46
     * Shows information about your account such as the date your account was opened as well as your
47
     * network utilization for the current month in gigabytes.
48
     *
49
     * @return array
50
     */
51
    public function info()
52
    {
53
        return $this->call('account.info');
54
    }
55
56
    /**
57
     * Pays current balance on file, returning it in the response.
58
     *
59
     * @return array
60
     */
61
    public function payBalance()
62
    {
63
        return $this->call('account.paybalance');
64
    }
65
66
    /**
67
     * @param int $ccNumber   [required] 
68
     * @param int $ccExpMonth [required] 
69
     * @param int $ccExpYear  [required] 
70
     *
71
     * @return array
72
     */
73
    public function updateCard($ccNumber, $ccExpMonth, $ccExpYear)
74
    {
75
        return $this->call('account.updatecard', [
76
            'ccNumber'   => $ccNumber,
77
            'ccExpMonth' => $ccExpMonth,
78
            'ccExpYear'  => $ccExpYear,
79
        ]);
80
    }
81
}
82