Closed iwat closed 1 year ago
Hi, @omise-php
After trying to use 2.x
branch in my personal project but have no luck (case of pure static
implementation), i decided to create an alternative repo https://github.com/phpmob/omise that designed for SOLID
use.
Hope to see SOLID
package in 3.x
branch. 👍
Feedback & PR welcome!
@liverbool That is pretty interesting one! I'll definitely check!
Since there hasn’t been any activity on this issue for a while, we’re going to close it. If you’re still experiencing this issue, please feel free to reopen it with more details and we’ll take another look.
I do not see any design document yet, so I propose a new one here:
If Omise is going to create a new 3-0-0 release, if backward compatibility is not an issue, I would like to propose 2 new designs:
static
as usual, but add service locator pattern for testability. Bonus: this can be partially implemented on 2.x.The idea:
static
, for ease of use.define
constants, for testability. (One may use class constant, if it's really a constant.)FixtureHttpClient implements \Http\Client\HttpClient
is a way to handle fixture testing, it decouples fixture management from core code that usually resides inOmiseApiResource
.EnvarCredentialProvider implements \Omise\Credential\CredentialProvider
is an example of various ways to configurepkey/skey
secret, one may use static coded, Hashicorp's Vault, or even AWS's Parameter Store, Azure's KeyVault, this one reads from environment variable which works well on dev box.OmiseClient
is a facade to all Omise APIs and libraries.Edit
static
still have the same problem testing plugins that user wants to mockOmiseClient
to test their plugin only.static
methods, no service locator, all hard wired.The idea:
static
methods, for testability.define
constants, for testability. (One may use class constant, if it's really a constant.)FixtureHttpClient implements \Http\Client\HttpClient
is a way to handle fixture testing, it decouples fixture management from core code that usually resides inOmiseApiResource
.EnvarCredentialProvider implements \Omise\Credential\CredentialProvider
is an example of various ways to configurepkey/skey
secret, one may use static coded, Hashicorp's Vault, or even AWS's Parameter Store, Azure's KeyVault, this one reads from environment variable which works well on dev box.OmiseClient
is a facade to all Omise APIs and libraries.One unanswered question:
$charge['captured']
versus$charge->captured()
, does dynamic array access still make sense?