Skip to content

Commit

Permalink
adds bank account tracking adapter to retrieve bank account tracking …
Browse files Browse the repository at this point in the history
…records (#84)
  • Loading branch information
AlicanAkkus authored Nov 10, 2023
1 parent 270c21e commit e8561a0
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 17 deletions.
36 changes: 36 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
tap "dart-lang/dart"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
tap "hudochenkov/sshpass"
tap "isen-ng/dotnet-sdk-versions"
brew "apr-util"
brew "cocoapods", link: false
brew "libssh2"
brew "openldap"
brew "curl"
brew "freetds"
brew "gh"
brew "glib"
brew "helm"
brew "jq"
brew "krb5"
brew "kubernetes-cli"
brew "libpq"
brew "nghttp2"
brew "node"
brew "[email protected]"
brew "node@14"
brew "node@16"
brew "node@18", link: true
brew "nvm"
brew "openfortivpn"
brew "[email protected]", link: true
brew "[email protected]"
brew "redis"
brew "yarn"
brew "zsh"
brew "dart-lang/dart/dart"
brew "hudochenkov/sshpass/sshpass"
cask "dotnet-sdk3-1-300"
cask "iterm2"
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,6 @@ $response = $craftgate->payment()->createPayment($request);
var_dump($response);
```

### Advanced Usage: Adapters
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()`).

**Note:** When instantiating an adapter, you can use the same options as you would when instantiating a `Craftgate`

All adapters in the `Craftgate` have their purposes and initializers that listed below:

| Adapter Name | Purpose | Initializer |
|--------------|---------|----------|
| `InstallmentAdapter` | Retrieving per-installment pricing information based on installment count or BIN number | `installment()` |
| `OnboardingAdapter` | Conducting CRUD operations on buyers and sub merchants | `onboarding()` |
| `PaymentAdapter` | Conducting payments, retrieving payment information, managing stored cards | `payment()` |
| `WalletAdapter` | Managing remittance, retrieving wallet transactions | `wallet()` |
| `SettlementAdapter` | Settlement operations like create instant wallet settlement | `settlement()` |
| `SettlementReportingAdapter` | Settlement operations like search payout completed transactions, search bounced payout transactions | `settlementReporting()` |
| `PaymentReportingAdapter` | Payment reporting operations like search payments | `paymentReporting()` |

### Contributions
For all contributions to this client please see the contribution guide [here](CONTRIBUTING.md).

Expand Down
15 changes: 15 additions & 0 deletions samples/retrieve_bank_account_tracking_record.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

require_once('config/sample_config.php');

use Craftgate\Model\Currency;

$request = array(
'page' => 0,
'size' => 10,
'currency' => Currency::TL
);

$response = SampleConfig::craftgate()->bankAccountTracking()->searchRecords($request);

print_r($response);
7 changes: 7 additions & 0 deletions samples/search_bank_account_tracking_records.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

require_once('config/sample_config.php');

$response = SampleConfig::craftgate()->bankAccountTracking()->retrieveRecord(1);

print_r($response);
20 changes: 20 additions & 0 deletions src/Adapter/BankAccountTrackingAdapter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Craftgate\Adapter;

use Craftgate\Util\QueryBuilder;

class BankAccountTrackingAdapter extends BaseAdapter
{
public function searchRecords(array $request)
{
$path = "/bank-account-tracking/v1/merchant-bank-account-trackings/records" . QueryBuilder::build($request);
return $this->httpGet($path);
}

public function retrieveRecord($id)
{
$path = "/bank-account-tracking/v1/merchant-bank-account-trackings/records/" . $id;
return $this->httpGet($path);
}
}
6 changes: 6 additions & 0 deletions src/Craftgate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Craftgate;

use Craftgate\Adapter\BankAccountTrackingAdapter;
use Craftgate\Adapter\FileReportingAdapter;
use Craftgate\Adapter\FraudAdapter;
use Craftgate\Adapter\HookAdapter;
Expand Down Expand Up @@ -106,4 +107,9 @@ public function masterpass()
{
return new MasterpassPaymentAdapter($this->options);
}

public function bankAccountTracking()
{
return new BankAccountTrackingAdapter($this->options);
}
}

0 comments on commit e8561a0

Please sign in to comment.