@@ -41,8 +41,7 @@ public function __construct(
4141 ?ClientInterface $ httpClient = null ,
4242 bool $ useProd = true ,
4343 bool $ useNewPreProductionEnv = false ,
44- )
45- {
44+ ) {
4645 if (
4746 true === $ useProd
4847 && true === $ useNewPreProductionEnv
@@ -65,13 +64,11 @@ public function __construct(
6564 $ this ->useNewPreProductionEnv = $ useNewPreProductionEnv ;
6665 }
6766
68- public function getApiEndpointBase (): string
69- {
67+ public function getApiEndpointBase (): string {
7068 return $ this ->getEndpoint () . self ::API_VERSION ;
7169 }
7270
73- private function getEndpoint (): string
74- {
71+ private function getEndpoint (): string {
7572 if (true === $ this ->useNewPreProductionEnv || true === MigrationHelper::switchToNewEndpoints ()) {
7673 // new endpoints
7774 return ($ this ->useProd ? self ::API_ENDPOINT_PRODUCTION_NEW : self ::API_ENDPOINT_STAGING_NEW );
@@ -84,8 +81,7 @@ private function getEndpoint(): string
8481 /**
8582 * @throws PayconiqApiException
8683 */
87- public function requestPayment (RequestPayment $ requestPayment ): Payment
88- {
84+ public function requestPayment (RequestPayment $ requestPayment ): Payment {
8985 try {
9086 $ uri = $ this ->getApiEndpointBase () . '/payments ' . ($ requestPayment ->getPosId () ? '/pos ' : null );
9187 $ response = $ this ->httpClient ->post (
@@ -107,8 +103,7 @@ public function requestPayment(RequestPayment $requestPayment): Payment
107103 /**
108104 * @throws PayconiqApiException
109105 */
110- public function getPayment (string $ paymentId ): Payment
111- {
106+ public function getPayment (string $ paymentId ): Payment {
112107 try {
113108 $ response = $ this ->httpClient ->get (
114109 uri: $ this ->getApiEndpointBase () . '/payments/ ' . $ paymentId ,
@@ -128,8 +123,7 @@ public function getPayment(string $paymentId): Payment
128123 /**
129124 * @throws PayconiqApiException
130125 */
131- public function cancelPayment (string $ paymentId ): bool
132- {
126+ public function cancelPayment (string $ paymentId ): bool {
133127 try {
134128 $ this ->httpClient ->delete (
135129 uri: $ this ->getApiEndpointBase () . '/payments/ ' . $ paymentId ,
@@ -153,8 +147,7 @@ public function searchPayments(
153147 SearchPayments $ search ,
154148 int $ page = 0 ,
155149 int $ size = 50 ,
156- ): SearchResult
157- {
150+ ): SearchResult {
158151 try {
159152 $ uri = Modifier::from (
160153 Http::new ($ this ->getApiEndpointBase () . '/payments/search ' ),
@@ -184,8 +177,7 @@ public function searchPayments(
184177 /**
185178 * @throws PayconiqApiException
186179 */
187- public function refundPayment (string $ paymentId )
188- {
180+ public function refundPayment (string $ paymentId ) {
189181 try {
190182 $ this ->httpClient ->get (
191183 uri: $ this ->getApiEndpointBase () . '/payments/ ' . $ paymentId . '/debtor/refundIban ' ,
@@ -197,18 +189,15 @@ public function refundPayment(string $paymentId)
197189 return true ;
198190 }
199191
200- public function getApiKey (): string
201- {
192+ public function getApiKey (): string {
202193 return $ this ->apiKey ;
203194 }
204195
205- public function setApiKey (string $ apiKey ): void
206- {
196+ public function setApiKey (string $ apiKey ): void {
207197 $ this ->apiKey = $ apiKey ;
208198 }
209199
210- private function convertToPayconiqApiException (ClientException $ e ): PayconiqApiException
211- {
200+ private function convertToPayconiqApiException (ClientException $ e ): PayconiqApiException {
212201 $ contents = $ e ->getResponse ()->getBody ()->getContents () ?? null ;
213202 if (empty ($ contents )) {
214203 return new PayconiqApiException (
0 commit comments