Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/bnpl-payment-integration' into b…
Browse files Browse the repository at this point in the history
…npl-payment-integration
  • Loading branch information
deryacakmak committed Nov 14, 2023
2 parents 4ef6de6 + 62b0e19 commit ae7fc08
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 18 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 "openssl@1.1"
brew "node@14"
brew "node@16"
brew "node@18", link: true
brew "nvm"
brew "openfortivpn"
brew "php@7.4", link: true
brew "python@3.9"
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
7 changes: 7 additions & 0 deletions samples/retrieve_bank_account_tracking_record.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);
15 changes: 15 additions & 0 deletions samples/search_bank_account_tracking_records.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

use Craftgate\Model\Currency;

require_once('config/sample_config.php');

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

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

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);
}
}
1 change: 0 additions & 1 deletion x.html

This file was deleted.

0 comments on commit ae7fc08

Please sign in to comment.