src/icepay_api_webservice.php
public function requestRefund($paymentID, $refundAmount, $refundCurrency)
    {
        $obj = new stdClass();

        // Must be in specific order for checksum --
        $obj->Secret = $this->getSecretCode();
        $obj->MerchantID = $this->getMerchantID();
        $obj->Timestamp = $this->getTimeStamp();
        $obj->PaymentID = $paymentID;
        $obj->RefundAmount = $refundAmount;
        $obj->RefundCurrency = $refundCurrency;
        // -----------------------------------------        
        // Generate Checksum
        $obj->Checksum = $this->generateChecksum($obj);

        // Ask for getPaymentRefunds and get response
        $result = $this->client->requestRefund($obj);
        $result = $result->RequestRefundResult;

        $obj = new StdClass();

        // Must be in specific order for checksum -------------------
        $obj->Secret = $this->getSecretCode();
        $obj->MerchantID = $this->getMerchantID();
        $obj->Timestamp = $result->Timestamp;
        $obj->RefundID = $result->RefundID;
        $obj->PaymentID = $paymentID;
        $obj->RefundAmount = $refundAmount;
        $obj->RemainingRefundAmount = $result->RemainingRefundAmount;
        $obj->RefundCurrency = $refundCurrency;
        // ----------------------------------------------------------          
        // Verify response data by making a new Checksum
        $Checksum = $this->generateChecksum($obj);

        // Compare Checksums
        if ($result->Checksum != $Checksum)
            throw new Exception('Data could not be verified');

        return (array) $result;
    }
public function requestRefund($paymentID, $refundAmount, $refundCurrency)
    {
        $obj = new stdClass();

        // Must be in specific order for checksum --
        $obj->Secret = $this->getSecretCode();
        $obj->MerchantID = $this->getMerchantID();
        $obj->Timestamp = $this->getTimeStamp();
        $obj->PaymentID = $paymentID;
        $obj->RefundAmount = $refundAmount;
        $obj->RefundCurrency = $refundCurrency;
        // -----------------------------------------        
        // Generate Checksum
        $obj->Checksum = $this->generateChecksum($obj);

        // Ask for getPaymentRefunds and get response
        $result = $this->client->requestRefund($obj);
        $result = $result->RequestRefundResult;

        $obj = new StdClass();

        // Must be in specific order for checksum -------------------
        $obj->Secret = $this->getSecretCode();
        $obj->MerchantID = $this->getMerchantID();
        $obj->Timestamp = $result->Timestamp;
        $obj->RefundID = $result->RefundID;
        $obj->PaymentID = $paymentID;
        $obj->RefundAmount = $refundAmount;
        $obj->RemainingRefundAmount = $result->RemainingRefundAmount;
        $obj->RefundCurrency = $refundCurrency;
        // ----------------------------------------------------------          
        // Verify response data by making a new Checksum
        $Checksum = $this->generateChecksum($obj);

        // Compare Checksums
        if ($result->Checksum != $Checksum)
            throw new Exception('Data could not be verified');

        return (array) $result;
    }
public function requestRefund ( $ paymentID , $ refundAmount , $ refundCurrency ) { $ obj = new stdClass ( ) ; // Must be in specific order for checksum -- $ obj -> Secret = $ this -> getSecretCode ( ) ; $ obj -> MerchantID = $ this -> getMerchantID ( ) ; $ obj -> Timestamp = $ this -> getTimeStamp ( ) ; $ obj -> PaymentID = $ paymentID ; $ obj -> RefundAmount = $ refundAmount ; $ obj -> RefundCurrency = $ refundCurrency ; // -----------------------------------------         // Generate Checksum $ obj -> Checksum = $ this -> generateChecksum ( $ obj ) ; // Ask for getPaymentRefunds and get response $ result = $ this -> client -> requestRefund ( $ obj ) ; $ result = $ result -> RequestRefundResult ; $ obj = new StdClass ( ) ; // Must be in specific order for checksum ------------------- $ obj -> Secret = $ this -> getSecretCode ( ) ; $ obj -> MerchantID = $ this -> getMerchantID ( ) ; $ obj -> Timestamp = $ result -> Timestamp ; $ obj -> RefundID = $ result -> RefundID ; $ obj -> PaymentID = $ paymentID ; $ obj -> RefundAmount = $ refundAmount ; $ obj -> RemainingRefundAmount = $ result -> RemainingRefundAmount ; $ obj -> RefundCurrency = $ refundCurrency ; // ----------------------------------------------------------           // Verify response data by making a new Checksum $ Checksum = $ this -> generateChecksum ( $ obj ) ; // Compare Checksums if ( $ result -> Checksum != $ Checksum ) throw new Exception ( 'Data could not be verified' ) ; return ( array ) $ result ; }
The RequestRefund web method allows you to initiate a refund request for a payment. You can request
the entire amount to be refunded or just a part of it. If you request only a partial amount to be refunded
then you  are allowed to perform refund requests for the same payment until you have reached its full
amount. After that you cannot request refunds anymore for that payment.

@since version 2.1.0
@access public
@param int $paymentID
@param int $refundAmount Amount in cents
@param string $refundCurrency
The RequestRefund web method allows you to initiate a refund request for a payment . You can request the entire amount to be refunded or just a part of it . If you request only a partial amount to be refunded then you are allowed to perform refund requests for the same payment until you have reached its full amount . After that you cannot request refunds anymore for that payment .