diff --git a/src/DotpayApi/Client.php b/src/DotpayApi/Client.php index b6466d7..c57751f 100644 --- a/src/DotpayApi/Client.php +++ b/src/DotpayApi/Client.php @@ -44,6 +44,7 @@ public function __construct($username, $password, $base_url) /** * @param IRequest $request * @return mixed + * @throws \GuzzleHttp\Exception\GuzzleException */ public function makeRequest(IRequest $request) { diff --git a/src/DotpayApi/DotpayApi.php b/src/DotpayApi/DotpayApi.php index a0519d1..68deebd 100644 --- a/src/DotpayApi/DotpayApi.php +++ b/src/DotpayApi/DotpayApi.php @@ -43,6 +43,7 @@ public function __construct($config) /** * @param $payment * @return mixed|string + * @throws \GuzzleHttp\Exception\GuzzleException */ public function createPayment($payment) { @@ -51,10 +52,13 @@ public function createPayment($payment) /** * @param $payment + * @param $operation_number * @return mixed + * @throws \Evilnet\Dotpay\Exceptions\RequestIntegrityException + * @throws \GuzzleHttp\Exception\GuzzleException */ - public function refundPayment($payment){ - return $this->client->makeRequest(new CreateRefund($this->config['shop_id'], $payment)); + public function refundPayment($operation_number, $payment){ + return $this->client->makeRequest(new CreateRefund($operation_number, $payment)); } /** @@ -82,5 +86,4 @@ public function verifyCallback($data) { return $this->validator->verify($data); } - } diff --git a/src/DotpayApi/Response.php b/src/DotpayApi/Response.php index 0dcb7b6..1a599e8 100644 --- a/src/DotpayApi/Response.php +++ b/src/DotpayApi/Response.php @@ -77,5 +77,4 @@ public function getOperationStatus() { return $this->data['operation_status']; } - } diff --git a/src/DotpayApi/UrlCreator.php b/src/DotpayApi/UrlCreator.php index 0524be4..67e3c44 100644 --- a/src/DotpayApi/UrlCreator.php +++ b/src/DotpayApi/UrlCreator.php @@ -39,5 +39,4 @@ public function getPaymentUrlWithCHK($payment) { return $payment->payment_url.'&chk='.hash('sha256', ($this->pin.$payment->token)); } - } diff --git a/src/DotpayApi/Validator.php b/src/DotpayApi/Validator.php index 0b7e13e..d3422a7 100644 --- a/src/DotpayApi/Validator.php +++ b/src/DotpayApi/Validator.php @@ -69,5 +69,4 @@ public function verify($data) return $data['signature'] === $hash; } - } diff --git a/src/DotpayManager.php b/src/DotpayManager.php index 9614fae..7b7cdc2 100644 --- a/src/DotpayManager.php +++ b/src/DotpayManager.php @@ -35,6 +35,7 @@ public function __construct(DotpayApi $dotpayApi) /** * @param $data * @return mixed|string + * @throws \GuzzleHttp\Exception\GuzzleException */ public function createPayment($data) { @@ -42,11 +43,14 @@ public function createPayment($data) } /** + * @param $operation_number * @param $data * @return mixed + * @throws Exceptions\RequestIntegrityException + * @throws \GuzzleHttp\Exception\GuzzleException */ - public function refundPayment($data){ - return $this->dotpayApi->refundPayment($data); + public function refundPayment($operation_number, $data){ + return $this->dotpayApi->refundPayment($operation_number, $data); }