| 1: | <?php |
| 2: | |
| 3: | |
| 4: | |
| 5: | namespace Worldline\Acquiring\Sdk; |
| 6: | |
| 7: | use Worldline\Acquiring\Sdk\Logging\CommunicatorLogger; |
| 8: | use Worldline\Acquiring\Sdk\V1\V1Client; |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | |
| 15: | class Client extends ApiResource |
| 16: | { |
| 17: | |
| 18: | |
| 19: | |
| 20: | private Communicator $communicator; |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | |
| 26: | |
| 27: | public function __construct(Communicator $communicator) |
| 28: | { |
| 29: | parent::__construct(); |
| 30: | $this->communicator = $communicator; |
| 31: | $this->context = array(); |
| 32: | } |
| 33: | |
| 34: | |
| 35: | |
| 36: | |
| 37: | protected function getCommunicator(): Communicator |
| 38: | { |
| 39: | return $this->communicator; |
| 40: | } |
| 41: | |
| 42: | |
| 43: | |
| 44: | |
| 45: | |
| 46: | |
| 47: | public function enableLogging(CommunicatorLogger $communicatorLogger): void |
| 48: | { |
| 49: | $this->getCommunicator()->enableLogging($communicatorLogger); |
| 50: | } |
| 51: | |
| 52: | |
| 53: | |
| 54: | |
| 55: | public function disableLogging(): void |
| 56: | { |
| 57: | $this->getCommunicator()->disableLogging(); |
| 58: | } |
| 59: | |
| 60: | public function v1(): V1Client |
| 61: | { |
| 62: | return new V1Client($this, $this->context); |
| 63: | } |
| 64: | } |
| 65: | |