• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jomweb / billplz / 22912138050

10 Mar 2026 04:09PM UTC coverage: 73.745% (-23.8%) from 97.537%
22912138050

Pull #59

github

web-flow
Merge f68ad896b into 7e55fdd4e
Pull Request #59: Release Billplz 6.0 with Money objects, bundled Codex internals, and updated CI

263 of 443 new or added lines in 24 files covered. (59.37%)

3 existing lines in 2 files now uncovered.

514 of 697 relevant lines covered (73.74%)

24.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
/src/Client.php
1
<?php
2

3
namespace Billplz;
4

5
use Http\Client\Common\HttpMethodsClient as HttpClient;
6
use Laravie\Codex\Discovery;
7

8
class Client extends \Laravie\Codex\Client
9
{
10
    /**
11
     * Billplz API endpoint.
12
     *
13
     * @var string
14
     */
15
    protected $apiEndpoint = 'https://www.billplz.com/api';
16

17
    /**
18
     * Default API version.
19
     *
20
     * @var string
21
     */
22
    protected $defaultVersion = 'v4';
23

24
    /**
25
     * List of supported API versions.
26
     *
27
     * @var array<string, string>
28
     */
29
    protected $supportedVersions = [
30
        'v3' => 'Three',
31
        'v4' => 'Four',
32
        'v5' => 'Five',
33
    ];
34

35
    /**
36
     * Construct a new Billplz Client.
37
     */
38
    public function __construct(
39
        HttpClient $http,
40
        protected string $apiKey,
41
        protected ?string $signatureKey = null
42
    ) {
43
        $this->http = $http;
142✔
44
    }
45

46
    /**
47
     * Make a client.
48
     *
49
     * @return static
50
     */
51
    public static function make(string $apiKey, ?string $signatureKey = null)
52
    {
53
        return new static(Discovery::client(), $apiKey, $signatureKey);
1✔
54
    }
55

56
    /**
57
     * Use sandbox environment.
58
     *
59
     * @return $this
60
     */
61
    final public function useSandbox(): self
62
    {
63
        return $this->useCustomApiEndpoint('https://www.billplz-sandbox.com/api');
1✔
64
    }
65

66
    /**
67
     * Get API Key.
68
     */
69
    final public function getApiKey(): string
70
    {
71
        return $this->apiKey;
69✔
72
    }
73

74
    /**
75
     * Set API Key.
76
     *
77
     * @return $this
78
     */
79
    final public function setApiKey(string $apiKey): self
80
    {
UNCOV
81
        $this->apiKey = $apiKey;
×
82

UNCOV
83
        return $this;
×
84
    }
85

86
    /**
87
     * Get X-Signature Key.
88
     */
89
    final public function getSignatureKey(): ?string
90
    {
91
        return $this->signatureKey;
31✔
92
    }
93

94
    /**
95
     * Set X-Signature Key.
96
     *
97
     * @return $this
98
     */
99
    final public function setSignatureKey(?string $signatureKey = null): self
100
    {
101
        $this->signatureKey = $signatureKey;
26✔
102

103
        return $this;
26✔
104
    }
105

106
    /**
107
     * Get Collection resource.
108
     */
109
    final public function collection(?string $version = null): Contracts\Collection
110
    {
111
        return $this->uses('Collection', $version);
6✔
112
    }
113

114
    /**
115
     * Get Open Collection resource.
116
     */
117
    final public function openCollection(?string $version = null): Contracts\OpenCollection
118
    {
119
        return $this->uses('OpenCollection', $version);
5✔
120
    }
121

122
    /**
123
     * Get bill resource.
124
     */
125
    final public function bill(?string $version = null): Contracts\Bill
126
    {
127
        return $this->uses('Bill', $version);
5✔
128
    }
129

130
    /**
131
     * Get transaction resource.
132
     */
133
    final public function transaction(?string $version = null): Contracts\Bill\Transaction
134
    {
135
        return $this->uses('Bill.Transaction', $version);
5✔
136
    }
137

138
    /**
139
     * Get payout instruction collection resource.
140
     */
141
    final public function payoutCollection(): Contracts\Collection\Payout
142
    {
143
        return $this->uses('Collection.Payout', 'v4');
1✔
144
    }
145

146
    /**
147
     * Get payout instruction resource.
148
     */
149
    final public function payout(): Contracts\Payout
150
    {
151
        return $this->uses('Payout', 'v4');
1✔
152
    }
153

154
    /**
155
     * Get payout instruction resource.
156
     */
157
    final public function paymentOrder(): Contracts\PaymentOrder
158
    {
159
        return $this->uses('PaymentOrder', 'v5');
5✔
160
    }
161

162
    /**
163
     * Get payout instruction collection resource.
164
     */
165
    final public function paymentOrderCollection(): Contracts\PaymentOrderCollection
166
    {
167
        return $this->uses('PaymentOrderCollection', 'v5');
4✔
168
    }
169

170
    /**
171
     * Get bank resource.
172
     */
173
    final public function bank(?string $version = null): Contracts\BankAccount
174
    {
175
        return $this->uses('BankAccount', $version);
7✔
176
    }
177

178
    /**
179
     * Get card resource.
180
     */
181
    final public function card(): Contracts\Card
182
    {
183
        return $this->uses('Card', 'v4');
1✔
184
    }
185

186
    /**
187
     * Get resource default namespace.
188
     */
189
    final protected function getResourceNamespace(): string
190
    {
191
        return __NAMESPACE__;
139✔
192
    }
193
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc