File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33namespace Cone \SimplePay ;
44
5+ use Cone \SimplePay \Api \TransactionApi ;
6+ use GuzzleHttp \Client as Http ;
7+ use GuzzleHttp \ClientInterface ;
8+
59class 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}
You can’t perform that action at this time.
0 commit comments