Skip to content

Commit a295d97

Browse files
Merge pull request #122 from CurrencyCloud/SDKPHP-96
Adds funding entry point to CurrencyCloud class
2 parents 70cebcf + 5c35d60 commit a295d97

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

src/CurrencyCloud.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use CurrencyCloud\EntryPoint\ReportsEntryPoint;
1717
use CurrencyCloud\EntryPoint\TransactionsEntryPoint;
1818
use CurrencyCloud\EntryPoint\TransfersEntryPoint;
19+
use CurrencyCloud\EntryPoint\FundingEntryPoint;
1920
use CurrencyCloud\EventDispatcher\Event\BeforeClientRequestEvent;
2021
use CurrencyCloud\EventDispatcher\Event\ClientHttpErrorEvent;
2122
use CurrencyCloud\EventDispatcher\Listener\BeforeClientRequestListener;
@@ -97,6 +98,10 @@ class CurrencyCloud
9798
* @var VansEntryPoint
9899
*/
99100
private $vansEntryPoint;
101+
/**
102+
* @var FundingEntryPoint
103+
*/
104+
private $fundingEntryPoint;
100105

101106
public static $SDK_VERSION = "3.0.0";
102107

@@ -117,6 +122,7 @@ class CurrencyCloud
117122
* @param TransactionsEntryPoint $transactionsEntryPoint
118123
* @param TransfersEntryPoint $transfersEntryPoint
119124
* @param VansEntryPoint $vanEntryPoint
125+
* @param FundingEntryPoint $fundingEntryPoint
120126
*/
121127
public function __construct(
122128
Session $session,
@@ -134,7 +140,8 @@ public function __construct(
134140
RatesEntryPoint $ratesEntryPoint,
135141
TransactionsEntryPoint $transactionsEntryPoint,
136142
TransfersEntryPoint $transfersEntryPoint,
137-
VansEntryPoint $vanEntryPoint
143+
VansEntryPoint $vanEntryPoint,
144+
FundingEntryPoint $fundingEntryPoint
138145
) {
139146
$this->referenceEntryPoint = $referenceEntryPoint;
140147
$this->session = $session;
@@ -152,6 +159,7 @@ public function __construct(
152159
$this->reportsEntryPoint = $reportsEntryPoint;
153160
$this->transfersEntryPoint = $transfersEntryPoint;
154161
$this->vansEntryPoint = $vanEntryPoint;
162+
$this->fundingEntryPoint = $fundingEntryPoint;
155163
}
156164

157165
/**
@@ -203,7 +211,8 @@ public static function createDefault(Session $session, Client $client = null)
203211
new RatesEntryPoint($client),
204212
new TransactionsEntryPoint($client),
205213
new TransfersEntryPoint($entityManager, $client),
206-
new VansEntryPoint($entityManager, $client)
214+
new VansEntryPoint($entityManager, $client),
215+
new FundingEntryPoint($client)
207216
);
208217
}
209218

@@ -327,6 +336,14 @@ public function vans()
327336
return $this->vansEntryPoint;
328337
}
329338

339+
/**
340+
* @return FundingEntryPoint
341+
*/
342+
public function funding()
343+
{
344+
return $this->fundingEntryPoint;
345+
}
346+
330347
/**
331348
* @param $contactId
332349
* @param callable $callable

tests/BaseCurrencyCloudVCRTestCase.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use CurrencyCloud\EntryPoint\BeneficiariesEntryPoint;
1111
use CurrencyCloud\EntryPoint\ContactsEntryPoint;
1212
use CurrencyCloud\EntryPoint\ConversionsEntryPoint;
13+
use CurrencyCloud\EntryPoint\FundingEntryPoint;
1314
use CurrencyCloud\EntryPoint\IbansEntryPoint;
1415
use CurrencyCloud\EntryPoint\PayersEntryPoint;
1516
use CurrencyCloud\EntryPoint\PaymentsEntryPoint;
@@ -84,7 +85,8 @@ protected function getClient(
8485
new RatesEntryPoint($client),
8586
new TransactionsEntryPoint($client),
8687
new TransfersEntryPoint($entityManager, $client),
87-
new VansEntryPoint($entityManager, $client)
88+
new VansEntryPoint($entityManager, $client),
89+
new FundingEntryPoint($client)
8890
);
8991
}
9092

0 commit comments

Comments
 (0)