Skip to content

Commit e8561a0

Browse files
authored
adds bank account tracking adapter to retrieve bank account tracking records (#84)
1 parent 270c21e commit e8561a0

File tree

6 files changed

+84
-17
lines changed

6 files changed

+84
-17
lines changed

Brewfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
tap "dart-lang/dart"
2+
tap "homebrew/bundle"
3+
tap "homebrew/cask"
4+
tap "homebrew/core"
5+
tap "hudochenkov/sshpass"
6+
tap "isen-ng/dotnet-sdk-versions"
7+
brew "apr-util"
8+
brew "cocoapods", link: false
9+
brew "libssh2"
10+
brew "openldap"
11+
brew "curl"
12+
brew "freetds"
13+
brew "gh"
14+
brew "glib"
15+
brew "helm"
16+
brew "jq"
17+
brew "krb5"
18+
brew "kubernetes-cli"
19+
brew "libpq"
20+
brew "nghttp2"
21+
brew "node"
22+
23+
brew "node@14"
24+
brew "node@16"
25+
brew "node@18", link: true
26+
brew "nvm"
27+
brew "openfortivpn"
28+
brew "[email protected]", link: true
29+
30+
brew "redis"
31+
brew "yarn"
32+
brew "zsh"
33+
brew "dart-lang/dart/dart"
34+
brew "hudochenkov/sshpass/sshpass"
35+
cask "dotnet-sdk3-1-300"
36+
cask "iterm2"

README.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,6 @@ $response = $craftgate->payment()->createPayment($request);
111111
var_dump($response);
112112
```
113113

114-
### Advanced Usage: Adapters
115-
In reality, the `Craftgate` class serves as a provider of adapters that integrates with different parts of the API. While the intended usage for most use-cases is to instantiate a `Craftgate` instance (as illustrated in the examples above) and use its adapter initializers (e.g. `payment()`).
116-
117-
**Note:** When instantiating an adapter, you can use the same options as you would when instantiating a `Craftgate`
118-
119-
All adapters in the `Craftgate` have their purposes and initializers that listed below:
120-
121-
| Adapter Name | Purpose | Initializer |
122-
|--------------|---------|----------|
123-
| `InstallmentAdapter` | Retrieving per-installment pricing information based on installment count or BIN number | `installment()` |
124-
| `OnboardingAdapter` | Conducting CRUD operations on buyers and sub merchants | `onboarding()` |
125-
| `PaymentAdapter` | Conducting payments, retrieving payment information, managing stored cards | `payment()` |
126-
| `WalletAdapter` | Managing remittance, retrieving wallet transactions | `wallet()` |
127-
| `SettlementAdapter` | Settlement operations like create instant wallet settlement | `settlement()` |
128-
| `SettlementReportingAdapter` | Settlement operations like search payout completed transactions, search bounced payout transactions | `settlementReporting()` |
129-
| `PaymentReportingAdapter` | Payment reporting operations like search payments | `paymentReporting()` |
130-
131114
### Contributions
132115
For all contributions to this client please see the contribution guide [here](CONTRIBUTING.md).
133116

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
require_once('config/sample_config.php');
4+
5+
use Craftgate\Model\Currency;
6+
7+
$request = array(
8+
'page' => 0,
9+
'size' => 10,
10+
'currency' => Currency::TL
11+
);
12+
13+
$response = SampleConfig::craftgate()->bankAccountTracking()->searchRecords($request);
14+
15+
print_r($response);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
require_once('config/sample_config.php');
4+
5+
$response = SampleConfig::craftgate()->bankAccountTracking()->retrieveRecord(1);
6+
7+
print_r($response);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Craftgate\Adapter;
4+
5+
use Craftgate\Util\QueryBuilder;
6+
7+
class BankAccountTrackingAdapter extends BaseAdapter
8+
{
9+
public function searchRecords(array $request)
10+
{
11+
$path = "/bank-account-tracking/v1/merchant-bank-account-trackings/records" . QueryBuilder::build($request);
12+
return $this->httpGet($path);
13+
}
14+
15+
public function retrieveRecord($id)
16+
{
17+
$path = "/bank-account-tracking/v1/merchant-bank-account-trackings/records/" . $id;
18+
return $this->httpGet($path);
19+
}
20+
}

src/Craftgate.php

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

33
namespace Craftgate;
44

5+
use Craftgate\Adapter\BankAccountTrackingAdapter;
56
use Craftgate\Adapter\FileReportingAdapter;
67
use Craftgate\Adapter\FraudAdapter;
78
use Craftgate\Adapter\HookAdapter;
@@ -106,4 +107,9 @@ public function masterpass()
106107
{
107108
return new MasterpassPaymentAdapter($this->options);
108109
}
110+
111+
public function bankAccountTracking()
112+
{
113+
return new BankAccountTrackingAdapter($this->options);
114+
}
109115
}

0 commit comments

Comments
 (0)