Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/MercadoPago/Client/Payment/PaymentClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public function create(array $request, ?RequestOptions $request_options = null):

/**
* Method responsible for getting payment.
* @param int $id payment ID.
* @param float $id payment ID.
* @param \MercadoPago\Client\Common\RequestOptions request options to be sent.
* @return \MercadoPago\Resources\Payment payment found.
* @throws \MercadoPago\Exceptions\MPApiException if the request fails.
* @throws \Exception if the request fails.
*/
public function get(int $id, ?RequestOptions $request_options = null): Payment
public function get(float $id, ?RequestOptions $request_options = null): Payment
{
$response = parent::send(sprintf(self::URL_WITH_ID, strval($id)), HttpMethod::GET, null, null, $request_options);
$result = Serializer::deserializeFromJson(Payment::class, $response->getContent());
Expand All @@ -60,13 +60,13 @@ public function get(int $id, ?RequestOptions $request_options = null): Payment
}
/**
* Method responsible for cancel payment.
* @param int $id payment ID.
* @param float $id payment ID.
* @param \MercadoPago\Client\Common\RequestOptions request options to be sent.
* @return \MercadoPago\Resources\Payment payment canceled.
* @throws \MercadoPago\Exceptions\MPApiException if the request fails.
* @throws \Exception if the request fails.
*/
public function cancel(int $id, ?RequestOptions $request_options = null): Payment
public function cancel(float $id, ?RequestOptions $request_options = null): Payment
{
$payload = new PaymentCancelRequest();
$response = parent::send(sprintf(self::URL_WITH_ID, strval($id)), HttpMethod::PUT, json_encode($payload), null, $request_options);
Expand All @@ -77,14 +77,14 @@ public function cancel(int $id, ?RequestOptions $request_options = null): Paymen

/**
* Method responsible for capture payment.
* @param int $id payment ID.
* @param float $id payment ID.
* @param mixed $amount amount to be captured.
* @param \MercadoPago\Client\Common\RequestOptions request options to be sent.
* @return \MercadoPago\Resources\Payment payment captured.
* @throws \MercadoPago\Exceptions\MPApiException if the request fails.
* @throws \Exception if the request fails.
*/
public function capture(int $id, ?float $amount, ?RequestOptions $request_options = null): Payment
public function capture(float $id, ?float $amount, ?RequestOptions $request_options = null): Payment
{
$payload = new PaymentCaptureRequest();
$payload->transaction_amount = $amount;
Expand Down