Refund an Item’s funds held in escrow.

 @see https://reference.promisepay.com/#refund

 @return [Boolean]
2258
def refund(options = {})
      response = JSON.parse(@client.patch("items/#{send(:id)}/refund", options).body)
      @attributes = response['items']
      true
    end
376619
def delete_refund(self, refund_id):
        """"""
        request = self._delete('transactions/refunds/' + str(refund_id))
        return self.responder(request)
1084814
public function refund(
        $orderNo,
        $refundNo,
        $totalFee,
        $refundFee = null,
        $opUserId = null,
        $type = self::OUT_TRADE_NO,
        $refundAccount = 'REFUND_SOURCE_UNSETTLED_FUNDS'
    ) {
        $params = [
            $type             => $orderNo,
            'out_refund_no'   => $refundNo,
            'total_fee'       => $totalFee,
            'refund_fee'      => $refundFee ?: $totalFee,
            'refund_fee_type' => $this->merchant->fee_type,
            'refund_account'  => $refundAccount,
            'op_user_id'      => $opUserId ?: $this->merchant->merchant_id,
        ];

        return $this->safeRequest(self::API_REFUND, $params);
    }
732900
public function refunds()
    {
        if (!isset($this->refunds)) {
            $this->refunds = new Services\RefundsService($this->api_client);
        }

        return $this->refunds;
    }
912589
def update_refund(self, refund_id, refund_deets):
        """"""
        request = self._put('transactions/refunds/' + str(refund_id), refund_deets)
        return self.responder(request)
1159941
def refund_order(self, order_id, **params):
        """"""
        for required in ['currency']:
            if required not in params:
                raise ValueError("Missing required parameter: %s" % required)
        response = self._post('v2', 'orders', order_id, 'refund', data=params)
        return self._make_api_object(response, Order)
600234
public static function isRefundExist($bill_id, $refund_id)
	{
		$existRefund = Refund::whereBillId($bill_id)
			->whereRefundId($refund_id)
			->first();
		if ($existRefund != null) {
			return true;
		}

		return false;
	}
816754
public function rollBack()
    {
        $return = true;
        $opcount = $this->nestedTransactionCount;

        if ($opcount > 0) {
            if ($opcount === 1) {
                $return = parent::rollBack();
                if ($this->useDebug) {
                    $this->log('Rollback transaction', null, __METHOD__);
                }
            } else {
                $this->isUncommitable = true;
            }

            $this->nestedTransactionCount--;
        }

        return $return;
    }
332085
def fee
      response = JSON.parse(@client.get("transactions/#{send(:id)}/fees").body)
      response.key?('fees') ? Promisepay::Fee.new(@client, response['fees']) : nil
    end
808429
public function refundByTransactionId(
        $orderNo,
        $refundNo,
        $totalFee,
        $refundFee = null,
        $opUserId = null,
        $refundAccount = 'REFUND_SOURCE_UNSETTLED_FUNDS'
    ) {
        return $this->refund($orderNo, $refundNo, $totalFee, $refundFee, $opUserId, self::TRANSACTION_ID, $refundAccount);
    }
803940
public void refundTransaction(final String transactionId, @Nullable final BigDecimal amount) {
        String url = Transactions.TRANSACTIONS_RESOURCE + "/" + transactionId;
        if (amount != null) {
            url = url + "?amount_in_cents=" + (amount.intValue() * 100);
        }
        doDELETE(url);
    }
1217726
public function refund($params = null, $opts = null)
    {
        $this->refunds->create($params, $opts);
        $this->refresh();
        return $this;
    }
5351
def submit_for_settlement(amount = nil)
      warn "[DEPRECATED] submit_for_settlement as an instance method is deprecated. Please use Transaction.submit_for_settlement"
      result = @gateway.transaction.submit_for_settlement(id, amount)
      if result.success?
        copy_instance_variables_from_object result.transaction
      end
      result
    end
53329
public function getRefundResult()
    {
        $responseVariables = get_object_vars($this->getResponse());
        if (!array_key_exists('refundResult', $responseVariables)) {
            return new RefundResult();
        }
        $refundResult = $responseVariables['refundResult'];
        if (!($refundResult instanceof RefundResult)) {
            return new RefundResult();
        }
        return $refundResult;
    }
70031
def refund_order(self, request, pk):
        
        order = Order.objects.get(id=pk)
        order.refund()
        return Response(status=status.HTTP_204_NO_CONTENT)
529915
public function refunds($options = array())
    {
        if (is_array($options) && ! empty($options)) {
            $refunds = parent::execute(self::getUrl($this['id']) . '/refunds?' . http_build_query($options), parent::REQUEST_GET, parent::getResourceKey());
        } else {
            $refunds = $this['refunds'];
        }

        return new OmiseRefundList($refunds, $this['id'], $this->_publickey, $this->_secretkey);
    }
343960
def request_refund(options = {})
      response = JSON.parse(@client.patch("items/#{send(:id)}/request_refund", options).body)
      @attributes = response['items']
      true
    end