_post("charges/{$chargeId}/refunds", $parameters); } /** * Retrieves an existing refund from the given charge. * * @param string $chargeId * @param string|null $refundId * @return array */ public function find($chargeId, $refundId = null) { if (! $refundId) { return $this->_get("refunds/{$chargeId}"); } return $this->_get("charges/{$chargeId}/refunds/{$refundId}"); } /** * Updates an existing refund on the given charge. * * @param string $chargeId * @param string $refundId * @param array $parameters * @return array */ public function update($chargeId, $refundId, array $parameters = []) { return $this->_post("charges/{$chargeId}/refunds/{$refundId}", $parameters); } /** * Lists all the refunds of the current Stripe account * or lists all the refunds for the given charge. * * @param string|null $chargeId * @param array $parameters * @return array */ public function all($chargeId = null, array $parameters = []) { if (! $chargeId) { return $this->_get('refunds', $parameters); } return $this->_get("charges/{$chargeId}/refunds", $parameters); } }