public function addBalance($user_id, $value_to_add, $transaction_type = WalletTransactionTypes::TRANSACTIONAL, $expires_in_days = 0, $transaction_id = null, $meta_data = null, $tag = null, $frozen = false){
        $url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_WALLET . Endpoints::WALLET_CREDITS;

        $params = array(
            'customer_id' => $user_id, 'value'=>$value_to_add, 'transaction_type' => $transaction_type,
            'transaction_id'=>$transaction_id, 'hold' => $frozen ? 1 : 0,
            'meta' => $meta_data, 'tag' => $tag, 'expiry' => $expires_in_days
        );

        $result = $this->authenticationService->getTransport()->fetch($url,$params,'PUT',array(),0);

        if($result["code"] == APIResponse::OVERFLOW){
            throw new QuotaExceededException("Wallet value quota exeeded");
        }

        return $result["code"] == APIResponse::RESPONSE_SUCCESS;
    }
public function addBalance($user_id, $value_to_add, $transaction_type = WalletTransactionTypes::TRANSACTIONAL, $expires_in_days = 0, $transaction_id = null, $meta_data = null, $tag = null, $frozen = false){
        $url = $this->authenticationService->getServerEndPoint() . Endpoints::VERSION . Endpoints::BASE_WALLET . Endpoints::WALLET_CREDITS;

        $params = array(
            'customer_id' => $user_id, 'value'=>$value_to_add, 'transaction_type' => $transaction_type,
            'transaction_id'=>$transaction_id, 'hold' => $frozen ? 1 : 0,
            'meta' => $meta_data, 'tag' => $tag, 'expiry' => $expires_in_days
        );

        $result = $this->authenticationService->getTransport()->fetch($url,$params,'PUT',array(),0);

        if($result["code"] == APIResponse::OVERFLOW){
            throw new QuotaExceededException("Wallet value quota exeeded");
        }

        return $result["code"] == APIResponse::RESPONSE_SUCCESS;
    }
public function addBalance ( $ user_id , $ value_to_add , $ transaction_type = WalletTransactionTypes :: TRANSACTIONAL , $ expires_in_days = 0 , $ transaction_id = null , $ meta_data = null , $ tag = null , $ frozen = false ) { $ url = $ this -> authenticationService -> getServerEndPoint ( ) . Endpoints :: VERSION . Endpoints :: BASE_WALLET . Endpoints :: WALLET_CREDITS ; $ params = array ( 'customer_id' => $ user_id , 'value' => $ value_to_add , 'transaction_type' => $ transaction_type , 'transaction_id' => $ transaction_id , 'hold' => $ frozen ? 1 : 0 , 'meta' => $ meta_data , 'tag' => $ tag , 'expiry' => $ expires_in_days ) ; $ result = $ this -> authenticationService -> getTransport ( ) -> fetch ( $ url , $ params , 'PUT' , array ( ) , 0 ) ; if ( $ result [ "code" ] == APIResponse :: OVERFLOW ) { throw new QuotaExceededException ( "Wallet value quota exeeded" ) ; } return $ result [ "code" ] == APIResponse :: RESPONSE_SUCCESS ; }
Add balance to a particular user's wallet
@param $user_id
@param $value_to_add
@param int $transaction_type
@param int|null $expires_in_days
@param null $transaction_id
@param null $meta_data
@param null $tag
@param bool|false $frozen
@return bool
@throws QuotaExceededException
Add balance to a particular user s wallet