Skip to content

Commit eeb3496

Browse files
committed
wip
1 parent 7014a52 commit eeb3496

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

src/Client.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,22 @@
22

33
namespace Cone\SimplePay;
44

5+
use Cone\SimplePay\Api\TransactionApi;
6+
use GuzzleHttp\Client as Http;
7+
use GuzzleHttp\ClientInterface;
8+
59
class Client
610
{
711
/**
812
* The client version.
913
*/
1014
public const VERSION = '1.0.0';
1115

16+
/**
17+
* The transaction API instance.
18+
*/
19+
protected ?TransactionApi $transactions = null;
20+
1221
/**
1322
* Create a new SimplePay Client instance.
1423
*/
@@ -49,4 +58,31 @@ public function config(): Configuration
4958
{
5059
return Configuration::getDefaultConfiguration();
5160
}
61+
62+
/**
63+
* Create a new Guzzle Client instance.
64+
*/
65+
public function client(): ClientInterface
66+
{
67+
$client = new Http();
68+
69+
//
70+
71+
return $client;
72+
}
73+
74+
/**
75+
* Get the transaction API.
76+
*/
77+
public function transactions(): TransactionApi
78+
{
79+
if (is_null($this->transactions)) {
80+
$this->transactions = new TransactionApi(
81+
$this->client(),
82+
$this->config()
83+
);
84+
}
85+
86+
return $this->transactions;
87+
}
5288
}

0 commit comments

Comments
 (0)