includes/class-freemius.php
function _update_billing_ajax_action() {
            $this->_logger->entrance();

            $this->check_ajax_referer( 'update_billing' );

            if ( ! $this->is_user_admin() ) {
                // Only for admins.
                self::shoot_ajax_failure();
            }

            $billing = fs_request_get( 'billing' );

            $api    = $this->get_api_user_scope();
            $result = $api->call( '/billing.json', 'put', array_merge( $billing, array(
                'plugin_id' => $this->get_parent_id(),
            ) ) );

            if ( ! $this->is_api_result_entity( $result ) ) {
                self::shoot_ajax_failure();
            }

            // Purge cached billing.
            $this->get_api_user_scope()->purge_cache( 'billing.json' );

            self::shoot_ajax_success();
        }
function _update_billing_ajax_action() {
            $this->_logger->entrance();

            $this->check_ajax_referer( 'update_billing' );

            if ( ! $this->is_user_admin() ) {
                // Only for admins.
                self::shoot_ajax_failure();
            }

            $billing = fs_request_get( 'billing' );

            $api    = $this->get_api_user_scope();
            $result = $api->call( '/billing.json', 'put', array_merge( $billing, array(
                'plugin_id' => $this->get_parent_id(),
            ) ) );

            if ( ! $this->is_api_result_entity( $result ) ) {
                self::shoot_ajax_failure();
            }

            // Purge cached billing.
            $this->get_api_user_scope()->purge_cache( 'billing.json' );

            self::shoot_ajax_success();
        }
function _update_billing_ajax_action ( ) { $ this -> _logger -> entrance ( ) ; $ this -> check_ajax_referer ( 'update_billing' ) ; if ( ! $ this -> is_user_admin ( ) ) { // Only for admins.
 self :: shoot_ajax_failure ( ) ; } $ billing = fs_request_get ( 'billing' ) ; $ api = $ this -> get_api_user_scope ( ) ; $ result = $ api -> call ( '/billing.json' , 'put' , array_merge ( $ billing , array ( 'plugin_id' => $ this -> get_parent_id ( ) , ) ) ) ; if ( ! $ this -> is_api_result_entity ( $ result ) ) { self :: shoot_ajax_failure ( ) ; } // Purge cached billing.
 $ this -> get_api_user_scope ( ) -> purge_cache ( 'billing.json' ) ; self :: shoot_ajax_success ( ) ; }
Billing update AJAX callback.

@author Vova Feldman (@svovaf)
@since  1.2.1.5
Billing update AJAX callback .