BSF_Envato_Activate::process_envato_activation()

Process envato activation.


Description


Source

File: admin/bsf-core/class-bsf-envato-activate.php

	protected function process_envato_activation() {
		$token      = isset( $_GET['token'] ) ? esc_attr( $_GET['token'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
		$product_id = isset( $_GET['product_id'] ) ? esc_attr( $_GET['product_id'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended

		if ( $this->validate_token( $token, $product_id ) ) {
			$args                 = array();
			$args['purchase_key'] = isset( $_GET['purchase_key'] ) ? esc_attr( $_GET['purchase_key'] ) : '';// phpcs:ignore WordPress.Security.NonceVerification.Recommended
			$args['status']       = isset( $_GET['status'] ) ? esc_attr( $_GET['status'] ) : '';// phpcs:ignore WordPress.Security.NonceVerification.Recommended
			$this->license_manager->bsf_update_product_info( $product_id, $args );

			$this->set_message(
				array(
					'status'  => 'success',
					'message' => 'License successfully activated!',
				)
			);

		} else {

			$this->set_message(
				array(
					'status'  => 'error',
					'message' => 'The token is invalid or is expired, please try again.',
				)
			);

		}
	}


User Contributed Notes

You must log in before being able to contribute a note or feedback.