Skip to content

Commit

Permalink
Remove sub-resource overrides and promote direct env passing
Browse files Browse the repository at this point in the history
  • Loading branch information
oojacoboo committed Sep 16, 2020
1 parent e1d75fd commit ce55e17
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 193 deletions.
36 changes: 11 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ this is just passing an array in the following format:
'access_id' => 'xxxxxxxx',
'secure_key' => 'xxxxxxxx',
...
]
],
'live' => [
'access_id' => 'xxxxxxxx',
'secure_key' => 'xxxxxxxx',
...
],
],
'override_sub_resource_environments' => [
'address' => 'env_name',
'application' => 'env_name',
...
]
]
```

Expand Down Expand Up @@ -64,18 +64,6 @@ parameters:
sandbox: "%forte_api_livetest_sandbox%"
base_uri: ~
debug: false

override_sub_resource_environments:
address: livetest
application: livetest
customer: livetest
dispute: livetest
document: livetest
funding: livetest
pay_method: livetest
schedule_item: livetest
settlement: livetest
transaction: ~
```
### Production Environments
Expand All @@ -94,8 +82,6 @@ parameters:
sandbox: "%forte_api_default_sandbox%"
base_uri: ~
debug: false

override_sub_resource_environments: ~
```
## Usage
Expand Down Expand Up @@ -147,13 +133,13 @@ $settings = [
'access_id' => 'xxxxxxxx',
'secure_key' => 'xxxxxxxx',
...
],
'live' => [
'access_id' => 'xxxxxxxx',
'secure_key' => 'xxxxxxxx',
...
]
],
'override_sub_resource_environments' => [
'address' => 'env_name',
'application' => 'env_name',
...
]
];

$logger = new FileLogger();
Expand Down
7 changes: 2 additions & 5 deletions src/Client/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class Factory
*/
public static function make(
array $settings,
LoggerInterface $logger,
string $defaultEnvironmentKey
LoggerInterface $logger
): ForteClient
{
if (empty($settings['environments'])) {
Expand Down Expand Up @@ -74,8 +73,6 @@ public static function make(
);
}

$overrideSubResourceEnvironments = $settings['override_sub_resource_environments'] ?? [];

return new ForteClient($environments, $defaultEnvironmentKey, $overrideSubResourceEnvironments);
return new ForteClient($environments);
}
}
Loading

0 comments on commit ce55e17

Please sign in to comment.